[CRIU] [PATCH 1/3] zdtm.py: Print tests info when listing them

Pavel Emelyanov xemul at parallels.com
Thu Oct 8 07:27:24 PDT 2015


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

diff --git a/test/zdtm.py b/test/zdtm.py
index aad649d..193af91 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -560,8 +560,19 @@ def run_tests(opts):
 		l.finish()
 
 
+sti_fmt = "%-40s%-10s%s"
+
+def show_test_info(t):
+	tdesc = get_test_desc(t)
+	flavs = tdesc.get('flavor', '')
+	return sti_fmt % (t, flavs, tdesc.get('flags', ''))
+
+
 def list_tests(opts):
 	tlist = all_tests(opts)
+	if opts['info']:
+		print sti_fmt % ('Name', 'Flavors', 'Flags')
+		tlist = map(lambda x: show_test_info(x), tlist)
 	print '\n'.join(tlist)
 
 #
@@ -606,6 +617,7 @@ rp.add_argument("-p", "--parallel", help = "Run test in parallel")
 
 lp = sp.add_parser("list", help = "List tests")
 lp.set_defaults(action = list_tests)
+lp.add_argument('-i', '--info', help = "Show more info about tests", action = 'store_true')
 
 opts = vars(p.parse_args())
 
-- 
1.9.3




More information about the CRIU mailing list