3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-28 21:19:24 +01:00

test-runner: delay starting the shell until after pre_test

This makes --shell somewhat more useful by copying all the test
files and starting test processes before dumping the user into
a shell.
This commit is contained in:
James Prestwood 2020-11-16 14:25:10 -08:00 committed by Denis Kenzior
parent 6bf514c4c3
commit f88d45c9d3

View File

@ -1005,19 +1005,19 @@ def run_auto_tests(ctx, args):
shutil.copytree(args.testhome + '/autotests/misc/secrets', '/tmp/secrets') shutil.copytree(args.testhome + '/autotests/misc/secrets', '/tmp/secrets')
shutil.copy(args.testhome + '/autotests/misc/phonesim/phonesim.conf', '/tmp') shutil.copy(args.testhome + '/autotests/misc/phonesim/phonesim.conf', '/tmp')
if args.shell:
#
# Shell really isn't meant to be used with multiple tests. If
# a set of tests was passed in just start out in the first.
#
os.chdir(tests[0])
os.system('/bin/bash')
exit()
for test in tests: for test in tests:
try: try:
copied, subtests = pre_test(ctx, test) copied, subtests = pre_test(ctx, test)
if args.shell:
#
# Shell really isn't meant to be used with multiple tests. If
# a set of tests was passed in just start out in the first.
#
os.chdir(tests[0])
os.system('/bin/bash')
exit()
if len(subtests) < 1: if len(subtests) < 1:
dbg("No tests to run") dbg("No tests to run")
exit() exit()