Skip to content

Commit

Permalink
fixup! test: make verify_clean_boot respect return code by series
Browse files Browse the repository at this point in the history
  • Loading branch information
holmanb committed Sep 12, 2024
1 parent ae64a89 commit 39939e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/integration_tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ passenv =
CLOUD_INIT_*
SSH_AUTH_SOCK
OS_*
GITHUB_*
setenv =
PYTEST_ADDOPTS="-m ci and not adhoc"

Expand Down

0 comments on commit 39939e5

Please sign in to comment.