run-unit-tests: add option to run unsafe tests too
This commit is contained in:
parent
3762f8e316
commit
f5acf84dbe
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import argparse
|
||||||
import dataclasses
|
import dataclasses
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
@ -22,7 +23,18 @@ class Total:
|
||||||
skip:int = 0
|
skip:int = 0
|
||||||
fail:int = 0
|
fail:int = 0
|
||||||
|
|
||||||
|
def argument_parser():
|
||||||
|
p = argparse.ArgumentParser()
|
||||||
|
p.add_argument('-u', '--unsafe', action='store_true',
|
||||||
|
help='run "unsafe" tests too')
|
||||||
|
return p
|
||||||
|
|
||||||
|
opts = argument_parser().parse_args()
|
||||||
|
|
||||||
tests = glob.glob('/usr/lib/systemd/tests/test-*')
|
tests = glob.glob('/usr/lib/systemd/tests/test-*')
|
||||||
|
if opts.unsafe:
|
||||||
|
tests += glob.glob('/usr/lib/systemd/tests/unsafe/test-*')
|
||||||
|
|
||||||
total = Total(total=len(tests))
|
total = Total(total=len(tests))
|
||||||
for test in tests:
|
for test in tests:
|
||||||
name = os.path.basename(test)
|
name = os.path.basename(test)
|
||||||
|
|
Loading…
Reference in New Issue