-
Notifications
You must be signed in to change notification settings - Fork 254
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
🌱 Add e2e external inspection test #1382
🌱 Add e2e external inspection test #1382
Conversation
test/e2e/external_inspection_test.go
Outdated
metal3api "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1" | ||
) | ||
|
||
const hardwareDetails = `{"cpu":{"arch":"x86_64","count":2,"flags":["3dnowprefetch","abm","adx","aes","apic","arat","arch_capabilities","avx","avx2","avx_vnni","bmi1","bmi2","clflush","clflushopt","clwb","cmov","constant_tsc","cpuid","cpuid_fault","cx16","cx8","de","ept","ept_ad","erms","f16c","flexpriority","fma","fpu","fsgsbase","fsrm","fxsr","gfni","hypervisor","ibpb","ibrs","ibrs_enhanced","invpcid","lahf_lm","lm","mca","mce","md_clear","mmx","movbe","movdir64b","movdiri","msr","mtrr","nopl","nx","ospke","pae","pat","pclmulqdq","pdpe1gb","pge","pku","pni","popcnt","pse","pse36","rdpid","rdrand","rdseed","rdtscp","rep_good","sep","serialize","sha_ni","smap","smep","ss","ssbd","sse","sse2","sse4_1","sse4_2","ssse3","stibp","syscall","tpr_shadow","tsc","tsc_adjust","tsc_deadline_timer","tsc_known_freq","umip","vaes","vme","vmx","vnmi","vpclmulqdq","vpid","waitpkg","x2apic","xgetbv1","xsave","xsavec","xsaveopt","xsaves","xtopology"],"model":"12th Gen Intel(R) Core(TM) i9-12900H"},"firmware":{"bios":{"date":"04/01/2014","vendor":"SeaBIOS","version":"1.15.0-1"}},"hostname":"localhost.localdomain","nics":[{"ip":"192.168.222.122","mac":"00:60:2f:31:81:01","model":"0x1af4 0x0001","name":"enp1s0","pxe":true},{"ip":"fe80::570a:edf2:a3a7:4eb8%enp1s0","mac":"00:60:2f:31:81:01","model":"0x1af4 0x0001","name":"enp1s0","pxe":true}],"ramMebibytes":4096,"storage":[{"alternateNames":["/dev/vda","/dev/disk/by-path/pci-0000:04:00.0"],"name":"/dev/disk/by-path/pci-0000:04:00.0","rotational":true,"sizeBytes":21474836480,"type":"HDD","vendor":"0x1af4"}],"systemVendor":{"manufacturer":"QEMU","productName":"Standard PC (Q35 + ICH9, 2009)"}}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was extracted from a BMH that I created manually, by running:
kubectl get bmh test -o jsonpath="{.status.hardware}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure it could be formatted properly still?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean like this?
const hardwareDetails = `{"cpu":{"arch":"x86_64","count":2,"flags":["3dnowprefetch","abm","adx","aes","apic","arat","arch_capabilities","avx","avx2","avx_vnni","bmi1","bmi2","clflush","clflushopt","clwb","cmov","constant_tsc","cpuid","cpuid_fault","cx16","cx8","de","ept","ept_ad","erms","f16c","flexpriority","fma","fpu","fsgsbase","fsrm","fxsr","gfni","hypervisor","ibpb","ibrs","ibrs_enhanced","invpcid","lahf_lm","lm","mca","mce","md_clear","mmx","movbe","movdir64b","movdiri","msr","mtrr","nopl","nx","ospke","pae","pat","pclmulqdq","pdpe1gb","pge","pku","pni","popcnt","pse","pse36","rdpid","rdrand","rdseed","rdtscp","rep_good","sep","serialize","sha_ni","smap","smep","ss","ssbd","sse","sse2","sse4_1","sse4_2","ssse3","stibp","syscall","tpr_shadow","tsc","tsc_adjust","tsc_deadline_timer","tsc_known_freq","umip","vaes","vme","vmx","vnmi","vpclmulqdq","vpid","waitpkg","x2apic","xgetbv1","xsave","xsavec","xsaveopt","xsaves","xtopology"],"model":"12th Gen Intel(R) Core(TM) i9-12900H"},"firmware":{"bios":{"date":"04/01/2014","vendor":"SeaBIOS","version":"1.15.0-1"}},"hostname":"localhost.localdomain","nics":[{"ip":"192.168.222.122","mac":"00:60:2f:31:81:01","model":"0x1af4 0x0001","name":"enp1s0","pxe":true},{"ip":"fe80::570a:edf2:a3a7:4eb8%enp1s0","mac":"00:60:2f:31:81:01","model":"0x1af4 0x0001","name":"enp1s0","pxe":true}],"ramMebibytes":4096,"storage":[{"alternateNames":["/dev/vda","/dev/disk/by-path/pci-0000:04:00.0"],"name":"/dev/disk/by-path/pci-0000:04:00.0","rotational":true,"sizeBytes":21474836480,"type":"HDD","vendor":"0x1af4"}],"systemVendor":{"manufacturer":"QEMU","productName":"Standard PC (Q35 + ICH9, 2009)"}}` | |
const hardwareDetails = ` | |
{ | |
"cpu": { | |
"arch": "x86_64", | |
"count": 2, | |
"flags": [ | |
"3dnowprefetch", | |
"abm", | |
"adx", | |
"aes", | |
"apic", | |
"arat", | |
"arch_capabilities", | |
"avx", | |
"avx2", | |
"avx_vnni", | |
"bmi1", | |
"bmi2", | |
"clflush", | |
"clflushopt", | |
"clwb", | |
"cmov", | |
"constant_tsc", | |
"cpuid", | |
"cpuid_fault", | |
"cx16", | |
"cx8", | |
"de", | |
"ept", | |
"ept_ad", | |
"erms", | |
"f16c", | |
"flexpriority", | |
"fma", | |
"fpu", | |
"fsgsbase", | |
"fsrm", | |
"fxsr", | |
"gfni", | |
"hypervisor", | |
"ibpb", | |
"ibrs", | |
"ibrs_enhanced", | |
"invpcid", | |
"lahf_lm", | |
"lm", | |
"mca", | |
"mce", | |
"md_clear", | |
"mmx", | |
"movbe", | |
"movdir64b", | |
"movdiri", | |
"msr", | |
"mtrr", | |
"nopl", | |
"nx", | |
"ospke", | |
"pae", | |
"pat", | |
"pclmulqdq", | |
"pdpe1gb", | |
"pge", | |
"pku", | |
"pni", | |
"popcnt", | |
"pse", | |
"pse36", | |
"rdpid", | |
"rdrand", | |
"rdseed", | |
"rdtscp", | |
"rep_good", | |
"sep", | |
"serialize", | |
"sha_ni", | |
"smap", | |
"smep", | |
"ss", | |
"ssbd", | |
"sse", | |
"sse2", | |
"sse4_1", | |
"sse4_2", | |
"ssse3", | |
"stibp", | |
"syscall", | |
"tpr_shadow", | |
"tsc", | |
"tsc_adjust", | |
"tsc_deadline_timer", | |
"tsc_known_freq", | |
"umip", | |
"vaes", | |
"vme", | |
"vmx", | |
"vnmi", | |
"vpclmulqdq", | |
"vpid", | |
"waitpkg", | |
"x2apic", | |
"xgetbv1", | |
"xsave", | |
"xsavec", | |
"xsaveopt", | |
"xsaves", | |
"xtopology" | |
], | |
"model": "12th Gen Intel(R) Core(TM) i9-12900H" | |
}, | |
"firmware": { | |
"bios": { | |
"date": "04/01/2014", | |
"vendor": "SeaBIOS", | |
"version": "1.15.0-1" | |
} | |
}, | |
"hostname": "localhost.localdomain", | |
"nics": [ | |
{ | |
"ip": "192.168.222.122", | |
"mac": "00:60:2f:31:81:01", | |
"model": "0x1af4 0x0001", | |
"name": "enp1s0", | |
"pxe": true | |
}, | |
{ | |
"ip": "fe80::570a:edf2:a3a7:4eb8%enp1s0", | |
"mac": "00:60:2f:31:81:01", | |
"model": "0x1af4 0x0001", | |
"name": "enp1s0", | |
"pxe": true | |
} | |
], | |
"ramMebibytes": 4096, | |
"storage": [ | |
{ | |
"alternateNames": [ | |
"/dev/vda", | |
"/dev/disk/by-path/pci-0000:04:00.0" | |
], | |
"name": "/dev/disk/by-path/pci-0000:04:00.0", | |
"rotational": true, | |
"sizeBytes": 21474836480, | |
"type": "HDD", | |
"vendor": "0x1af4" | |
} | |
], | |
"systemVendor": { | |
"manufacturer": "QEMU", | |
"productName": "Standard PC (Q35 + ICH9, 2009)" | |
} | |
} | |
` |
😬
I'm not really a fan of this but I can accept it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does get really long. Could it be put into separate file so it isn't so invasive? It would also make it easier to update if needed.
edit: I see you changed it already. Its fine as is :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean keep it formatted like it is now, or revert to single line?
I'm now wondering also if we should put it in a separate file 🤔
Perhaps that would be the best
/metal3-bmo-e2e-test |
9ceb8d7
to
f97254f
Compare
@@ -128,3 +129,5 @@ require ( | |||
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.5.0 | |||
|
|||
replace github.com/metal3-io/baremetal-operator => ../ | |||
|
|||
replace github.com/metal3-io/baremetal-operator/apis => ../apis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love input on this. We do the same in the root go.mod
so I think this is the correct way.
At the top of the file we require BMO v0.3.1
. This old version did not have the annotations that I used in the test. By adding this replacement, we simply use the latest BMO API, not a specific release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, correct but IMO we should also keep the go.mod up to date as well with latest release versions so as not to confuse the user. We should perhaps do that in all the go modules.
/metal3-bmo-e2e-test |
Ok we got a timeout for BMH going from |
f97254f
to
9865680
Compare
/metal3-bmo-e2e-test |
Hmm same timeout again... now I suspect there must be something wrong and probably depending on what order the tests are run in. I will investigate. |
Can we view the BMO logs from the CI run? I took a look at the console output but couldn't see the logs in the Jenkins console |
Normally there should be a What I have found so far is that the issue is probably that we do not wait properly for the previous BMH to be deleted before we start on the next test and create a new. This is causing registration errors since there is already a node with conflicting MAC. |
9865680
to
a7d4f27
Compare
/metal3-bmo-e2e-test |
/test-ubuntu-integration-main |
Lost connection to the jenkins worker... |
Following tests are unnrelated to the PR , but for testing the trigger itself, sorry for spamming |
/test-ubuntu-integration-release-0.4 |
/test-ubuntu-integration-release-1-5 |
Artifacts are now properly collected also after test failures 🎉 |
No need to wait, I have got what I wanted. |
a7d4f27
to
2024ae7
Compare
/metal3-bmo-e2e-test |
Successful job! |
Another success: https://jenkins.nordix.org/job/metal3-bmo-e2e-test-pull/12 |
2024ae7
to
a0f7f1b
Compare
/metal3-bmo-e2e-test |
Connection issues with the jenkins worker again... |
/test-centos-e2e-integration-main |
sorry it seems the test was running already, but for some reason my ui view didnt show it. |
/hold cancel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
/cc @kashifest @tuminoid |
test/e2e/external_inspection_test.go
Outdated
metal3api "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1" | ||
) | ||
|
||
const hardwareDetails = `{"cpu":{"arch":"x86_64","count":2,"flags":["3dnowprefetch","abm","adx","aes","apic","arat","arch_capabilities","avx","avx2","avx_vnni","bmi1","bmi2","clflush","clflushopt","clwb","cmov","constant_tsc","cpuid","cpuid_fault","cx16","cx8","de","ept","ept_ad","erms","f16c","flexpriority","fma","fpu","fsgsbase","fsrm","fxsr","gfni","hypervisor","ibpb","ibrs","ibrs_enhanced","invpcid","lahf_lm","lm","mca","mce","md_clear","mmx","movbe","movdir64b","movdiri","msr","mtrr","nopl","nx","ospke","pae","pat","pclmulqdq","pdpe1gb","pge","pku","pni","popcnt","pse","pse36","rdpid","rdrand","rdseed","rdtscp","rep_good","sep","serialize","sha_ni","smap","smep","ss","ssbd","sse","sse2","sse4_1","sse4_2","ssse3","stibp","syscall","tpr_shadow","tsc","tsc_adjust","tsc_deadline_timer","tsc_known_freq","umip","vaes","vme","vmx","vnmi","vpclmulqdq","vpid","waitpkg","x2apic","xgetbv1","xsave","xsavec","xsaveopt","xsaves","xtopology"],"model":"12th Gen Intel(R) Core(TM) i9-12900H"},"firmware":{"bios":{"date":"04/01/2014","vendor":"SeaBIOS","version":"1.15.0-1"}},"hostname":"localhost.localdomain","nics":[{"ip":"192.168.222.122","mac":"00:60:2f:31:81:01","model":"0x1af4 0x0001","name":"enp1s0","pxe":true},{"ip":"fe80::570a:edf2:a3a7:4eb8%enp1s0","mac":"00:60:2f:31:81:01","model":"0x1af4 0x0001","name":"enp1s0","pxe":true}],"ramMebibytes":4096,"storage":[{"alternateNames":["/dev/vda","/dev/disk/by-path/pci-0000:04:00.0"],"name":"/dev/disk/by-path/pci-0000:04:00.0","rotational":true,"sizeBytes":21474836480,"type":"HDD","vendor":"0x1af4"}],"systemVendor":{"manufacturer":"QEMU","productName":"Standard PC (Q35 + ICH9, 2009)"}}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure it could be formatted properly still?
The test simply creates a BMH with annotations for disabling inspection and for adding hardware details. Then it checks that the BMH becomes available without going through inspection. This also adds cert-manager images to the e2e config so that if they happen to be available locally, then they can be loaded into the kind cluster (if used). It helps save some time when running the test repetedly. Minor details: - Don't exit on e2e test failure, gather artifacts/logs first - Destroy the network before trying to undefine it - Wait for namespace deletion between e2e tests since we are using the same VM for the BMHs in multiple tests
a0f7f1b
to
181d95c
Compare
/metal3-bmo-e2e-test |
/test-centos-e2e-integration-main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
@@ -128,3 +129,5 @@ require ( | |||
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.5.0 | |||
|
|||
replace github.com/metal3-io/baremetal-operator => ../ | |||
|
|||
replace github.com/metal3-io/baremetal-operator/apis => ../apis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, correct but IMO we should also keep the go.mod up to date as well with latest release versions so as not to confuse the user. We should perhaps do that in all the go modules.
lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@Rozzii: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this:
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/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kashifest, Rozzii 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thanks again for good work on BMO e2e!
What this PR does / why we need it:
Adds an e2e test for external inspection.
The test simply creates a BMH with annotations for disabling inspection and for adding hardware details. Then it checks that the BMH becomes available without going through inspection.
This also adds cert-manager images to the e2e config so that if they happen to be available locally, then they can be loaded into the kind cluster (if used). It helps save some time when running the test repeatedly.
Minor details:
same VM for the BMHs in multiple tests
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 #1370