Page MenuHomeDevCentral

Detect when test suite runs with privileged access
ClosedPublic

Authored by dereckson on Mar 11 2020, 14:42.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 23, 07:36
Unknown Object (File)
Sun, Jun 21, 17:12
Unknown Object (File)
Sat, Jun 20, 03:38
Unknown Object (File)
Thu, Jun 18, 20:51
Unknown Object (File)
Wed, Jun 17, 20:55
Unknown Object (File)
Wed, Jun 17, 14:46
Unknown Object (File)
Wed, Jun 17, 09:26
Unknown Object (File)
Wed, Jun 17, 04:23
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