Skip to content

Commit

Permalink
🤖 Fix provider tests
Browse files Browse the repository at this point in the history
One test that is no longer valid and in any case should be moved to
acceptance tests and the other that need an extra key in the config to
auto reboot

Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed Aug 2, 2023
1 parent 19f3c7a commit dc3b5d9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
15 changes: 15 additions & 0 deletions tests/assets/config_with_rebot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#cloud-config

install:
reboot: true
grub_options:
extra_cmdline: "rd.immucore.debug"

stages:
initramfs:
- name: "Set user and password"
users:
kairos:
passwd: "kairos"
- name: "Set hostname"
hostname: kairos-{{ trunc 4 .Random }}
9 changes: 5 additions & 4 deletions tests/provider_decentralized_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ var _ = Describe("kairos decentralized k8s test", Label("provider", "provider-de

Expect(out).Should(ContainSubstring("Kairos remote recovery"))

grub, err := vm.Sudo("cat /tmp/mnt/STATE/grub_oem_env")
Expect(err).ToNot(HaveOccurred(), grub)

Expect(grub).Should(ContainSubstring("default_menu_entry=Kairos"))
// No longer used. This is created to override the default entry but now the default entry is kairos already
// TODO: Create a test in acceptance to check for the creation of this file and if it has the correct override entry
//grub, err := vm.Sudo("cat /tmp/mnt/STATE/grub_oem_env")
//Expect(err).ToNot(HaveOccurred(), grub)
//Expect(grub).Should(ContainSubstring("default_menu_entry=Kairos"))

out, err = vm.Sudo("umount /tmp/mnt/STATE")
Expect(err).ToNot(HaveOccurred(), out)
Expand Down
3 changes: 2 additions & 1 deletion tests/provider_install_qrcode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ var _ = Describe("kairos qr code install", Label("provider", "provider-qrcode-in
Expect(err).ToNot(HaveOccurred(), device)

By("registering with a screenshot")
err = register("fatal", fileName, "./assets/config.yaml", strings.TrimSpace(device), true)
// pass a config that auto reboots after install as we cannot know when the machine has finished
err = register("fatal", fileName, "./assets/config_with_reboot.yaml", strings.TrimSpace(device), true)
Expect(err).ToNot(HaveOccurred())

By("waiting until it reboots to installed system")
Expand Down

0 comments on commit dc3b5d9

Please sign in to comment.