Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update upgrade test #846

Merged
merged 2 commits into from
Dec 5, 2024
Merged

Update upgrade test #846

merged 2 commits into from
Dec 5, 2024

Conversation

mattiaswal
Copy link
Contributor

@mattiaswal mattiaswal commented Nov 29, 2024

Description

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

@mattiaswal mattiaswal marked this pull request as draft November 29, 2024 12:58
@mattiaswal mattiaswal requested a review from wkz November 29, 2024 14:25
@mattiaswal mattiaswal force-pushed the fix-upgrade-test branch 4 times, most recently from 13c34cf to ac86a74 Compare December 3, 2024 11:21
@mattiaswal mattiaswal marked this pull request as ready for review December 3, 2024 11:25
Copy link
Contributor

@wkz wkz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Great to finally be able to include this in the suite 👏 👏

test/case/ietf_system/upgrade/test.py Outdated Show resolved Hide resolved
test/case/ietf_system/upgrade/test.py Outdated Show resolved Hide resolved
test/case/ietf_system/upgrade/test.py Outdated Show resolved Hide resolved
test/case/ietf_system/upgrade/test.py Outdated Show resolved Hide resolved

with test.step("Verify the boot order is the orignal configured"):
# Wait for sshd to start.
until(lambda: old_bootorder == bootloader.get_boot_order(), attempts=200)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
until(lambda: old_bootorder == bootloader.get_boot_order(), attempts=200)
order = bootloader.get_boot_order()
assert order == old_bootorder, f"Unexpected bootorder: {repr(order)}"

until seems counter intuitive here, since the boot order is not a volatile thing. Do we need more assurances from the SSH connection? Should we add a long -oConnectTimeout 300 or something?

Also, if this ever happens, I think we want to know which state we're leaving the system in

test/case/ietf_system/upgrade/test.py Show resolved Hide resolved

def set_boot_order(self, order):
return self.ssh.run(f"sudo grub-editenv /mnt/aux/grub/grubenv set ORDER='{order}'".split()).returncode

with infamy.Test() as test:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to add some way for a test implementation to register cleanup functions. Such that the boot order is restored even if we break the test in the middle (e.g., pressing C-c)

@mattiaswal mattiaswal force-pushed the fix-upgrade-test branch 2 times, most recently from 8c66b8c to 85a3d5d Compare December 4, 2024 09:37
Copy link
Contributor

@wkz wkz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 it!

@mattiaswal mattiaswal force-pushed the fix-upgrade-test branch 6 times, most recently from e32ba34 to 47c5492 Compare December 5, 2024 01:05
@troglobit
Copy link
Contributor

Nice work, only some squash and rebase left to do! 😎 👍

@mattiaswal mattiaswal merged commit 1db039d into main Dec 5, 2024
6 checks passed
@mattiaswal mattiaswal deleted the fix-upgrade-test branch December 5, 2024 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants