[kde-linux/os-autoinst-distri-kdelinux] tests/common: tests: adapt bootup and reboot test cases

Bhushan Shah <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 31ed3f0480eeb9eca999b278375255a0b46b0439 by Bhushan Shah.
Committed on 29/07/2026 at 04:51.
Pushed by bshah into branch 'master'.

tests: adapt bootup and reboot test cases

After fixing archival of pflash var flash, we need to adapt test case so
that bootup test case does not keep waiting on the uefi_screen. Also add
possibility to boot into previous image by setting systemd-boot's
oneshot timeout

M  +17   -13   tests/common/bootup.py
M  +6    -0    tests/common/reboot.py

https://invent.kde.org/kde-linux/os-autoinst-distri-kdelinux/-/commit/31ed3f0480eeb9eca999b278375255a0b46b0439

diff --git a/tests/common/bootup.py b/tests/common/bootup.py
index af95a67..73577e1 100644
--- a/tests/common/bootup.py
+++ b/tests/common/bootup.py
@@ -4,6 +4,7 @@
 
 from testapi import *
 from lib import user_manager
+import time
 
 def test_flags(self):
     return {'fatal': 1}
@@ -14,23 +15,26 @@ def run(self):
     # this does nothing
     power('on')
 
-    # Verify that KDE Linux UEFI screen is visible
-    assert_screen('uefi_screen', 'timeout', 30)
-
-    # If we are asked to boot into previous boot by upgrade testcase
-    # press "down", wait for 1 second
-    boot_prev = get_var('BOOT_PREVIOUS', '0')
-    if boot_prev == '1':
-        send_key('down')
-        time.sleep(1)
-
-    # Start the selected image.
-    send_key('ret')
-
     # FDE_INSTALL=1 indicates full-disk-encryption
     encrypted = get_var('FDE_INSTALL', '0')
+    # live mode
     do_install = get_var('DO_INSTALL', '0')
+    # First boot after installation
     first_boot = get_var('FIRST_BOOT', '0')
+    # This selects the previous boot entry
+    boot_prev = get_var('BOOT_PREVIOUS', '0')
+
+    if '1' in (first_boot, do_install, boot_prev):
+        # Verify that KDE Linux UEFI screen is visible
+        assert_screen('uefi_screen', 'timeout', 30)
+
+        # If we are asked to boot into previous boot by upgrade testcase press "down", wait for 1 second
+        if boot_prev == '1':
+            send_key('down')
+            time.sleep(1)
+
+        # Start the selected image.
+        send_key('ret')
 
     if encrypted == '1' and (first_boot == '1' or do_install == '0'):
         # Enter password for the FDE
diff --git a/tests/common/reboot.py b/tests/common/reboot.py
index 015b3ec..97b44a5 100644
--- a/tests/common/reboot.py
+++ b/tests/common/reboot.py
@@ -6,6 +6,12 @@ from lib.openqa.cli_session import session
 from lib import user_manager
 
 def run(self):
+    # Enable timeout on the UEFI screen so we can select previous boot
+    boot_prev = get_var('BOOT_PREVIOUS', '0')
+    if boot_prev == '1':
+        session.run('sudo bootctl set-timeout-oneshot 7', wait_result=False)
+
+    # Reboot
     try:
         session.run('systemctl reboot', wait_result=False)
     except RuntimeError: pass
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.