]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional: Split Aspeed ARM tests into separate files
authorCédric Le Goater <clg@redhat.com>
Mon, 9 Feb 2026 06:50:43 +0000 (07:50 +0100)
committerCédric Le Goater <clg@redhat.com>
Thu, 12 Feb 2026 15:06:55 +0000 (16:06 +0100)
Reorganize the monolithic Aspeed functional test files into separate
files based on firmware type (Buildroot vs SDK) and specific test
scenarios. This allows the test suite to run tests in parallel more
effectively and makes it easier to identify and run specific test
scenarios independently.

Link: https://lore.kernel.org/qemu-devel/20260209065044.239378-2-clg@redhat.com
Reviewed-by: Kane Chen <kane_chen@aspeedtech.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
tests/functional/arm/meson.build
tests/functional/arm/test_aspeed_ast1060.py [changed mode: 0644->0755]
tests/functional/arm/test_aspeed_ast2500_buildroot.py [moved from tests/functional/arm/test_aspeed_ast2500.py with 74% similarity]
tests/functional/arm/test_aspeed_ast2500_sdk.py [new file with mode: 0755]
tests/functional/arm/test_aspeed_ast2600_buildroot.py
tests/functional/arm/test_aspeed_ast2600_buildroot_tpm.py [new file with mode: 0755]
tests/functional/arm/test_aspeed_ast2600_sdk.py
tests/functional/arm/test_aspeed_ast2600_sdk_otp.py [new file with mode: 0755]

index 1762a496049dc0952961590c46c91fcadfb060fd..175a83a2acd7e145a807a5c33eac40424770d3a7 100644 (file)
@@ -4,9 +4,12 @@ test_arm_timeouts = {
   'aspeed_palmetto' : 120,
   'aspeed_romulus' : 120,
   'aspeed_witherspoon' : 120,
-  'aspeed_ast2500' : 720,
-  'aspeed_ast2600_buildroot' : 720,
-  'aspeed_ast2600_sdk' : 1200,
+  'aspeed_ast2500_sdk' : 720,
+  'aspeed_ast2500_buildroot' : 480,
+  'aspeed_ast2600_buildroot' : 480,
+  'aspeed_ast2600_buildroot_tpm' : 720,
+  'aspeed_ast2600_sdk' : 720,
+  'aspeed_ast2600_sdk_otp' : 720,
   'aspeed_bletchley' : 480,
   'aspeed_catalina' : 480,
   'aspeed_gb200nvl_bmc' : 480,
@@ -32,9 +35,12 @@ tests_arm_system_thorough = [
   'aspeed_palmetto',
   'aspeed_romulus',
   'aspeed_witherspoon',
-  'aspeed_ast2500',
+  'aspeed_ast2500_sdk',
+  'aspeed_ast2500_buildroot',
   'aspeed_ast2600_buildroot',
+  'aspeed_ast2600_buildroot_tpm',
   'aspeed_ast2600_sdk',
+  'aspeed_ast2600_sdk_otp',
   'aspeed_bletchley',
   'aspeed_catalina',
   'aspeed_gb200nvl_bmc',
old mode 100644 (file)
new mode 100755 (executable)
similarity index 74%
rename from tests/functional/arm/test_aspeed_ast2500.py
rename to tests/functional/arm/test_aspeed_ast2500_buildroot.py
index 5d75e20184d62dcb78b6032bd2f69d6ed9dc8d5c..8196923ee04d5c437c03f8a6b1db9c11049defca 100755 (executable)
@@ -37,20 +37,6 @@ class AST2500Machine(AspeedTest):
 
         self.do_test_arm_aspeed_buildroot_poweroff()
 
-    ASSET_SDK_V1000_AST2500 = Asset(
-        'https://github.com/AspeedTech-BMC/openbmc/releases/download/v10.00/ast2500-default-obmc.tar.gz',
-        '7d71a3f71d5f4d9f3451f59a73bf9baf8fd9f6a24107eb504a3216151a8b2b5b')
-
-    def test_arm_ast2500_evb_sdk(self):
-        self.set_machine('ast2500-evb')
-
-        self.archive_extract(self.ASSET_SDK_V1000_AST2500)
-
-        self.do_test_arm_aspeed_sdk_start(
-            self.scratch_file("ast2500-default", "image-bmc"))
-
-        self.wait_for_console_pattern('ast2500-default login:')
-
 
 if __name__ == '__main__':
     AspeedTest.main()
diff --git a/tests/functional/arm/test_aspeed_ast2500_sdk.py b/tests/functional/arm/test_aspeed_ast2500_sdk.py
new file mode 100755 (executable)
index 0000000..2c9211a
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots the ASPEED machines
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import Asset
+from aspeed import AspeedTest
+
+
+class AST2500Machine(AspeedTest):
+
+    ASSET_SDK_V1000_AST2500 = Asset(
+        'https://github.com/AspeedTech-BMC/openbmc/releases/download/v10.00/ast2500-default-obmc.tar.gz',
+        '7d71a3f71d5f4d9f3451f59a73bf9baf8fd9f6a24107eb504a3216151a8b2b5b')
+
+    def test_arm_ast2500_evb_sdk(self):
+        self.set_machine('ast2500-evb')
+
+        self.archive_extract(self.ASSET_SDK_V1000_AST2500)
+
+        self.do_test_arm_aspeed_sdk_start(
+            self.scratch_file("ast2500-default", "image-bmc"))
+
+        self.wait_for_console_pattern('ast2500-default login:')
+
+
+if __name__ == '__main__':
+    AspeedTest.main()
index 3d130b9fd189a696a61b55ad7be6b7163147a834..cc5ab9796a5e03d830967cf9da0fce4dc2147d01 100755 (executable)
@@ -11,7 +11,7 @@ import subprocess
 
 from aspeed import AspeedTest
 from qemu_test import Asset
-from qemu_test import exec_command_and_wait_for_pattern, skipIfMissingCommands
+from qemu_test import exec_command_and_wait_for_pattern
 
 
 class AST2600Machine(AspeedTest):
@@ -61,45 +61,6 @@ class AST2600Machine(AspeedTest):
              '0000000 ffaa ffff ffff ffff ffff ffff ffff ffff')
         self.do_test_arm_aspeed_buildroot_poweroff()
 
-    ASSET_BR2_202302_AST2600_TPM_FLASH = Asset(
-        ('https://github.com/legoater/qemu-aspeed-boot/raw/master/'
-         'images/ast2600-evb/buildroot-2023.02-tpm/flash.img'),
-        'a46009ae8a5403a0826d607215e731a8c68d27c14c41e55331706b8f9c7bd997')
-
-    def _test_arm_ast2600_evb_buildroot_tpm(self, tpmstate_dir):
-        image_path = self.ASSET_BR2_202302_AST2600_TPM_FLASH.fetch()
-
-        socket = os.path.join(tpmstate_dir, 'swtpm-socket')
-
-        # We must put the TPM state dir in /tmp/, not the build dir,
-        # because some distros use AppArmor to lock down swtpm and
-        # restrict the set of locations it can access files in.
-        subprocess.run(['swtpm', 'socket', '-d', '--tpm2',
-                        '--tpmstate', f'dir={tpmstate_dir}',
-                        '--ctrl', f'type=unixio,path={socket}'],
-                       check=True)
-
-        self.vm.add_args('-chardev', f'socket,id=chrtpm,path={socket}')
-        self.vm.add_args('-tpmdev', 'emulator,id=tpm0,chardev=chrtpm')
-        self.vm.add_args('-device',
-                         'tpm-tis-i2c,tpmdev=tpm0,bus=aspeed.i2c.bus.12,address=0x2e')
-        self.do_test_arm_aspeed_buildroot_start(image_path, '0xf00', 'Aspeed AST2600 EVB')
-
-        exec_command_and_wait_for_pattern(self,
-            'echo tpm_tis_i2c 0x2e > /sys/bus/i2c/devices/i2c-12/new_device',
-            'tpm_tis_i2c 12-002e: 2.0 TPM (device-id 0x1, rev-id 1)')
-        exec_command_and_wait_for_pattern(self,
-            'cat /sys/class/tpm/tpm0/pcr-sha256/0',
-            'B804724EA13F52A9072BA87FE8FDCC497DFC9DF9AA15B9088694639C431688E0')
-
-        self.do_test_arm_aspeed_buildroot_poweroff()
-
-    @skipIfMissingCommands('swtpm')
-    def test_arm_ast2600_evb_buildroot_tpm(self):
-        self.set_machine('ast2600-evb')
-        with tempfile.TemporaryDirectory(prefix="qemu_") as tpmstate_dir:
-            self._test_arm_ast2600_evb_buildroot_tpm(tpmstate_dir)
-
 
 if __name__ == '__main__':
     AspeedTest.main()
diff --git a/tests/functional/arm/test_aspeed_ast2600_buildroot_tpm.py b/tests/functional/arm/test_aspeed_ast2600_buildroot_tpm.py
new file mode 100755 (executable)
index 0000000..7ec996e
--- /dev/null
@@ -0,0 +1,60 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots the ASPEED machines
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+import time
+import tempfile
+import subprocess
+
+from aspeed import AspeedTest
+from qemu_test import Asset
+from qemu_test import exec_command_and_wait_for_pattern, skipIfMissingCommands
+
+
+class AST2600Machine(AspeedTest):
+
+    ASSET_BR2_202302_AST2600_TPM_FLASH = Asset(
+        ('https://github.com/legoater/qemu-aspeed-boot/raw/master/'
+         'images/ast2600-evb/buildroot-2023.02-tpm/flash.img'),
+        'a46009ae8a5403a0826d607215e731a8c68d27c14c41e55331706b8f9c7bd997')
+
+    def _test_arm_ast2600_evb_buildroot_tpm(self, tpmstate_dir):
+        image_path = self.ASSET_BR2_202302_AST2600_TPM_FLASH.fetch()
+
+        socket = os.path.join(tpmstate_dir, 'swtpm-socket')
+
+        # We must put the TPM state dir in /tmp/, not the build dir,
+        # because some distros use AppArmor to lock down swtpm and
+        # restrict the set of locations it can access files in.
+        subprocess.run(['swtpm', 'socket', '-d', '--tpm2',
+                        '--tpmstate', f'dir={tpmstate_dir}',
+                        '--ctrl', f'type=unixio,path={socket}'],
+                       check=True)
+
+        self.vm.add_args('-chardev', f'socket,id=chrtpm,path={socket}')
+        self.vm.add_args('-tpmdev', 'emulator,id=tpm0,chardev=chrtpm')
+        self.vm.add_args('-device',
+                         'tpm-tis-i2c,tpmdev=tpm0,bus=aspeed.i2c.bus.12,address=0x2e')
+        self.do_test_arm_aspeed_buildroot_start(image_path, '0xf00', 'Aspeed AST2600 EVB')
+
+        exec_command_and_wait_for_pattern(self,
+            'echo tpm_tis_i2c 0x2e > /sys/bus/i2c/devices/i2c-12/new_device',
+            'tpm_tis_i2c 12-002e: 2.0 TPM (device-id 0x1, rev-id 1)')
+        exec_command_and_wait_for_pattern(self,
+            'cat /sys/class/tpm/tpm0/pcr-sha256/0',
+            'B804724EA13F52A9072BA87FE8FDCC497DFC9DF9AA15B9088694639C431688E0')
+
+        self.do_test_arm_aspeed_buildroot_poweroff()
+
+    @skipIfMissingCommands('swtpm')
+    def test_arm_ast2600_evb_buildroot_tpm(self):
+        self.set_machine('ast2600-evb')
+        with tempfile.TemporaryDirectory(prefix="qemu_") as tpmstate_dir:
+            self._test_arm_ast2600_evb_buildroot_tpm(tpmstate_dir)
+
+
+if __name__ == '__main__':
+    AspeedTest.main()
index 6236aeb11cd2a828817c567161b4edc866ba37ca..971fa3390d21b4eaf89878b2ed7bd6d8b23a57e5 100755 (executable)
@@ -70,21 +70,6 @@ class AST2600Machine(AspeedTest):
              '/sbin/hwclock -f /dev/rtc1', year)
         self.do_ast2600_pcie_test()
 
-    def test_arm_ast2600_otp_blockdev_device(self):
-        self.vm.set_machine("ast2600-evb")
-
-        image_path = self.archive_extract(self.ASSET_SDK_V1100_AST2600)
-        otp_img = self.generate_otpmem_image()
-
-        self.vm.set_console()
-        self.vm.add_args(
-            "-blockdev", f"driver=file,filename={otp_img},node-name=otp",
-            "-global", "aspeed-otp.drive=otp",
-        )
-        self.do_test_arm_aspeed_sdk_start(
-            self.scratch_file("ast2600-default", "image-bmc"))
-        self.wait_for_console_pattern("ast2600-default login:")
-
 
 if __name__ == '__main__':
     AspeedTest.main()
diff --git a/tests/functional/arm/test_aspeed_ast2600_sdk_otp.py b/tests/functional/arm/test_aspeed_ast2600_sdk_otp.py
new file mode 100755 (executable)
index 0000000..4066532
--- /dev/null
@@ -0,0 +1,34 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots the ASPEED machines
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import Asset
+from aspeed import AspeedTest
+
+
+class AST2600Machine(AspeedTest):
+
+    ASSET_SDK_V1100_AST2600 = Asset(
+        'https://github.com/AspeedTech-BMC/openbmc/releases/download/v11.00/ast2600-default-obmc.tar.gz',
+        '64d8926a7d01b649168be96c986603b5690f06391286c438a3a772c8c7039e93')
+
+    def test_arm_ast2600_otp_blockdev_device(self):
+        self.vm.set_machine("ast2600-evb")
+
+        image_path = self.archive_extract(self.ASSET_SDK_V1100_AST2600)
+        otp_img = self.generate_otpmem_image()
+
+        self.vm.set_console()
+        self.vm.add_args(
+            "-blockdev", f"driver=file,filename={otp_img},node-name=otp",
+            "-global", "aspeed-otp.drive=otp",
+        )
+        self.do_test_arm_aspeed_sdk_start(
+            self.scratch_file("ast2600-default", "image-bmc"))
+        self.wait_for_console_pattern("ast2600-default login:")
+
+
+if __name__ == '__main__':
+    AspeedTest.main()