Skip to content

Commit

Permalink
🤖 Fix provider tests (#1674)
Browse files Browse the repository at this point in the history
  • Loading branch information
Itxaka authored Aug 2, 2023
1 parent 19f3c7a commit 1c87d69
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 1c87d69

Please sign in to comment.