Skip to content

Commit

Permalink
Revert to the old test logic
Browse files Browse the repository at this point in the history
which, in case of errors, will fail with a timeout but kairos service
doesn't allow us to know when the installer is done. That's because
the service has `RemainAfterExit=yes` and even if that was removed, the
kairos process waits for user input to finish:

```
Installation completed, press enter to go back to the shell. [Yes/no/all/cancel]
```

so there is not sure way to tell whether the kairos installer failed
with or without errors.

Signed-off-by: Dimitris Karakasilis <[email protected]>
  • Loading branch information
jimmykarily committed Nov 23, 2023
1 parent 89cbe17 commit d99e0c9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
2 changes: 1 addition & 1 deletion tests/assets/live-overlay.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ debug: true

install:
auto: true
reboot: false
reboot: true
device: auto
grub_options:
extra_cmdline: foobarzz
Expand Down
3 changes: 0 additions & 3 deletions tests/bundles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ var _ = Describe("kairos bundles test", Label("bundles-test"), func() {
BeforeEach(func() {
expectDefaultService(vm)
expectStartedInstallation(vm)
expectInstallationFinished(vm)
expectInstallationNotFailed(vm)
vm.Sudo("reboot")
expectRebootedToActive(vm)
})

Expand Down
21 changes: 0 additions & 21 deletions tests/tests_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,27 +292,6 @@ func expectStartedInstallation(vm VM) {
})
}

func expectInstallationFinished(vm VM) {
By("checking that installation has finished", func() {
Eventually(func() string {
out, _ := vm.Sudo("systemctl status kairos")
return out
}, 30*time.Minute, 1*time.Second).ShouldNot(MatchRegexp("Active: activating"))
})
}

func expectInstallationNotFailed(vm VM) {
By("checking that installation didn't fail", func() {
sysOut, sysErr := vm.Sudo("systemctl status kairos")

journalOut, journalErr := vm.Sudo("journalctl -u kairos")
Expect(journalErr).ToNot(HaveOccurred())

Expect(sysErr).ToNot(HaveOccurred(), journalOut)
Expect(sysOut).ToNot(MatchRegexp("Active: failed"), journalOut)
})
}

func expectRebootedToActive(vm VM) {
By("checking that vm has rebooted to 'active'", func() {
Eventually(func() string {
Expand Down

0 comments on commit d99e0c9

Please sign in to comment.