t/latency_percentiles: run cmdprio_percentage tests only if root
authorVincent Fu <vincent.fu@wdc.com>
Mon, 18 May 2020 17:41:52 +0000 (13:41 -0400)
committerVincent Fu <vincent.fu@wdc.com>
Mon, 18 May 2020 19:54:33 +0000 (15:54 -0400)
The libaio/io_uring cmdprio_percentage option only works when fio is run
from the root user account. Skip these tests (instead of failing) when
this test script is run from a regular user account.

Signed-off-by: Vincent Fu <vincent.fu@wdc.com>
t/latency_percentiles.py

index 5cdd49cf77bcb2fcde6d7b82b3f5966768fa04af..972e2642dfa10d02ac84732ddb328dbc70d866ab 100755 (executable)
@@ -1303,9 +1303,9 @@ def main():
            (args.run_only and test['test_id'] not in args.run_only):
             skipped = skipped + 1
             outcome = 'SKIPPED (User request)'
-        elif platform.system() != 'Linux' and 'cmdprio_percentage' in test:
+        elif (platform.system() != 'Linux' or os.geteuid() != 0) and 'cmdprio_percentage' in test:
             skipped = skipped + 1
-            outcome = 'SKIPPED (Linux required for cmdprio_percentage tests)'
+            outcome = 'SKIPPED (Linux root required for cmdprio_percentage tests)'
         else:
             test_obj = test['test_obj'](artifact_root, test, args.debug)
             status = test_obj.run_fio(fio)