kola/tests/misc: add kola test to validate the boot-mirror RAID1#1880
Conversation
d86e879 to
0c6243f
Compare
4ddf631 to
abd8e15
Compare
8ba0544 to
728b9ec
Compare
95725b0 to
aba71f8
Compare
| case *unprivqemu.Cluster: | ||
| m, err = pc.NewMachineWithQemuOptions(bootmirror, options) | ||
| default: | ||
| m, err = pc.NewMachine(bootmirror) |
There was a problem hiding this comment.
In the non-unpriv-qemu case, the test won't succeed, since it won't have additional disks. And we correctly restrict the platform list to qemu-unpriv, so we shouldn't ever get here. I think it's probably okay to just do the .(*unprivqemu.Cluster) type assertion and let it panic if we're not a qemu-unpriv cluster.
|
|
||
| // checkIfMountpointIsRaid will check if a given machine has a device of type | ||
| // raid1 mounted at the given mountpoint. If it does not, the test is failed. | ||
| func checkIfMountpointIsRaid(c cluster.TestCluster, m platform.Machine, mountpoint string) { |
There was a problem hiding this comment.
In general, significant movement of code should be done in a separate commit to make the diff easier to read.
There's no technical requirement to move this code to a separate file. Since raid.go and boot-mirror.go are in the same package, they can share private functions. But I'm okay with the move if you prefer.
| cosa_cmd("kola --basic-qemu-scenarios") | ||
| cosa_cmd("kola run --parallel 8") | ||
| cosa_cmd("kola run --qemu-firmware uefi boot-mirror") | ||
| cosa_cmd("kola run --qemu-firmware uefi boot-mirror-luks") |
There was a problem hiding this comment.
You should be able to combine these two lines:
cosa_cmd("kola run --qemu-firmware uefi boot-mirror*")
| register.RegisterTest(®ister.Test{ | ||
| Run: runBootMirrorLUKSTest, | ||
| ClusterSize: 0, | ||
| Name: `boot-mirror-luks`, |
There was a problem hiding this comment.
These names are usually dotted paths in a hierarchy. Let's find an appropriate place in the hierarchy to put these tests.
| Run: runBootMirrorLUKSTest, | ||
| ClusterSize: 0, | ||
| Name: `boot-mirror-luks`, | ||
| Flags: []register.Flag{}, |
There was a problem hiding this comment.
Unnecessary line; can be dropped.
| Name: `boot-mirror-luks`, | ||
| Flags: []register.Flag{}, | ||
| Platforms: []string{"qemu-unpriv"}, | ||
| ExcludeArchitectures: []string{"s390x", "ppc64le", "aarch64"}, // no TPM support for s390x, ppc64le, aarch64 in qemu |
2c6cf16 to
40251f2
Compare
| // aarch64 and ppc64le are added temporarily to avoid test failure | ||
| // until we support specifying FCC directly in kola. | ||
| ExcludeArchitectures: []string{"aarch64", "ppc64le", "s390x"}, // no TPM support for s390x in qemu | ||
| ExcludeFirmwares: []string{"uefi"}, |
There was a problem hiding this comment.
Would be good to leave a comment referencing the reason why it's disabled (and a link to an issue if available).
| rootOutput := c.MustSSH(m, "sudo mdadm --export --detail /dev/md/md-root") | ||
| if !strings.Contains(string(rootOutput), "/dev/vda4") || !strings.Contains(string(rootOutput), "/dev/vdb4") { | ||
| c.Fatalf("root raid device missing; expected devices: %v", string(rootOutput)) | ||
| } | ||
| bootOutput := c.MustSSH(m, "sudo mdadm --export --detail /dev/md/md-boot") | ||
| if !strings.Contains(string(bootOutput), "/dev/vda3") || !strings.Contains(string(bootOutput), "/dev/vdb3") { | ||
| c.Fatalf("root raid device missing; expected devices: %v", string(rootOutput)) | ||
| } |
There was a problem hiding this comment.
Any reason these can't be moved into bootMirrorSanityTest so they're both inside a named run block as well as run on both LUKS & non-LUKS? (Same with below checks but into verifyBootMirrorAfterReboot)
There was a problem hiding this comment.
Any reason these can't be moved into
bootMirrorSanityTestso they're both inside a named run block as well as run on both LUKS & non-LUKS? (Same with below checks but intoverifyBootMirrorAfterReboot)
Actually, both tests are using a different number of devices, so the conditional statement would differ in each case.
coreos.boot-mirror- 3 (removing/dev/sdc(3/4))coreos.boot-mirror.luks- 2 (removing/dev/sdb(3/4))
40251f2 to
430948c
Compare
430948c to
7d1a7cf
Compare
7d1a7cf to
92d2977
Compare
92d2977 to
7d7458e
Compare
7d7458e to
846b3f7
Compare
846b3f7 to
fd159e3
Compare
jlebon
left a comment
There was a problem hiding this comment.
Looks good to me overall. Very nice work on this Sohan!
fd159e3 to
1b88d51
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jlebon, sohankunkerkar The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Not mergeable until this PR gets merged.
This will add a kola test to validate the boot-mirror RAID1 changes in both BIOS and UEFI modes.