Skip to contentSkip to conversation

tests/functional: Split aspeed tests

PATCH Applied Cédric Le Goater 3 participants 17 messages Dec 6, 2024 – Dec 9, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover tests/functional: Split aspeed tests

Hello,

All functional tests of aspeed machine are run from a single test file. Splitting the tests will improve parallelism and allow us to set different timeouts.

The timeout values were chosen from a (single cpu) run on a raspberry pi4 :

func-arm-arm_aspeed_ast1030 2.52s
func-arm-arm_aspeed_palmetto 50.54s
func-arm-arm_aspeed_romulus 61.81s

  func-arm-arm_aspeed_rainier     127.23s
  func-arm-arm_aspeed_ast2500     378.60s
  func-arm-arm_aspeed_ast2600     559.13s

Thanks,

C.

Cédric Le Goater (7):
tests/functional: Introduce a specific test for ast1030 SoC tests/functional: Introduce a specific test for palmetto-bmc machine tests/functional: Introduce a specific test for romulus-bmc machine tests/functional: Introduce a specific test for ast2500 SoC tests/functional: Introduce a specific test for ast2600 SoC tests/functional: Introduce a specific test for rainier-bmc machine tests/functional: Move debian boot test from avocado

 tests/avocado/boot_linux_console.py          |  26 --
 tests/functional/aspeed.py                   |  56 +++
 tests/functional/meson.build                 |  14 +-
 tests/functional/test_arm_aspeed.py          | 351 -------------------
 tests/functional/test_arm_aspeed_ast1030.py  |  81 +++++
 tests/functional/test_arm_aspeed_ast2500.py  |  59 ++++
 tests/functional/test_arm_aspeed_ast2600.py  | 143 ++++++++
 tests/functional/test_arm_aspeed_palmetto.py |  24 ++
 tests/functional/test_arm_aspeed_rainier.py  |  64 ++++
 tests/functional/test_arm_aspeed_romulus.py  |  24 ++
 10 files changed, 463 insertions(+), 379 deletions(-)
 create mode 100644 tests/functional/aspeed.py
 delete mode 100755 tests/functional/test_arm_aspeed.py
 create mode 100644 tests/functional/test_arm_aspeed_ast1030.py
 create mode 100644 tests/functional/test_arm_aspeed_ast2500.py
 create mode 100644 tests/functional/test_arm_aspeed_ast2600.py
 create mode 100644 tests/functional/test_arm_aspeed_palmetto.py
 create mode 100644 tests/functional/test_arm_aspeed_rainier.py
 create mode 100644 tests/functional/test_arm_aspeed_romulus.py
Signature · 1 line
2.47.0
#1 lore raw

PATCH 1/7 tests/functional: Introduce a specific test for ast1030 SoC

This simply moves the ast1030 tests to a new test file. No changes.

---
 tests/functional/meson.build                |  2 +
 tests/functional/test_arm_aspeed.py         | 64 ----------------
 tests/functional/test_arm_aspeed_ast1030.py | 81 +++++++++++++++++++++
 3 files changed, 83 insertions(+), 64 deletions(-)
 create mode 100644 tests/functional/test_arm_aspeed_ast1030.py
tests/functional/meson.build +2 -0
index d6d2c0196c76..ef593d4b9928 100644
@@ -18,6 +18,7 @@ test_timeouts = {
   'aarch64_tuxrun' : 240,
   'aarch64_virt' : 720,
   'acpi_bits' : 420,
+  'arm_aspeed_ast1030' : 10,
   'arm_aspeed' : 600,
   'arm_bpim2u' : 500,
   'arm_collie' : 180,
@@ -66,6 +67,7 @@ tests_alpha_system_thorough = [
 
 tests_arm_system_thorough = [
   'arm_aspeed',
+  'arm_aspeed_ast1030',
   'arm_bpim2u',
   'arm_canona1100',
   'arm_collie',
tests/functional/test_arm_aspeed.py +0 -64

70 lines not on this page · raw message

tests/functional/test_arm_aspeed_ast1030.py new file +81 -0

81 lines not on this page · raw message

Signature · 1 line
2.47.0
Reviewed-by on v1 1/7
#2 lore raw

Re: [PATCH 1/7] tests/functional: Introduce a specific test for ast1030 SoC

Quoted 15 lines · Cédric Le Goater

This simply moves the ast1030 tests to a new test file. No changes.

---
  tests/functional/meson.build                |  2 +
  tests/functional/test_arm_aspeed.py         | 64 ----------------
  tests/functional/test_arm_aspeed_ast1030.py | 81 +++++++++++++++++++++
  3 files changed, 83 insertions(+), 64 deletions(-)

create mode 100644 tests/functional/test_arm_aspeed_ast1030.py

tests/functional/meson.build +0 -0
index d6d2c0196c76..ef593d4b9928 100644

tests/functional/meson.build test_timeouts = { · line 21

Quoted 4 lines
tests/functional/meson.build +1 -0
@@ -18,6 +18,7 @@ test_timeouts = {
    'aarch64_tuxrun' : 240,
    'aarch64_virt' : 720,
    'acpi_bits' : 420,
+  'arm_aspeed_ast1030' : 10,

We've got a default timeout of 90 seconds (see the end of meson.build) ... no need to set a smaller one, so I think you could simply drop this line.

With that line removed:

#3 lore raw

Re: [PATCH 1/7] tests/functional: Introduce a specific test for ast1030 SoC

Quoted 11 lines · Thomas Huth
Quoted 10 lines · Cédric Le Goater

This simply moves the ast1030 tests to a new test file. No changes.

---
  tests/functional/meson.build                |  2 + tests/functional/test_arm_aspeed.py         | 64 ---------------- tests/functional/test_arm_aspeed_ast1030.py | 81 +++++++++++++++++++++

  3 files changed, 83 insertions(+), 64 deletions(-)

  create mode 100644 tests/functional/test_arm_aspeed_ast1030.py

Quoted 11 lines

tests/functional/meson.build test_timeouts = { · line 21

Quoted 9 lines
tests/functional/meson.build +1 -0
index d6d2c0196c76..ef593d4b9928 100644
@@ -18,6 +18,7 @@ test_timeouts = {
     'aarch64_tuxrun' : 240,
     'aarch64_virt' : 720,
     'acpi_bits' : 420,
+  'arm_aspeed_ast1030' : 10,

We've got a default timeout of 90 seconds (see the end of meson.build) ... no need to set a smaller one, so I think you could simply drop this line.

OK. I will drop this change before applying.

Quoted 4 lines

With that line removed:

Thanks,

C.

#4 lore raw

PATCH 2/7 tests/functional: Introduce a specific test for palmetto-bmc machine

In reply to Cédric Le Goater

This introduces a new aspeed module for sharing code between tests and moves the palmetto test to a new test file. No changes in the test.

---
 tests/functional/aspeed.py                   | 23 +++++++++++++++++++
 tests/functional/meson.build                 |  2 ++
 tests/functional/test_arm_aspeed.py          | 10 --------
 tests/functional/test_arm_aspeed_palmetto.py | 24 ++++++++++++++++++++
 4 files changed, 49 insertions(+), 10 deletions(-)
 create mode 100644 tests/functional/aspeed.py
 create mode 100644 tests/functional/test_arm_aspeed_palmetto.py
tests/functional/aspeed.py new file +23 -0
new file mode 100644
index 000000000000..d4dc5320b97a
@@ -0,0 +1,23 @@
+# Test class to boot aspeed machines
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest
+
+class AspeedTest(LinuxKernelTest):
+
+    def do_test_arm_aspeed(self, machine, image):
+        self.set_machine(machine)
+        self.vm.set_console()
+        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
+                         '-net', 'nic', '-snapshot')
+        self.vm.launch()
+
+        self.wait_for_console_pattern("U-Boot 2016.07")
+        self.wait_for_console_pattern("## Loading kernel from FIT Image at 20080000")
+        self.wait_for_console_pattern("Starting kernel ...")
+        self.wait_for_console_pattern("Booting Linux on physical CPU 0x0")
+        self.wait_for_console_pattern(
+                "aspeed-smc 1e620000.spi: read control register: 203b0641")
+        self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ")
+        self.wait_for_console_pattern("systemd[1]: Set hostname to")
tests/functional/meson.build +2 -0
index ef593d4b9928..3cd079f910a8 100644
@@ -19,6 +19,7 @@ test_timeouts = {
   'aarch64_virt' : 720,
   'acpi_bits' : 420,
   'arm_aspeed_ast1030' : 10,
+  'arm_aspeed_palmetto' : 120,
   'arm_aspeed' : 600,
   'arm_bpim2u' : 500,
   'arm_collie' : 180,
@@ -68,6 +69,7 @@ tests_alpha_system_thorough = [
 tests_arm_system_thorough = [
   'arm_aspeed',
   'arm_aspeed_ast1030',
+  'arm_aspeed_palmetto',
   'arm_bpim2u',
   'arm_canona1100',
   'arm_collie',
tests/functional/test_arm_aspeed.py +0 -10
index 9e58fcd84009..48a229608ef6 100755
@@ -37,16 +37,6 @@ def do_test_arm_aspeed(self, machine, image):
         self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ")
         self.wait_for_console_pattern("systemd[1]: Set hostname to")
 
-    ASSET_PALMETTO_FLASH = Asset(
-        ('https://github.com/openbmc/openbmc/releases/download/2.9.0/'
-         'obmc-phosphor-image-palmetto.static.mtd'),
-        '3e13bbbc28e424865dc42f35ad672b10f2e82cdb11846bb28fa625b48beafd0d');
-
-    def test_arm_ast2400_palmetto_openbmc_v2_9_0(self):
-        image_path = self.ASSET_PALMETTO_FLASH.fetch()
-
-        self.do_test_arm_aspeed('palmetto-bmc', image_path)
-
     ASSET_ROMULUS_FLASH = Asset(
         ('https://github.com/openbmc/openbmc/releases/download/2.9.0/'
          'obmc-phosphor-image-romulus.static.mtd'),
tests/functional/test_arm_aspeed_palmetto.py new file +24 -0
new file mode 100644
index 000000000000..6588c02aad79
@@ -0,0 +1,24 @@
+#!/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 PalmettoMachine(AspeedTest):
+
+    ASSET_PALMETTO_FLASH = Asset(
+        ('https://github.com/openbmc/openbmc/releases/download/2.9.0/'
+         'obmc-phosphor-image-palmetto.static.mtd'),
+        '3e13bbbc28e424865dc42f35ad672b10f2e82cdb11846bb28fa625b48beafd0d');
+
+    def test_arm_ast2400_palmetto_openbmc_v2_9_0(self):
+        image_path = self.ASSET_PALMETTO_FLASH.fetch()
+
+        self.do_test_arm_aspeed('palmetto-bmc', image_path)
+
+
+if __name__ == '__main__':
+    AspeedTest.main()
Signature · 1 line
2.47.0
Reviewed-by on v1 2/7
#5 lore raw

Re: [PATCH 2/7] tests/functional: Introduce a specific test for palmetto-bmc machine

Quoted 4 lines · Cédric Le Goater

This introduces a new aspeed module for sharing code between tests and moves the palmetto test to a new test file. No changes in the test.

Quoted 8 lines
---
  tests/functional/aspeed.py                   | 23 +++++++++++++++++++
  tests/functional/meson.build                 |  2 ++
  tests/functional/test_arm_aspeed.py          | 10 --------
  tests/functional/test_arm_aspeed_palmetto.py | 24 ++++++++++++++++++++
  4 files changed, 49 insertions(+), 10 deletions(-)

create mode 100644 tests/functional/aspeed.py
create mode 100644 tests/functional/test_arm_aspeed_palmetto.py

#6 lore raw

PATCH 3/7 tests/functional: Introduce a specific test for romulus-bmc machine

In reply to Cédric Le Goater

This simply moves the romulus-bmc test to a new test file. No changes in the test. The do_test_arm_aspeed routine is removed from the test_arm_aspeed.py file because it is now unused.

---
 tests/functional/meson.build                |  2 ++
 tests/functional/test_arm_aspeed.py         | 26 ---------------------
 tests/functional/test_arm_aspeed_romulus.py | 24 +++++++++++++++++++
 3 files changed, 26 insertions(+), 26 deletions(-)
 create mode 100644 tests/functional/test_arm_aspeed_romulus.py
tests/functional/meson.build +2 -0
index 3cd079f910a8..65eda5a394bc 100644
@@ -20,6 +20,7 @@ test_timeouts = {
   'acpi_bits' : 420,
   'arm_aspeed_ast1030' : 10,
   'arm_aspeed_palmetto' : 120,
+  'arm_aspeed_romulus' : 120,
   'arm_aspeed' : 600,
   'arm_bpim2u' : 500,
   'arm_collie' : 180,
@@ -70,6 +71,7 @@ tests_arm_system_thorough = [
   'arm_aspeed',
   'arm_aspeed_ast1030',
   'arm_aspeed_palmetto',
+  'arm_aspeed_romulus',
   'arm_bpim2u',
   'arm_canona1100',
   'arm_collie',
tests/functional/test_arm_aspeed.py +0 -26
index 48a229608ef6..bdc000a00a32 100755
@@ -21,32 +21,6 @@
 
 class AST2x00Machine(LinuxKernelTest):
 
-    def do_test_arm_aspeed(self, machine, image):
-        self.set_machine(machine)
-        self.vm.set_console()
-        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
-                         '-net', 'nic', '-snapshot')
-        self.vm.launch()
-
-        self.wait_for_console_pattern("U-Boot 2016.07")
-        self.wait_for_console_pattern("## Loading kernel from FIT Image at 20080000")
-        self.wait_for_console_pattern("Starting kernel ...")
-        self.wait_for_console_pattern("Booting Linux on physical CPU 0x0")
-        self.wait_for_console_pattern(
-                "aspeed-smc 1e620000.spi: read control register: 203b0641")
-        self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ")
-        self.wait_for_console_pattern("systemd[1]: Set hostname to")
-
-    ASSET_ROMULUS_FLASH = Asset(
-        ('https://github.com/openbmc/openbmc/releases/download/2.9.0/'
-         'obmc-phosphor-image-romulus.static.mtd'),
-        '820341076803f1955bc31e647a512c79f9add4f5233d0697678bab4604c7bb25')
-
-    def test_arm_ast2500_romulus_openbmc_v2_9_0(self):
-        image_path = self.ASSET_ROMULUS_FLASH.fetch()
-
-        self.do_test_arm_aspeed('romulus-bmc', image_path)
-
     def do_test_arm_aspeed_buildroot_start(self, image, cpu_id, pattern='Aspeed EVB'):
         self.require_netdev('user')
         self.vm.set_console()
tests/functional/test_arm_aspeed_romulus.py new file +24 -0
new file mode 100644
index 000000000000..747b616201ce
@@ -0,0 +1,24 @@
+#!/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 RomulusMachine(AspeedTest):
+
+    ASSET_ROMULUS_FLASH = Asset(
+        ('https://github.com/openbmc/openbmc/releases/download/2.9.0/'
+         'obmc-phosphor-image-romulus.static.mtd'),
+        '820341076803f1955bc31e647a512c79f9add4f5233d0697678bab4604c7bb25')
+
+    def test_arm_ast2500_romulus_openbmc_v2_9_0(self):
+        image_path = self.ASSET_ROMULUS_FLASH.fetch()
+
+        self.do_test_arm_aspeed('romulus-bmc', image_path)
+
+
+if __name__ == '__main__':
+    AspeedTest.main()
Signature · 1 line
2.47.0
Reviewed-by on v1 3/7
#7 lore raw

Re: [PATCH 3/7] tests/functional: Introduce a specific test for romulus-bmc machine

Quoted 11 lines · Cédric Le Goater

This simply moves the romulus-bmc test to a new test file. No changes in the test. The do_test_arm_aspeed routine is removed from the test_arm_aspeed.py file because it is now unused.

---
  tests/functional/meson.build                |  2 ++
  tests/functional/test_arm_aspeed.py         | 26 ---------------------
  tests/functional/test_arm_aspeed_romulus.py | 24 +++++++++++++++++++
  3 files changed, 26 insertions(+), 26 deletions(-)

create mode 100644 tests/functional/test_arm_aspeed_romulus.py

#8 lore raw

PATCH 4/7 tests/functional: Introduce a specific test for ast2500 SoC

In reply to Cédric Le Goater

This moves the ast2500-evb tests to a new test file and extends the aspeed module with routines used to run the buildroot and sdk tests. No changes in the test.

---
 tests/functional/aspeed.py                  | 33 ++++++++++++
 tests/functional/meson.build                |  2 +
 tests/functional/test_arm_aspeed.py         | 44 ---------------
 tests/functional/test_arm_aspeed_ast2500.py | 59 +++++++++++++++++++++
 4 files changed, 94 insertions(+), 44 deletions(-)
 create mode 100644 tests/functional/test_arm_aspeed_ast2500.py
tests/functional/aspeed.py +33 -0
index d4dc5320b97a..62f50bab7a33 100644
@@ -2,6 +2,7 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
+from qemu_test import exec_command_and_wait_for_pattern
 from qemu_test import LinuxKernelTest
 
 class AspeedTest(LinuxKernelTest):
@@ -21,3 +22,35 @@ def do_test_arm_aspeed(self, machine, image):
                 "aspeed-smc 1e620000.spi: read control register: 203b0641")
         self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ")
         self.wait_for_console_pattern("systemd[1]: Set hostname to")
+
+    def do_test_arm_aspeed_buildroot_start(self, image, cpu_id, pattern='Aspeed EVB'):
+        self.require_netdev('user')
+        self.vm.set_console()
+        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw,read-only=true',
+                         '-net', 'nic', '-net', 'user')
+        self.vm.launch()
+
+        self.wait_for_console_pattern('U-Boot 2019.04')
+        self.wait_for_console_pattern('## Loading kernel from FIT Image')
+        self.wait_for_console_pattern('Starting kernel ...')
+        self.wait_for_console_pattern('Booting Linux on physical CPU ' + cpu_id)
+        self.wait_for_console_pattern('lease of 10.0.2.15')
+        # the line before login:
+        self.wait_for_console_pattern(pattern)
+        exec_command_and_wait_for_pattern(self, 'root', 'Password:')
+        exec_command_and_wait_for_pattern(self, 'passw0rd', '#')
+
+    def do_test_arm_aspeed_buildroot_poweroff(self):
+        exec_command_and_wait_for_pattern(self, 'poweroff',
+                                          'reboot: System halted');
+
+    def do_test_arm_aspeed_sdk_start(self, image):
+        self.require_netdev('user')
+        self.vm.set_console()
+        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
+                         '-net', 'nic', '-net', 'user', '-snapshot')
+        self.vm.launch()
+
+        self.wait_for_console_pattern('U-Boot 2019.04')
+        self.wait_for_console_pattern('## Loading kernel from FIT Image')
+        self.wait_for_console_pattern('Starting kernel ...')
tests/functional/meson.build +2 -0
index 65eda5a394bc..6a9c20b30156 100644
@@ -21,6 +21,7 @@ test_timeouts = {
   'arm_aspeed_ast1030' : 10,
   'arm_aspeed_palmetto' : 120,
   'arm_aspeed_romulus' : 120,
+  'arm_aspeed_ast2500' : 480,
   'arm_aspeed' : 600,
   'arm_bpim2u' : 500,
   'arm_collie' : 180,
@@ -72,6 +73,7 @@ tests_arm_system_thorough = [
   'arm_aspeed_ast1030',
   'arm_aspeed_palmetto',
   'arm_aspeed_romulus',
+  'arm_aspeed_ast2500',
   'arm_bpim2u',
   'arm_canona1100',
   'arm_collie',
tests/functional/test_arm_aspeed.py +0 -44

56 lines not on this page · raw message

tests/functional/test_arm_aspeed_ast2500.py new file +59 -0

59 lines not on this page · raw message

Signature · 1 line
2.47.0
Reviewed-by on v1 4/7
#9 lore raw

Re: [PATCH 4/7] tests/functional: Introduce a specific test for ast2500 SoC

Quoted 4 lines · Cédric Le Goater

This moves the ast2500-evb tests to a new test file and extends the aspeed module with routines used to run the buildroot and sdk tests. No changes in the test.

Quoted 8 lines
---
  tests/functional/aspeed.py                  | 33 ++++++++++++
  tests/functional/meson.build                |  2 +
  tests/functional/test_arm_aspeed.py         | 44 ---------------
  tests/functional/test_arm_aspeed_ast2500.py | 59 +++++++++++++++++++++
  4 files changed, 94 insertions(+), 44 deletions(-)

create mode 100644 tests/functional/test_arm_aspeed_ast2500.py

#10 lore raw

PATCH 5/7 tests/functional: Introduce a specific test for ast2600 SoC

In reply to Cédric Le Goater

This moves the ast2600-evb tests to a new test file. No changes in the test. The routines used to run the buildroot and sdk tests are removed from the test_arm_aspeed.py file because now unused.

---
 tests/functional/meson.build                |   2 +
 tests/functional/test_arm_aspeed.py         | 155 --------------------
 tests/functional/test_arm_aspeed_ast2600.py | 143 ++++++++++++++++++
 3 files changed, 145 insertions(+), 155 deletions(-)
 create mode 100644 tests/functional/test_arm_aspeed_ast2600.py
tests/functional/meson.build +2 -0
index 6a9c20b30156..68df574ee72e 100644
@@ -22,6 +22,7 @@ test_timeouts = {
   'arm_aspeed_palmetto' : 120,
   'arm_aspeed_romulus' : 120,
   'arm_aspeed_ast2500' : 480,
+  'arm_aspeed_ast2600' : 720,
   'arm_aspeed' : 600,
   'arm_bpim2u' : 500,
   'arm_collie' : 180,
@@ -74,6 +75,7 @@ tests_arm_system_thorough = [
   'arm_aspeed_palmetto',
   'arm_aspeed_romulus',
   'arm_aspeed_ast2500',
+  'arm_aspeed_ast2600',
   'arm_bpim2u',
   'arm_canona1100',
   'arm_collie',
tests/functional/test_arm_aspeed.py +0 -155

161 lines not on this page · raw message

tests/functional/test_arm_aspeed_ast2600.py new file +143 -0

143 lines not on this page · raw message

Signature · 1 line
2.47.0
Reviewed-by on v1 5/7
#11 lore raw

Re: [PATCH 5/7] tests/functional: Introduce a specific test for ast2600 SoC

Quoted 11 lines · Cédric Le Goater

This moves the ast2600-evb tests to a new test file. No changes in the test. The routines used to run the buildroot and sdk tests are removed from the test_arm_aspeed.py file because now unused.

---
  tests/functional/meson.build                |   2 +
  tests/functional/test_arm_aspeed.py         | 155 --------------------
  tests/functional/test_arm_aspeed_ast2600.py | 143 ++++++++++++++++++
  3 files changed, 145 insertions(+), 155 deletions(-)

create mode 100644 tests/functional/test_arm_aspeed_ast2600.py

#12 lore raw

PATCH 6/7 tests/functional: Introduce a specific test for rainier-bmc machine

In reply to Cédric Le Goater

This simply moves the rainier-bmc test to a new test file. No changes in the test. The test_arm_aspeed.py is deleted.

---
 tests/functional/meson.build                  |  4 ++--
 ...m_aspeed.py => test_arm_aspeed_rainier.py} | 22 +++++--------------
 2 files changed, 7 insertions(+), 19 deletions(-)
 rename tests/functional/{test_arm_aspeed.py => test_arm_aspeed_rainier.py} (71%)
 mode change 100755 => 100644
tests/functional/meson.build +2 -2
index 68df574ee72e..b3775af70be6 100644
@@ -23,7 +23,7 @@ test_timeouts = {
   'arm_aspeed_romulus' : 120,
   'arm_aspeed_ast2500' : 480,
   'arm_aspeed_ast2600' : 720,
-  'arm_aspeed' : 600,
+  'arm_aspeed_rainier' : 240,
   'arm_bpim2u' : 500,
   'arm_collie' : 180,
   'arm_orangepi' : 540,
@@ -70,12 +70,12 @@ tests_alpha_system_thorough = [
 ]
 
 tests_arm_system_thorough = [
-  'arm_aspeed',
   'arm_aspeed_ast1030',
   'arm_aspeed_palmetto',
   'arm_aspeed_romulus',
   'arm_aspeed_ast2500',
   'arm_aspeed_ast2600',
+  'arm_aspeed_rainier',
   'arm_bpim2u',
   'arm_canona1100',
   'arm_collie',
tests/functional/test_arm_aspeed_rainier.py renamed from tests/functional/test_arm_aspeed.py +5 -17
old mode 100755
new mode 100644
similarity index 71%
rename from tests/functional/test_arm_aspeed.py
rename to tests/functional/test_arm_aspeed_rainier.py
index 8cf86795af3c..a60274926d6f
@@ -1,25 +1,13 @@
 #!/usr/bin/env python3
 #
-# Functional test that boots the ASPEED SoCs with firmware
-#
-# Copyright (C) 2022 ASPEED Technology Inc
+# Functional test that boots the ASPEED machines
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-import os
-import time
-import subprocess
-import tempfile
-
-from qemu_test import LinuxKernelTest, Asset
-from qemu_test import exec_command_and_wait_for_pattern
-from qemu_test import interrupt_interactive_console_until_pattern
-from qemu_test import has_cmd
-from qemu_test.utils import archive_extract
-from zipfile import ZipFile
-from unittest import skipUnless
+from qemu_test import Asset
+from aspeed import AspeedTest
 
-class AST2x00MachineMMC(LinuxKernelTest):
+class RainierMachine(AspeedTest):
 
     ASSET_RAINIER_EMMC = Asset(
         ('https://fileserver.linaro.org/s/B6pJTwWEkzSDi36/download/'
@@ -49,4 +37,4 @@ def test_arm_aspeed_emmc_boot(self):
         self.wait_for_console_pattern('IBM eBMC (OpenBMC for IBM Enterprise')
 
 if __name__ == '__main__':
-    LinuxKernelTest.main()
+    AspeedTest.main()
Signature · 1 line
2.47.0
Reviewed-by on v1 6/7
#13 lore raw

Re: [PATCH 6/7] tests/functional: Introduce a specific test for rainier-bmc machine

Quoted 10 lines · Cédric Le Goater

This simply moves the rainier-bmc test to a new test file. No changes in the test. The test_arm_aspeed.py is deleted.

---
  tests/functional/meson.build                  |  4 ++--
  ...m_aspeed.py => test_arm_aspeed_rainier.py} | 22 +++++--------------
  2 files changed, 7 insertions(+), 19 deletions(-)

rename tests/functional/{test_arm_aspeed.py => test_arm_aspeed_rainier.py} (71%) mode change 100755 => 100644

#14 lore raw

PATCH 7/7 tests/functional: Move debian boot test from avocado

In reply to Cédric Le Goater

This simply moves the debian boot test from the avocado testsuite to the new functional testsuite. No changes in the test.

---
 tests/avocado/boot_linux_console.py         | 26 ---------------------
 tests/functional/test_arm_aspeed_rainier.py | 24 +++++++++++++++++++
 2 files changed, 24 insertions(+), 26 deletions(-)
tests/avocado/boot_linux_console.py +0 -26
index 12e24bb05a75..738dd5a8c4bf 100644
@@ -470,29 +470,3 @@ def test_arm_quanta_gsj_initrd(self):
         self.wait_for_console_pattern('CPU1: thread -1, cpu 1, socket 0')
         self.wait_for_console_pattern(
                 'Give root password for system maintenance')
-
-    def test_arm_ast2600_debian(self):
-        """
-        :avocado: tags=arch:arm
-        :avocado: tags=machine:rainier-bmc
-        """
-        deb_url = ('http://snapshot.debian.org/archive/debian/'
-                   '20220606T211338Z/'
-                   'pool/main/l/linux/'
-                   'linux-image-5.17.0-2-armmp_5.17.6-1%2Bb1_armhf.deb')
-        deb_hash = '8acb2b4439faedc2f3ed4bdb2847ad4f6e0491f73debaeb7f660c8abe4dcdc0e'
-        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash,
-                                    algorithm='sha256')
-        kernel_path = self.extract_from_deb(deb_path, '/boot/vmlinuz-5.17.0-2-armmp')
-        dtb_path = self.extract_from_deb(deb_path,
-                '/usr/lib/linux-image-5.17.0-2-armmp/aspeed-bmc-ibm-rainier.dtb')
-
-        self.vm.set_console()
-        self.vm.add_args('-kernel', kernel_path,
-                         '-dtb', dtb_path,
-                         '-net', 'nic')
-        self.vm.launch()
-        self.wait_for_console_pattern("Booting Linux on physical CPU 0xf00")
-        self.wait_for_console_pattern("SMP: Total of 2 processors activated")
-        self.wait_for_console_pattern("No filesystem could mount root")
-
tests/functional/test_arm_aspeed_rainier.py +24 -0
index a60274926d6f..b856aea6dbd7 100644
@@ -36,5 +36,29 @@ def test_arm_aspeed_emmc_boot(self):
         self.wait_for_console_pattern('mmcblk0: p1 p2 p3 p4 p5 p6 p7')
         self.wait_for_console_pattern('IBM eBMC (OpenBMC for IBM Enterprise')
 
+    ASSET_DEBIAN_LINUX_ARMHF_DEB = Asset(
+            ('http://snapshot.debian.org/archive/debian/20220606T211338Z/pool/main/l/linux/linux-image-5.17.0-2-armmp_5.17.6-1%2Bb1_armhf.deb'),
+        '8acb2b4439faedc2f3ed4bdb2847ad4f6e0491f73debaeb7f660c8abe4dcdc0e')
+
+    def test_arm_debian_kernel_boot(self):
+        self.set_machine('rainier-bmc')
+
+        deb_path = self.ASSET_DEBIAN_LINUX_ARMHF_DEB.fetch()
+
+        kernel_path = self.extract_from_deb(deb_path, '/boot/vmlinuz-5.17.0-2-armmp')
+        dtb_path = self.extract_from_deb(deb_path,
+                '/usr/lib/linux-image-5.17.0-2-armmp/aspeed-bmc-ibm-rainier.dtb')
+
+        self.vm.set_console()
+        self.vm.add_args('-kernel', kernel_path,
+                         '-dtb', dtb_path,
+                         '-net', 'nic')
+        self.vm.launch()
+
+        self.wait_for_console_pattern("Booting Linux on physical CPU 0xf00")
+        self.wait_for_console_pattern("SMP: Total of 2 processors activated")
+        self.wait_for_console_pattern("No filesystem could mount root")
+
+
 if __name__ == '__main__':
     AspeedTest.main()
Signature · 1 line
2.47.0
#16 lore raw
In reply to Cédric Le Goater
Quoted 39 lines · Cédric Le Goater

Hello,

All functional tests of aspeed machine are run from a single test file. Splitting the tests will improve parallelism and allow us to set different timeouts.

The timeout values were chosen from a (single cpu) run on a raspberry pi4 :

   func-arm-arm_aspeed_ast1030       2.52s
   func-arm-arm_aspeed_palmetto     50.54s
   func-arm-arm_aspeed_romulus      61.81s
   func-arm-arm_aspeed_rainier     127.23s
   func-arm-arm_aspeed_ast2500     378.60s
   func-arm-arm_aspeed_ast2600     559.13s

Thanks,

C.

Cédric Le Goater (7):
tests/functional: Introduce a specific test for ast1030 SoC tests/functional: Introduce a specific test for palmetto-bmc machine tests/functional: Introduce a specific test for romulus-bmc machine tests/functional: Introduce a specific test for ast2500 SoC tests/functional: Introduce a specific test for ast2600 SoC tests/functional: Introduce a specific test for rainier-bmc machine tests/functional: Move debian boot test from avocado

Quoted 1 line
  tests/avocado/boot_linux_console.py          |  26 --
  tests/functional/aspeed.py                   |  56 +++
  tests/functional/meson.build                 |  14 +-
  tests/functional/test_arm_aspeed.py          | 351 -------------------
  tests/functional/test_arm_aspeed_ast1030.py  |  81 +++++
  tests/functional/test_arm_aspeed_ast2500.py  |  59 ++++
  tests/functional/test_arm_aspeed_ast2600.py  | 143 ++++++++
  tests/functional/test_arm_aspeed_palmetto.py |  24 ++
  tests/functional/test_arm_aspeed_rainier.py  |  64 ++++
  tests/functional/test_arm_aspeed_romulus.py  |  24 ++
  10 files changed, 463 insertions(+), 379 deletions(-)
Quoted 8 lines

create mode 100644 tests/functional/aspeed.py
delete mode 100755 tests/functional/test_arm_aspeed.py create mode 100644 tests/functional/test_arm_aspeed_ast1030.py create mode 100644 tests/functional/test_arm_aspeed_ast2500.py create mode 100644 tests/functional/test_arm_aspeed_ast2600.py create mode 100644 tests/functional/test_arm_aspeed_palmetto.py create mode 100644 tests/functional/test_arm_aspeed_rainier.py create mode 100644 tests/functional/test_arm_aspeed_romulus.py

Applied to aspeed-next.

Thanks,

C.