Skip to content

Commit

Permalink
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 b88f910 commit ae64a89
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/integration_tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from cloudinit.subp import subp
from tests.integration_tests.integration_settings import PLATFORM
from tests.integration_tests.releases import CURRENT_RELEASE, NOBLE

LOG = logging.getLogger("integration_testing.util")

Expand Down Expand Up @@ -347,13 +348,16 @@ def _verify_clean_boot(
out = instance.execute("cloud-init status --long")
assert 1 != out.return_code, (
f"Unexpected return code from `cloud-init status`. Expected rc=0 "
f"or rc=2, received rc={out.return_code}\nstdout: "
f"{out.stdout}\nstderr: {out.stderr}"
f"or rc=2, received rc={out.return_code}\nstdout:\n"
f"{out.stdout}\nstderr:\n{out.stderr}"
)
else:
# we know that we should have a return code of 2
out = instance.execute("cloud-init status --long")
assert 2 == out.return_code, (
rc = 2
if CURRENT_RELEASE < NOBLE:
rc = 0
assert rc == out.return_code, (
f"Unexpected return code from `cloud-init status`. "
f"Expected rc=2, received rc={out.return_code}\nstdout: "
f"{out.stdout}\nstderr: {out.stderr}"
Expand Down

0 comments on commit ae64a89

Please sign in to comment.