From 39939e5be42f6bcc26c4fa736a7a1f920307b6c7 Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Thu, 12 Sep 2024 17:34:37 -0500 Subject: [PATCH] fixup! test: make verify_clean_boot respect return code by series --- tests/integration_tests/util.py | 7 +++++-- tox.ini | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/integration_tests/util.py b/tests/integration_tests/util.py index 987917addeb..bee28be27a5 100644 --- a/tests/integration_tests/util.py +++ b/tests/integration_tests/util.py @@ -355,11 +355,14 @@ def _verify_clean_boot( # we know that we should have a return code of 2 out = instance.execute("cloud-init status --long") rc = 2 - if CURRENT_RELEASE < NOBLE: + if CURRENT_RELEASE < NOBLE and "main" != os.environ.get("GITHUB_BASE_REF"): + # Old releases return 0 for backwards compatibility rc = 0 assert rc == out.return_code, ( + # CI on main doen't patch out this behavior so despite running on + # old releases it behaves as tip of main does f"Unexpected return code from `cloud-init status`. " - f"Expected rc=2, received rc={out.return_code}\nstdout: " + f"Expected rc={rc}, received rc={out.return_code}\nstdout: " f"{out.stdout}\nstderr: {out.stderr}" ) schema = instance.execute("cloud-init schema --system --annotate") diff --git a/tox.ini b/tox.ini index c2ae17ca168..520467312ac 100644 --- a/tox.ini +++ b/tox.ini @@ -243,6 +243,7 @@ passenv = CLOUD_INIT_* SSH_AUTH_SOCK OS_* + GITHUB_* setenv = PYTEST_ADDOPTS="-m ci and not adhoc"