Page MenuHomeDevCentral

Detect when test suite runs with privileged access
ClosedPublic

Authored by dereckson on Mar 11 2020, 14:42.
Tags
None
Referenced Files
F7912973: D2278.id5738.diff
Mon, May 5, 03:56
F7912883: D2278.id5740.diff
Mon, May 5, 03:53
F7912826: D2278.id5739.diff
Mon, May 5, 03:52
F7907508: D2278.diff
Mon, May 5, 00:57
F7901215: D2278.id.diff
Sun, May 4, 21:53
Unknown Object (File)
Sun, May 4, 03:44
Unknown Object (File)
Mon, Apr 28, 20:28
Unknown Object (File)
Mon, Apr 28, 16:02
Subscribers
None

Details

Summary

When the test suite runs as root under Linux or FreeBSD,
or with elevated status ('runs as administrator') on Windows,
the process can see normally non-readable files.

As such, we skip the relevant tests.

Test Plan
  • Windows: runs in a regular console and a privileged console
  • Debian: runs as root, and with sudo -u nobody phpunit
  • FreeBSD: runs trim(shell_exec('id -u')) with psysh

Diff Detail

Repository
rKOT Keruald OmniTools
Lint
Lint Errors
SeverityLocationCodeMessage
Errortests/Reflection/CodeFileTest.php:40PHPCS.E.Generic.WhiteSpace.DisallowTabIndent.TabsUsedGeneric.WhiteSpace.DisallowTabIndent.TabsUsed
Errortests/Reflection/CodeFileTest.php:65PHPCS.E.Generic.WhiteSpace.DisallowTabIndent.TabsUsedGeneric.WhiteSpace.DisallowTabIndent.TabsUsed
Unit
Tests Passed
Branch
master
Build Status
Buildable 3537
Build 3786: arc lint + arc unit