mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +01:00
test-runner: Fix checks in exit_vm
We check that config is not None but then access config.ctx outside of that if block anyway. Then we do the same for config.ctx and config.ctx.args. Nest the if blocks for the checks to be useful.
This commit is contained in:
parent
ce94013bae
commit
0201cde7ce
@ -61,15 +61,15 @@ def exit_vm():
|
|||||||
print("Process %s still running!" % p.args[0])
|
print("Process %s still running!" % p.args[0])
|
||||||
p.kill()
|
p.kill()
|
||||||
|
|
||||||
if config.ctx and config.ctx.results:
|
if config.ctx and config.ctx.results:
|
||||||
success = print_results(config.ctx.results)
|
success = print_results(config.ctx.results)
|
||||||
else:
|
else:
|
||||||
success = False
|
success = False
|
||||||
|
|
||||||
if config.ctx.args.result:
|
if config.ctx and config.ctx.args.result:
|
||||||
result = 'PASS' if success else 'FAIL'
|
result = 'PASS' if success else 'FAIL'
|
||||||
with open(config.ctx.args.result, 'w') as f:
|
with open(config.ctx.args.result, 'w') as f:
|
||||||
f.write(result)
|
f.write(result)
|
||||||
|
|
||||||
os.sync()
|
os.sync()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user