Skip to content

Commit

Permalink
kola/boot-mirror: check bootfs dropins from rdcore bind-boot
Browse files Browse the repository at this point in the history
This is similar to the tests added in `ext.config.reboot` as part of
coreos/fedora-coreos-config#1316, but for the
boot mirroring tests.

Specifically, it adds coverage for ESP devices discovery in a RAID1
setup (coreos/coreos-installer#700).
  • Loading branch information
jlebon committed Mar 25, 2022
1 parent 07e5fe1 commit 71edc49
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions mantle/kola/tests/misc/boot-mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package misc

import (
"fmt"
"strings"
"time"

Expand Down Expand Up @@ -117,7 +118,7 @@ func runBootMirrorTest(c cluster.TestCluster) {
if strings.Compare(string(fsTypeForRoot), "xfs") != 0 {
c.Fatalf("didn't match fstype for root")
}
bootMirrorSanityTest(c, m)
bootMirrorSanityTest(c, m, []string{"/dev/vda", "/dev/vdb", "/dev/vdc"})

detachPrimaryBlockDevice(c, m)
// Check if there are two devices with the active raid
Expand Down Expand Up @@ -158,7 +159,7 @@ func runBootMirrorLUKSTest(c cluster.TestCluster) {
if !strings.Contains(string(bootOutput), "/dev/vda3") || !strings.Contains(string(bootOutput), "/dev/vdb3") {
c.Fatalf("boot raid device missing; found devices: %v", string(bootOutput))
}
bootMirrorSanityTest(c, m)
bootMirrorSanityTest(c, m, []string{"/dev/vda", "/dev/vdb"})
luksTPMTest(c, m, true)

detachPrimaryBlockDevice(c, m)
Expand Down Expand Up @@ -186,13 +187,22 @@ func luksTPMTest(c cluster.TestCluster, m platform.Machine, tpm2 bool) {
util.LUKSSanityTest(c, tangd, m, true, false, rootPart)
}

func bootMirrorSanityTest(c cluster.TestCluster, m platform.Machine) {
func bootMirrorSanityTest(c cluster.TestCluster, m platform.Machine, devices []string) {
c.Run("sanity-check", func(c cluster.TestCluster) {
// Check for boot
checkIfMountpointIsRaid(c, m, "/boot")
c.AssertCmdOutputContains(m, "findmnt -nvr /boot -o FSTYPE", "ext4")
// Check that growpart didn't run
c.RunCmdSync(m, "if [ -e /run/coreos-growpart.stamp ]; then exit 1; fi")
// Check for binding dropins
c.RunCmdSync(m, "sudo test -f /boot/.root_uuid")
c.RunCmdSync(m, "sudo test -f /boot/grub2/bootuuid.cfg")
for _, dev := range devices {
c.RunCmdSync(m, fmt.Sprintf(`
sudo mount -o ro %s2 /boot/efi
sudo sh -c 'test -f /boot/efi/EFI/*/bootuuid.cfg'
sudo umount /boot/efi`, dev))
}
})
}

Expand Down

0 comments on commit 71edc49

Please sign in to comment.