From 71edc49c037be99d6d7c96ea40d0bc7429679618 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Thu, 2 Dec 2021 12:04:08 -0500 Subject: [PATCH] kola/boot-mirror: check bootfs dropins from `rdcore bind-boot` This is similar to the tests added in `ext.config.reboot` as part of https://github.com/coreos/fedora-coreos-config/pull/1316, but for the boot mirroring tests. Specifically, it adds coverage for ESP devices discovery in a RAID1 setup (https://github.com/coreos/coreos-installer/pull/700). --- mantle/kola/tests/misc/boot-mirror.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mantle/kola/tests/misc/boot-mirror.go b/mantle/kola/tests/misc/boot-mirror.go index 83415bcc87..de279d71d5 100644 --- a/mantle/kola/tests/misc/boot-mirror.go +++ b/mantle/kola/tests/misc/boot-mirror.go @@ -14,6 +14,7 @@ package misc import ( + "fmt" "strings" "time" @@ -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 @@ -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) @@ -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)) + } }) }