From d99e0c9d3fb5622bdda6454853beb04e937d687f Mon Sep 17 00:00:00 2001 From: Dimitris Karakasilis Date: Thu, 23 Nov 2023 10:55:08 +0200 Subject: [PATCH] Revert to the old test logic 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 --- tests/assets/live-overlay.tmpl | 2 +- tests/bundles_test.go | 3 --- tests/tests_suite_test.go | 21 --------------------- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/tests/assets/live-overlay.tmpl b/tests/assets/live-overlay.tmpl index 0820bb2a5..133b778f3 100644 --- a/tests/assets/live-overlay.tmpl +++ b/tests/assets/live-overlay.tmpl @@ -4,7 +4,7 @@ debug: true install: auto: true - reboot: false + reboot: true device: auto grub_options: extra_cmdline: foobarzz diff --git a/tests/bundles_test.go b/tests/bundles_test.go index 9502636da..75ef96cb1 100644 --- a/tests/bundles_test.go +++ b/tests/bundles_test.go @@ -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) }) diff --git a/tests/tests_suite_test.go b/tests/tests_suite_test.go index f06da1faa..ef79d4a04 100644 --- a/tests/tests_suite_test.go +++ b/tests/tests_suite_test.go @@ -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 {