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

🌱 E2E vbmctl and ssh boot check refactor #2223

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lentzi90
Copy link
Member

@lentzi90 lentzi90 commented Jan 28, 2025

What this PR does / why we need it:

This refactors and simplifies vbmctl by:

  • updating doc strings
  • renaming functions and variables
  • reusing one libvirt connection instead of creating a new for every operation
  • moving the ssh port to the e2e config, since vbmctl cannot influence it anyway
  • adding network name to the BMC config to unify it with the vbmctl flags

This all comes from trying to switch e2e to UEFI. It has grown too large so to avoid a monster PR, I'm now trying to push one piece at a time.

There is still a lot that could be done for vbmctl. In particular, reusing the same config struct for the tests and for creating the VMs is not ideal. We end up entangling the way we emulate bare metal with the actual test code, which should not care, nor know about it. It is also easy to get confused when some of the fields are ignored by either part of the system.

Rename confusing variables. Mostly "hostname" -> "name", because it
didn't have anything to do with the hostname. It is just the name of the
VM we create, and that happens to also become the hostname unless
changed elsewhere.
Simplify LoadBMCConfig and vbmctl main.

Signed-off-by: Lennart Jern <[email protected]>
Initialize the connection once and reuse, instead of constantly creating
new connections.

Signed-off-by: Lennart Jern <[email protected]>
@metal3-io-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@metal3-io-bot metal3-io-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 28, 2025
@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from lentzi90. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot metal3-io-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 28, 2025
@lentzi90 lentzi90 marked this pull request as ready for review January 28, 2025 13:05
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 28, 2025
@metal3-io-bot metal3-io-bot requested review from honza and s3rj1k January 28, 2025 13:05
@tuminoid
Copy link
Member

/test metal3-ubuntu-e2e-integration-main
Just in case ... 😅

@metal3-io-bot
Copy link
Contributor

@tuminoid: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test generate
/test gomod
/test manifestlint
/test markdownlint
/test shellcheck
/test test

The following commands are available to trigger optional jobs:

/test metal3-centos-e2e-basic-test-main
/test metal3-centos-e2e-feature-test-main-features
/test metal3-centos-e2e-feature-test-main-pivoting
/test metal3-centos-e2e-feature-test-main-remediation
/test metal3-centos-e2e-integration-test-main
/test metal3-dev-env-integration-test-centos-main
/test metal3-dev-env-integration-test-ubuntu-main
/test metal3-e2e-1-29-1-30-upgrade-test-main
/test metal3-e2e-clusterctl-upgrade-test-main
/test metal3-ubuntu-e2e-basic-test-main
/test metal3-ubuntu-e2e-feature-test-main-features
/test metal3-ubuntu-e2e-feature-test-main-pivoting
/test metal3-ubuntu-e2e-feature-test-main-remediation
/test metal3-ubuntu-e2e-integration-test-main

Use /test all to run the following jobs that were automatically triggered:

generate
gomod
manifestlint
shellcheck
test

In response to this:

/test metal3-ubuntu-e2e-integration-main
Just in case ... 😅

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tuminoid
Copy link
Member

/test metal3-centos-e2e-integration-test-main

Copy link
Member

@mquhuy mquhuy left a comment

Choose a reason for hiding this comment

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

Thanks. This is imo a good improvement. Just have a small question regarding the implementation details.

Otherwise lgtm.

test/e2e/bmc.go Show resolved Hide resolved
@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 29, 2025
@elfosardo
Copy link
Member

/test metal3-ubuntu-e2e-integration-test-main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants