You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
It's possible to have tests that require to be executed in root/sudo context, as well as tests that explicitly require to be executed not as root/sudo. I have some of these tests, and managing them is a bit of a pain, with tagging not quite sufficient to handle the problem.
Example of test requiring sudo:
We use libusb to work with devices, and some of the libusb operations require root to be able to access devices. If tests are run without sudo, they fail. It would be good to be able to mark such tests as [!sudo] or [!root], and if test is run without sudo rights, fail softly (or have a way via CLI to control how such fail. I.e. similar to how [!mayfail] works, but more explicit with finer control.
Example of test explicitly requiring not sudo:
We have networking code that specifically checks how code handles where it cannot open listener on privileged port (as expected condition). Running as sudo will actually make the function succeed, and thereby fail the test. That test is expected to be run without sudo rights. It would be good to be able to mark such tests as [!nosudo] or [!noroot], and fail softly if run as root.
Additionally, to help handle test suites that contain tests that require sudo as well as tests that explicitly detest sudo, it would be good to be able to execute test suite with sudo rights, have it run tests that require sudo, then for it to drop its rights to non-sudo, and run remainder of tests that do not require sudo.
Such feature would allow for easier management and handling of full suite of tests.
The text was updated successfully, but these errors were encountered:
Description
It's possible to have tests that require to be executed in
root
/sudo
context, as well as tests that explicitly require to be executed not asroot
/sudo
. I have some of these tests, and managing them is a bit of a pain, with tagging not quite sufficient to handle the problem.Example of test requiring sudo:
We use libusb to work with devices, and some of the libusb operations require root to be able to access devices. If tests are run without sudo, they fail. It would be good to be able to mark such tests as
[!sudo]
or[!root]
, and if test is run without sudo rights, fail softly (or have a way via CLI to control how such fail. I.e. similar to how[!mayfail]
works, but more explicit with finer control.Example of test explicitly requiring not sudo:
We have networking code that specifically checks how code handles where it cannot open listener on privileged port (as expected condition). Running as sudo will actually make the function succeed, and thereby fail the test. That test is expected to be run without sudo rights. It would be good to be able to mark such tests as
[!nosudo]
or[!noroot]
, and fail softly if run as root.Additionally, to help handle test suites that contain tests that require sudo as well as tests that explicitly detest sudo, it would be good to be able to execute test suite with sudo rights, have it run tests that require sudo, then for it to drop its rights to non-sudo, and run remainder of tests that do not require sudo.
Such feature would allow for easier management and handling of full suite of tests.
The text was updated successfully, but these errors were encountered: