Skip to content

Commit 3dc2650

Browse files
committed
Improve robustness of openstack_test.py by reporting tests as ABORT
... when pre-flight checks fail. Signed-off-by: Matthias Büchse <matthias.buechse@alasca.cloud>
1 parent 1b06a44 commit 3dc2650

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

Tests/iaas/openstack_test.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def harness(name, *check_fns):
231231
print(f"{name}: {result}")
232232

233233

234-
def run_sanity_checks(container):
234+
def run_preflight_checks(container):
235235
# make sure that we can connect to the cloud and that the user doesn't have elevated privileges
236236
# the former would lead to each testcase aborting with a marginally useful message;
237237
# the latter would lead to scs_0116_permissions aborting, which we don't want to single out
@@ -278,7 +278,13 @@ def main(argv):
278278
sys.exit(1)
279279

280280
c = make_container(cloud)
281-
run_sanity_checks(c)
281+
try:
282+
run_preflight_checks(c)
283+
except Exception:
284+
logger.critical("Pre-flight checks failed. Reporting all testcases as ABORT.")
285+
for testcase in testcases:
286+
print(f"{testcase}: ABORT")
287+
raise
282288
for testcase in testcases:
283289
harness(testcase, lambda: getattr(c, testcase.replace('-', '_')))
284290
return 0

0 commit comments

Comments
 (0)