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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃尡 Re-inspection by annotation test added #1402

Merged
merged 1 commit into from Nov 1, 2023

Conversation

adilGhaffarDev
Copy link
Member

@adilGhaffarDev adilGhaffarDev commented Oct 24, 2023

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1369

@metal3-io-bot metal3-io-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 24, 2023
@adilGhaffarDev
Copy link
Member Author

/metal3-bmo-e2e-test

test/e2e/inspection_test.go Outdated Show resolved Hide resolved
@hardys
Copy link
Member

hardys commented Oct 24, 2023

/cc @lentzi90 @dtantsur

@lentzi90
Copy link
Member

Sorry for unrelated triggers... we have issues with prow so I'm debugging.
/test unit

@lentzi90
Copy link
Member

/test unit

1 similar comment
@lentzi90
Copy link
Member

/test unit

@adilGhaffarDev adilGhaffarDev force-pushed the re-inspection-test/adil branch 2 times, most recently from 2af3d6d to 9fdb68c Compare October 30, 2023 14:33
@metal3-io-bot metal3-io-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 30, 2023
@lentzi90
Copy link
Member

/metal3-bmo-e2e-test

@@ -31,6 +31,7 @@ intervals:
inspection/wait-inspecting: ["5s", "10ms"]
inspection/wait-available: ["5s", "1ms"]
external-inspection/wait-available: ["5s", "1ms"]
re-inspection/wait-available: ["5m", "1s"]
Copy link
Member

Choose a reason for hiding this comment

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

Probably we can reuse here inspection/wait-available?
Edit: I think probably inspection/wait-available should be changed to default/wait-available since this is what we have in ironic.yaml. Probably missed to change it here before.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a new one because the others were very small and re-inspection was taking some time. Should I change default/wait-available: in both fixture and ironic to ["10m", "10s"] and use that instead?

Copy link
Member

Choose a reason for hiding this comment

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

Fixture is different it should not take much time. Let me check!

Copy link
Member Author

Choose a reason for hiding this comment

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

available after re-inspection almost takes 3 minutes I think:

  STEP: waiting for the BMH to become available after re-inspection @ 10/31/23 08:40:01.681
  STEP: checking that the hardware details are corrected after re-inspection @ 10/31/23 08:42:54.127

Copy link
Member

Choose a reason for hiding this comment

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

For fixture it takes less than a second most of the time.

  STEP: adding InspectAnnotation to re-inspect @ 10/31/23 10:54:30.718
  STEP: waiting for the BMH to be in inspecting state after inspection annotaion @ 10/31/23 10:54:30.739
  STEP: waiting for the BMH to become available after re-inspection @ 10/31/23 10:54:30.756
  STEP: checking that the hardware details are corrected after re-inspection @ 10/31/23 10:54:30.961

Fixture is not what runs of you use the ci-e2e.sh script. If you want to run it you need to check the bottom of the readme here: https://github.com/metal3-io/baremetal-operator/blob/main/test/e2e/README.md

Copy link
Member

Choose a reason for hiding this comment

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

One more thing! If you run into any issues running the tests with the fixture provider on Mac, please bring them up! I want this to be easy for developers to run 馃檪

Copy link
Member Author

Choose a reason for hiding this comment

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

I was running tests in VM but I will try on my mac too.

@@ -32,6 +32,7 @@ intervals:
default/wait-registering: ["1m", "5s"]
inspection/wait-registration-error: ["1m", "5s"]
external-inspection/wait-available: ["20s", "1s"]
re-inspection/wait-available: ["5m", "1s"]
Copy link
Member

Choose a reason for hiding this comment

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

Here we could probably reuse default/wait-available. I don't think re-inspection would have different timing from normal inspection.

Copy link
Member

Choose a reason for hiding this comment

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

Perfect!

Copy link
Member

Choose a reason for hiding this comment

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

I think we don't need the changes in this file. It is enough with the separate re-inspection test

Copy link
Member Author

Choose a reason for hiding this comment

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

oh I forgot to remove it. let me change it

By("checking that the hardware details are corrected after re-inspection")
key = types.NamespacedName{Namespace: bmh.Namespace, Name: bmh.Name}
Expect(clusterProxy.GetClient().Get(ctx, key, &bmh)).To(Succeed())
Expect(bmh.Status.HardwareDetails.Hostname).To(Equal(rightHostName))
Copy link
Member

Choose a reason for hiding this comment

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

We need to make this configurable so that the test can be used in other contexts. I think it will be fine to just add a variable to the e2e config with the expected hostname. To verify that it works, we can check with the fixture provider. The hardware details that it returns are hard coded here:

&metal3api.HardwareDetails{
RAMMebibytes: 128 * 1024,
NIC: []metal3api.NIC{
{
Name: "nic-1",
Model: "virt-io",
MAC: "ab:cd:12:34:56:78",
IP: "192.168.100.1",
SpeedGbps: 1,
PXE: true,
},
{
Name: "nic-2",
Model: "e1000",
MAC: "12:34:56:78:ab:cd",
IP: "192.168.100.2",
SpeedGbps: 1,
PXE: false,
},
},
Storage: []metal3api.Storage{
{
Name: "disk-1 (boot)",
Rotational: false,
SizeBytes: metal3api.TebiByte * 93,
Model: "Dell CFJ61",
},
{
Name: "disk-2",
Rotational: false,
SizeBytes: metal3api.TebiByte * 93,
Model: "Dell CFJ61",
},
},
CPU: metal3api.CPU{
Arch: "x86_64",
Model: "FancyPants CPU",
ClockMegahertz: 3.0 * metal3api.GigaHertz,
Flags: []string{"fpu", "hypervisor", "sse", "vmx"},
Count: 1,
},

As you can see it does not set any hostname, so for fixture we would set "". If we can get the test passing on both fixture and ironic with separate e2e configs then it should be flexible enough for other environments also 馃檪

Copy link
Member Author

Choose a reason for hiding this comment

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

added in e2e config, please check

@lentzi90
Copy link
Member

lentzi90 commented Nov 1, 2023

/metal3-bmo-e2e-test

Copy link
Member

@lentzi90 lentzi90 left a comment

Choose a reason for hiding this comment

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

Awesome job!
/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 1, 2023
@lentzi90
Copy link
Member

lentzi90 commented Nov 1, 2023

/cc @kashifest

Copy link
Member

@kashifest kashifest left a comment

Choose a reason for hiding this comment

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

/approve

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kashifest

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 1, 2023
@lentzi90
Copy link
Member

lentzi90 commented Nov 1, 2023

/test-ubuntu-integration-main
/test-centos-e2e-integration-main

@metal3-io-bot metal3-io-bot merged commit 1e6f455 into metal3-io:main Nov 1, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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.

Add inspection annotation e2e test
5 participants