Skip to contentSkip to conversation

tests/functional: Add a ppc64 mac99 test

PATCH In review Cédric Le Goater 3 participants 4 messages Jan 28, 2025 – Jan 30, 2025 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests/functional: Add a ppc64 mac99 test

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---

Changes in v2:

- Moved self.set_machine('mac99') at the top
- Dropped sungem nic on the command line

 MAINTAINERS                          |  1 +
 tests/functional/meson.build         |  2 ++
 tests/functional/test_ppc64_mac99.py | 43 ++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100755 tests/functional/test_ppc64_mac99.py
MAINTAINERS +1 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h
 F: include/hw/input/adb*
 F: pc-bios/qemu_vga.ndrv
 F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py
 
 Old World (g3beige)
 M: Mark Cave-Ayland <[email protected]>
tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
   'ppc64_powernv' : 480,
   'ppc64_pseries' : 480,
   'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
   'riscv64_tuxrun' : 120,
   's390x_ccw_virtio' : 420,
   'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
   'ppc64_powernv',
   'ppc64_pseries',
   'ppc64_tuxrun',
+  'ppc64_mac99',
 ]
 
 tests_riscv32_system_quick = [
tests/functional/test_ppc64_mac99.py new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
2.48.1
#1 lore raw
Quoted 84 lines · Cédric Le Goater

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---

Changes in v2:

- Moved self.set_machine('mac99') at the top
- Dropped sungem nic on the command line

MAINTAINERS                          |  1 +
tests/functional/meson.build         |  2 ++
tests/functional/test_ppc64_mac99.py | 43 ++++++++++++++++++++++++++++
3 files changed, 46 insertions(+)

create mode 100755 tests/functional/test_ppc64_mac99.py

MAINTAINERS +0 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h

F: include/hw/input/adb*
F: pc-bios/qemu_vga.ndrv
F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py

Old World (g3beige)
M: Mark Cave-Ayland <[email protected]>

tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
  'ppc64_powernv' : 480,
  'ppc64_pseries' : 480,
  'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
  'riscv64_tuxrun' : 120,
  's390x_ccw_virtio' : 420,
  'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
  'ppc64_powernv',
  'ppc64_pseries',
  'ppc64_tuxrun',
+  'ppc64_mac99',

]

tests_riscv32_system_quick = [

tests/functional/test_ppc64_mac99.py new file +21 -0
new file mode 100755
index 000000000000..9aec7c020748
@@ -0,0 +1,43 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a mac99 machine with a PPC970 CPU
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import exec_command_and_wait_for_pattern
+
+class mac99Test(LinuxKernelTest):
+
+    ASSET_BR2_MAC99_LINUX = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux',
+        'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff')
+
+    ASSET_BR2_MAC99_ROOTFS = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main//buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2',
+        'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4')
+
+    def test_ppc64_mac99_buildroot(self):
+        self.set_machine('mac99')

tests/functional/test_ppc64_mac99.py line 31

Quoted 10 lines
tests/functional/test_ppc64_mac99.py new file +10 -0
+
+        linux_path = self.ASSET_BR2_MAC99_LINUX.fetch()
+        rootfs_path = self.ASSET_BR2_MAC99_ROOTFS.fetch()
+
+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw',
+                         '-snapshot', '-nographic') # -nographic to get a console

Nit: # -nographic for serial console or get a console on serial

Regards,
BALATON Zoltan

Quoted 13 lines
tests/functional/test_ppc64_mac99.py new file +12 -0
+        self.vm.launch()
+
+        self.wait_for_console_pattern('>> OpenBIOS')
+        self.wait_for_console_pattern('Linux version')
+        self.wait_for_console_pattern('/init as init process')
+        self.wait_for_console_pattern('gem 0000:f0:0e.0 eth0: Link is up at 100 Mbps')
+        self.wait_for_console_pattern('buildroot login:')
+        exec_command_and_wait_for_pattern(self, 'root', '#')
+        exec_command_and_wait_for_pattern(self, 'poweroff', 'Power down')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
#2 lore raw
Quoted 92 lines · BALATON Zoltan
Quoted 91 lines · Cédric Le Goater

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---

Changes in v2:

- Moved self.set_machine('mac99') at the top
- Dropped sungem nic on the command line

MAINTAINERS                          |  1 + tests/functional/meson.build         |  2 ++ tests/functional/test_ppc64_mac99.py | 43 ++++++++++++++++++++++++++++

3 files changed, 46 insertions(+)

create mode 100755 tests/functional/test_ppc64_mac99.py

MAINTAINERS +0 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h

F: include/hw/input/adb*
F: pc-bios/qemu_vga.ndrv
F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py

Old World (g3beige)
M: Mark Cave-Ayland <[email protected]>

tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
   'ppc64_powernv' : 480,
   'ppc64_pseries' : 480,
   'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
   'riscv64_tuxrun' : 120,
   's390x_ccw_virtio' : 420,
   'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
   'ppc64_powernv',
   'ppc64_pseries',
   'ppc64_tuxrun',
+  'ppc64_mac99',

]

tests_riscv32_system_quick = [

tests/functional/test_ppc64_mac99.py new file +13 -0
new file mode 100755
index 000000000000..9aec7c020748
@@ -0,0 +1,43 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a mac99 machine with a PPC970 CPU
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import exec_command_and_wait_for_pattern
+
+class mac99Test(LinuxKernelTest):
+
+    ASSET_BR2_MAC99_LINUX = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/ 

buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux', +        'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff') +
+    ASSET_BR2_MAC99_ROOTFS = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main// buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2', +        'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4')

tests/functional/test_ppc64_mac99.py new file +8 -0
+
+    def test_ppc64_mac99_buildroot(self):
+        self.set_machine('mac99')
+
+        linux_path = self.ASSET_BR2_MAC99_LINUX.fetch()
+        rootfs_path = self.ASSET_BR2_MAC99_ROOTFS.fetch()
+
+        self.vm.set_console()
Quoted 8 lines
Quoted 6 lines

+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw', +                         '-snapshot', '-nographic') # -nographic to get a console

Nit: # -nographic for serial console or get a console on serial

Ok, but the line is getting too long ... I'll squash this when picking up the patch (unless there are any objections):

tests/functional/test_ppc64_mac99.py +2 -1
index 9aec7c0207..dfd9c01371 100755
@@ -25,10 +25,11 @@ def test_ppc64_mac99_buildroot(self):
 
         self.vm.set_console()
 
+        # Note: We need '-nographic' to get a serial console
         self.vm.add_args('-kernel', linux_path,
                          '-append', 'root=/dev/sda',
                          '-drive', f'file={rootfs_path},format=raw',
-                         '-snapshot', '-nographic') # -nographic to get a console
+                         '-snapshot', '-nographic')
         self.vm.launch()
 
         self.wait_for_console_pattern('>> OpenBIOS')

Thomas

#3 lore raw
Quoted 120 lines · Thomas Huth
Quoted 89 lines · BALATON Zoltan
Quoted 88 lines · Cédric Le Goater

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---

Changes in v2:

- Moved self.set_machine('mac99') at the top
- Dropped sungem nic on the command line

MAINTAINERS                          |  1 + tests/functional/meson.build         |  2 ++ tests/functional/test_ppc64_mac99.py | 43 ++++++++++++++++++++++++++++

3 files changed, 46 insertions(+)

create mode 100755 tests/functional/test_ppc64_mac99.py

MAINTAINERS +0 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h

F: include/hw/input/adb*
F: pc-bios/qemu_vga.ndrv
F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py

Old World (g3beige)
M: Mark Cave-Ayland <[email protected]>

tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
   'ppc64_powernv' : 480,
   'ppc64_pseries' : 480,
   'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
   'riscv64_tuxrun' : 120,
   's390x_ccw_virtio' : 420,
   'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
   'ppc64_powernv',
   'ppc64_pseries',
   'ppc64_tuxrun',
+  'ppc64_mac99',

]

tests_riscv32_system_quick = [

tests/functional/test_ppc64_mac99.py new file +25 -0
new file mode 100755
index 000000000000..9aec7c020748
@@ -0,0 +1,43 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a mac99 machine with a PPC970 CPU
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import exec_command_and_wait_for_pattern
+
+class mac99Test(LinuxKernelTest):
+
+    ASSET_BR2_MAC99_LINUX = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/ buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux',
+        'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff')
+
+    ASSET_BR2_MAC99_ROOTFS = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main// buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2',
+        'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4')
+
+    def test_ppc64_mac99_buildroot(self):
+        self.set_machine('mac99')
+
+        linux_path = self.ASSET_BR2_MAC99_LINUX.fetch()
+        rootfs_path = self.ASSET_BR2_MAC99_ROOTFS.fetch()
+
Quoted 8 lines

tests/functional/test_ppc64_mac99.py line 31

Quoted 6 lines
tests/functional/test_ppc64_mac99.py new file +6 -0
+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw',
+                         '-snapshot', '-nographic') # -nographic to get a console

Nit: # -nographic for serial console or get a console on serial

Ok, but the line is getting too long ... I'll squash this when picking up the patch (unless there are any objections):

tests/functional/test_ppc64_mac99.py +2 -1
index 9aec7c0207..dfd9c01371 100755
@@ -25,10 +25,11 @@ def test_ppc64_mac99_buildroot(self):
 
          self.vm.set_console()
 
+        # Note: We need '-nographic' to get a serial console
          self.vm.add_args('-kernel', linux_path,
                           '-append', 'root=/dev/sda',
                           '-drive', f'file={rootfs_path},format=raw',
-                         '-snapshot', '-nographic') # -nographic to get a console
+                         '-snapshot', '-nographic')
          self.vm.launch()
 
          self.wait_for_console_pattern('>> OpenBIOS')
Quoted 2 lines

 Thomas

LGTM,

Thanks,

C.