2323]
2424
2525qemu_blacklist = [
26- "tcp_close_without_reading_on_firecracker "
26+ "tcp_close_without_reading_on_fc "
2727]
2828
2929firecracker_blacklist = [
@@ -51,16 +51,18 @@ def __init__(self, name):
5151test_files = []
5252is_comment = re .compile ("^[ \t ]*(|#.*|\[manifest])$" )
5353is_test = re .compile ("^/tests/tst-.*.so" )
54- with open ('modules/tests/usr.manifest' , 'r' ) as f :
55- for line in f :
56- line = line .rstrip ();
57- if is_comment .match (line ): continue ;
58- components = line .split (": " , 2 );
59- guestpath = components [0 ].strip ();
60- hostpath = components [1 ].strip ()
61- if is_test .match (guestpath ):
62- test_files .append (guestpath );
63- add_tests ((TestRunnerTest (os .path .basename (x )) for x in test_files ))
54+
55+ def collect_tests ():
56+ with open (cmdargs .manifest , 'r' ) as f :
57+ for line in f :
58+ line = line .rstrip ();
59+ if is_comment .match (line ): continue ;
60+ components = line .split (": " , 2 );
61+ guestpath = components [0 ].strip ();
62+ hostpath = components [1 ].strip ()
63+ if is_test .match (guestpath ):
64+ test_files .append (guestpath );
65+ add_tests ((TestRunnerTest (os .path .basename (x )) for x in test_files ))
6466
6567def run_test (test ):
6668 sys .stdout .write (" TEST %-35s" % test .name )
@@ -183,6 +185,7 @@ def run_tests():
183185 print (("OK (%d %s run, %.3f s)" % (len (tests_to_run ), pluralize ("test" , len (tests_to_run )), duration )))
184186
185187def main ():
188+ collect_tests ()
186189 while True :
187190 run_tests ()
188191 if not cmdargs .repeat :
@@ -197,6 +200,8 @@ def main():
197200 parser .add_argument ("-p" , "--hypervisor" , action = "store" , default = "qemu" , help = "choose hypervisor to run: qemu, firecracker" )
198201 parser .add_argument ("--name" , action = "store" , help = "run all tests whose names match given regular expression" )
199202 parser .add_argument ("--run_options" , action = "store" , help = "pass extra options to run.py" )
203+ parser .add_argument ("-m" , "--manifest" , action = "store" , default = "modules/tests/usr.manifest" , help = "test manifest" )
204+ parser .add_argument ("-b" , "--blacklist" , action = "append" , help = "test to be blacklisted" , default = [])
200205 cmdargs = parser .parse_args ()
201206 set_verbose_output (cmdargs .verbose )
202207 if cmdargs .run_options != None :
@@ -207,4 +212,5 @@ def main():
207212 blacklist .extend (firecracker_blacklist )
208213 else :
209214 blacklist .extend (qemu_blacklist )
215+ blacklist .extend (cmdargs .blacklist )
210216 main ()
0 commit comments