[kde-linux/os-autoinst-distri-kdelinux] /: tests: collect bunch of important logs

Bhushan Shah <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 9e64382da66cb62c9ae5b3174b20dca2f3265557 by Bhushan Shah, on behalf of Bhushan Shah.
Committed on 25/07/2026 at 13:57.
Pushed by bshah into branch 'master'.

tests: collect bunch of important logs

- calamares session log to debug the installation failures
- collect_logs in all cases and copy the archive at end of run

M  +3    -2    extensions/openqa/usr/lib/kde-linux-openqa/tests/calamares_install.py
M  +3    -0    extensions/openqa/usr/lib/kde-linux-openqa/tests/collect_logs.py
M  +2    -0    main.pm
M  +1    -1    tests/kdelinux-live/calamares_install.py
M  +4    -1    tests/kdelinux/system/collect_logs.py

https://invent.kde.org/kde-linux/os-autoinst-distri-kdelinux/-/commit/9e64382da66cb62c9ae5b3174b20dca2f3265557

diff --git a/extensions/openqa/usr/lib/kde-linux-openqa/tests/calamares_install.py b/extensions/openqa/usr/lib/kde-linux-openqa/tests/calamares_install.py
index d6f3a0a..64f63fb 100755
--- a/extensions/openqa/usr/lib/kde-linux-openqa/tests/calamares_install.py
+++ b/extensions/openqa/usr/lib/kde-linux-openqa/tests/calamares_install.py
@@ -27,9 +27,10 @@ class CalamaresTests(unittest.TestCase):
 
     @classmethod
     def tearDownClass(self):
-        #self.driver.quit()
         # fails because calamares is root? TODO
-        pass
+        # self.driver.quit()
+        # Copy logs so that test can archive that
+        subprocess.run(['sudo', 'cp', '/root/.cache/calamares/session.log', '/tmp/calamares-session.log'], check=True)
 
     def _set_text(self, text, element=None):
         # QML text fields seem to not implement AT-SPI EditableText in QT versions older than 6.11
diff --git a/extensions/openqa/usr/lib/kde-linux-openqa/tests/collect_logs.py b/extensions/openqa/usr/lib/kde-linux-openqa/tests/collect_logs.py
index ae7588f..0ee6be9 100644
--- a/extensions/openqa/usr/lib/kde-linux-openqa/tests/collect_logs.py
+++ b/extensions/openqa/usr/lib/kde-linux-openqa/tests/collect_logs.py
@@ -3,6 +3,7 @@
 
 import glob
 import os
+import shutil
 import subprocess
 import tempfile
 import unittest
@@ -74,6 +75,8 @@ class CollectLogsTests(unittest.TestCase):
             '<user-redacted>', env_contents,
             'collect-logs did not redact the username from env.txt')
 
+        # Move file to path where openQA archives it
+        shutil.move(bundle, '/tmp/kde-linux-collected-logs.tar.zst')
 
 if __name__ == '__main__':
     openqa_junit_xml.run(CollectLogsTests, 'collect_logs')
diff --git a/main.pm b/main.pm
index b47e4fb..064805c 100755
--- a/main.pm
+++ b/main.pm
@@ -38,6 +38,7 @@ sub test_live_image {
     loadtest 'kdelinux/desktop/plasma_welcome.py';
     # loadtest 'common/system_settings/disable_screen_lock.py';
     loadtest 'kdelinux/system_settings/configure_automatic_login.py';
+    loadtest 'kdelinux/system/collect_logs.py';
     loadtest 'common/shutdown.py';
 }
 
@@ -74,6 +75,7 @@ sub test_system_upgrade {
     loadtest 'common/bootup.py';
     loadtest 'common/basic_test.py';
     loadtest 'kdelinux/system/verify_upgrade.py';
+    loadtest 'kdelinux/system/collect_logs.py';
     loadtest 'common/shutdown.py';
 }
 
diff --git a/tests/kdelinux-live/calamares_install.py b/tests/kdelinux-live/calamares_install.py
index c9c7144..6d27a51 100644
--- a/tests/kdelinux-live/calamares_install.py
+++ b/tests/kdelinux-live/calamares_install.py
@@ -14,7 +14,7 @@ def run(self):
     encrypted = get_var('FDE_INSTALL', '0')
     install_mode = '--encrypted' if encrypted == '1' else '--default'
 
-    test = cli_test.CliTest('calamares_install', timeout=300)
+    test = cli_test.CliTest('calamares_install', artifacts=['/tmp/calamares-session.log'], timeout=300)
     test.run_selenium(user=user_manager.live(), args=install_mode)
     # After install is run we set FIRST_BOOT so follow up code
     # knows that this is first boot
diff --git a/tests/kdelinux/system/collect_logs.py b/tests/kdelinux/system/collect_logs.py
index 857d827..827d408 100644
--- a/tests/kdelinux/system/collect_logs.py
+++ b/tests/kdelinux/system/collect_logs.py
@@ -4,6 +4,9 @@ from testapi import *
 from lib.openqa import cli_test
 from lib import user_manager
 
+def test_flags(self):
+    return {'always_run': 1}
+
 def run(self):
-    test = cli_test.CliTest('collect_logs', timeout=400)
+    test = cli_test.CliTest('collect_logs', artifacts=['/tmp/kde-linux-collected-logs.tar.zst'], timeout=400)
     test.run_selenium(user=user_manager.installed())
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.