[CRIU] [PATCH] zdtm: Add ability to run tests from list

Pavel Emelyanov xemul at virtuozzo.com
Thu Mar 24 05:56:35 PDT 2016


Sometimes when running tests manually it's tempting to
prepare the list of tests to run in advance and then
run only those. E.g. -- when testing a new feature
that affects only _some_ tests. This option allows it.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 test/zdtm.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/zdtm.py b/test/zdtm.py
index a499251..58ba04e 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -1199,6 +1199,13 @@ def run_tests(opts):
 	elif opts['test']:
 		torun = opts['test']
 		run_all = False
+	elif opts['from']:
+		if not os.access(opts['from'], os.R_OK):
+			print "No such file"
+			return
+
+		torun = map(lambda x: x.strip(), open(opts['from']))
+		run_all = True
 	else:
 		print "Specify test with -t <name> or -a"
 		return
@@ -1459,6 +1466,7 @@ rp.set_defaults(action = run_tests)
 rp.add_argument("-a", "--all", action = 'store_true')
 rp.add_argument("-t", "--test", help = "Test name", action = 'append')
 rp.add_argument("-T", "--tests", help = "Regexp")
+rp.add_argument("-F", "--from", help = "From file")
 rp.add_argument("-f", "--flavor", help = "Flavor to run")
 rp.add_argument("-x", "--exclude", help = "Exclude tests from --all run", action = 'append')
 
-- 
2.5.0


More information about the CRIU mailing list