Skip to content

Commit

Permalink
kola/tests/ignition/oem: Cover more code paths in the initrd
Browse files Browse the repository at this point in the history
The mount unit for the OEM in the initrd gets triggered at different
points when doing a reboot with Ignition, and in the current Flatcar
versions this leads to a failure because Ignition can't mount when
something else already triggered the mount unit.
  • Loading branch information
pothos committed Mar 20, 2023
1 parent aec7e87 commit a244a54
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions kola/tests/ignition/oem.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,25 @@ func init() {
Distros: []string{"cl"},
// This test overwrites the grub.cfg which does not work on cloud environments after reboot
Platforms: []string{"qemu", "qemu-unpriv"},
MinVersion: semver.Version{Major: 2983},
UserData: conf.ContainerLinuxConfig(`storage:
MinVersion: semver.Version{Major: 3550},
UserData: conf.Butane(`---
variant: flatcar
version: 1.0.0
storage:
filesystems:
- name: oem
mount:
device: "/dev/disk/by-label/OEM"
format: "btrfs"
- device: "/dev/disk/by-label/OEM"
format: "btrfs"
path: /usr/share/oem
files:
- path: /grub.cfg
filesystem: oem
- path: /usr/share/oem/grub.cfg
mode: 0644
overwrite: true
contents:
inline: |
set linux_append="flatcar.autologin"`),
set linux_append="flatcar.autologin"
# Needed if --qemu-skip-mangle is not set
set linux_console="console=ttyS0,115200"
`),
})
register.Register(&register.Test{
Name: "cl.ignition.oem.reuse",
Expand All @@ -52,6 +57,7 @@ func init() {
// This test overwrites the grub.cfg which does not work on cloud environments after reboot
Platforms: []string{"qemu", "qemu-unpriv"},
MinVersion: semver.Version{Major: 2983},
// Using CLC format here also covers the ign-converter case
UserData: conf.ContainerLinuxConfig(`storage:
filesystems:
- name: oem
Expand All @@ -75,6 +81,7 @@ func init() {
// different from QEMU.
// More details: https://github.com/flatcar/Flatcar/issues/514.
Platforms: []string{"qemu", "qemu-unpriv"},
// Using CLC format here also covers the ign-converter case
UserData: conf.ContainerLinuxConfig(`storage:
filesystems:
- name: oem
Expand Down Expand Up @@ -106,6 +113,14 @@ func reusePartition(c cluster.TestCluster) {
debug := c.MustSSH(c.Machines()[0], `lsblk --output FSTYPE,LABEL,MOUNTPOINT --json; echo ; lsblk`)
c.Fatalf("should get btrfs, got: %s\ndebug info: %s", string(out), string(debug))
}

// Test for https://github.com/flatcar/Flatcar/issues/979
_ = c.MustSSH(c.Machines()[0], `sudo touch /boot/flatcar/first_boot`)
err := c.Machines()[0].Reboot()
if err != nil {
c.Fatalf("Couldn't reboot machine: %v", err)
}
_ = c.MustSSH(c.Machines()[0], `true`)
}

// wipeOEM asserts that if the config uses a different fs format with a wipe of the fs we effectively wipe the fs.
Expand Down

0 comments on commit a244a54

Please sign in to comment.