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

test-runner: catch exception on test file removal

Without catching this can result in a fatal error, ending the
test run.
This commit is contained in:
James Prestwood 2021-12-22 17:12:21 -08:00 committed by Denis Kenzior
parent 76d54b28ea
commit 9fc53cfa7b

View File

@ -1380,7 +1380,10 @@ def post_test(ctx, to_copy):
allowed = ['phonesim.conf', 'certs', 'secrets', 'iwd'] allowed = ['phonesim.conf', 'certs', 'secrets', 'iwd']
for f in [f for f in os.listdir('/tmp') if f not in allowed]: for f in [f for f in os.listdir('/tmp') if f not in allowed]:
dbg("File %s was not cleaned up!" % f) dbg("File %s was not cleaned up!" % f)
try:
os.remove('/tmp/' + f) os.remove('/tmp/' + f)
except:
pass
def print_results(results): def print_results(results):
table = PrettyTable(['Test', colored('Passed', 'green'), colored('Failed', 'red'), \ table = PrettyTable(['Test', colored('Passed', 'green'), colored('Failed', 'red'), \