Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤖 Fix provider tests #1674

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file name above has a typo: _rebot vs reboot. This file here doesn't exist. How did this work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It worked on my branch where I had moment of brilliance and was able to spell reboot .

No wonder it's still failing. You just saved me a couple of hours of troubleshooting lol

Expect(err).ToNot(HaveOccurred())

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