Skip to content

kola/tests/misc: add kola test to validate the boot-mirror RAID1#1880

Merged
openshift-merge-robot merged 5 commits into
coreos:masterfrom
sohankunkerkar:add-boot-mirror
Mar 1, 2021
Merged

kola/tests/misc: add kola test to validate the boot-mirror RAID1#1880
openshift-merge-robot merged 5 commits into
coreos:masterfrom
sohankunkerkar:add-boot-mirror

Conversation

@sohankunkerkar
Copy link
Copy Markdown
Contributor

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.

@sohankunkerkar sohankunkerkar force-pushed the add-boot-mirror branch 6 times, most recently from d86e879 to 0c6243f Compare November 25, 2020 19:25
@sohankunkerkar sohankunkerkar force-pushed the add-boot-mirror branch 12 times, most recently from 4ddf631 to abd8e15 Compare December 8, 2020 20:49
@sohankunkerkar sohankunkerkar force-pushed the add-boot-mirror branch 5 times, most recently from 8ba0544 to 728b9ec Compare December 10, 2020 16:52
@sohankunkerkar sohankunkerkar force-pushed the add-boot-mirror branch 2 times, most recently from 95725b0 to aba71f8 Compare December 18, 2020 04:47
Comment thread mantle/kola/tests/misc/boot-mirror.go Outdated
case *unprivqemu.Cluster:
m, err = pc.NewMachineWithQemuOptions(bootmirror, options)
default:
m, err = pc.NewMachine(bootmirror)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread .cci.jenkinsfile Outdated
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")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should be able to combine these two lines:

                 cosa_cmd("kola run --qemu-firmware uefi boot-mirror*")

register.RegisterTest(&register.Test{
Run: runBootMirrorLUKSTest,
ClusterSize: 0,
Name: `boot-mirror-luks`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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{},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See #1955.

Comment thread mantle/platform/qemu.go Outdated
Comment thread mantle/platform/qemu.go
Comment thread mantle/kola/tests/misc/boot-mirror.go Outdated
// 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"},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would be good to leave a comment referencing the reason why it's disabled (and a link to an issue if available).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +364 to +396
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))
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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)

Actually, both tests are using a different number of devices, so the conditional statement would differ in each case.

  1. coreos.boot-mirror- 3 (removing /dev/sdc(3/4))
  2. coreos.boot-mirror.luks- 2 (removing /dev/sdb(3/4))

Comment thread mantle/platform/qemu.go Outdated
Comment thread mantle/kola/tests/misc/boot-mirror.go Outdated
Comment thread mantle/kola/tests/misc/boot-mirror.go
Comment thread mantle/kola/tests/misc/boot-mirror.go
Copy link
Copy Markdown
Contributor

@bgilbert bgilbert left a comment

Choose a reason for hiding this comment

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

The test itself looks okay to me. I'll let @arithx or @jlebon handle the final approval.

Comment thread mantle/kola/tests/misc/boot-mirror.go Outdated
Comment thread mantle/kola/tests/util/luks.go Outdated
Comment thread mantle/kola/tests/util/luks.go Outdated
Copy link
Copy Markdown
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Looks good to me overall. Very nice work on this Sohan!

Comment thread mantle/kola/tests/misc/boot-mirror.go Outdated
@jlebon
Copy link
Copy Markdown
Member

jlebon commented Mar 1, 2021

/lgtm

@openshift-ci-robot
Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [jlebon,sohankunkerkar]

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

@openshift-merge-robot openshift-merge-robot merged commit aee1d3e into coreos:master Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants