Skip to contentSkip to conversation

tests/functional: Extend PPC 40p test with Linux boot

PATCH Superseded Cédric Le Goater 2 participants 2 messages Jan 29, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/functional: Extend PPC 40p test with Linux boot

Fetch the cdrom image for the IBM 6015 PReP PowerPC machine hosted on the Juneau Linux Users Group site, boot and check Linux version.

---
 tests/functional/test_ppc_40p.py | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
tests/functional/test_ppc_40p.py +19 -1
index 7a74e0cca70b..5ce79aec5e6b 100755
@@ -9,7 +9,7 @@
 
 from qemu_test import QemuSystemTest, Asset
 from qemu_test import wait_for_console_pattern, skipUntrustedTest
-
+from qemu_test import exec_command_and_wait_for_pattern
 
 class IbmPrep40pMachine(QemuSystemTest):
 
@@ -72,5 +72,23 @@ def test_openbios_and_netbsd(self):
         self.vm.launch()
         wait_for_console_pattern(self, 'NetBSD/prep BOOT, Revision 1.9')
 
+    ASSET_40P_SANDALFOOT = Asset(
+        'http://www.juneau-lug.org/zImage.initrd.sandalfoot',
+        '749ab02f576c6dc8f33b9fb022ecb44bf6a35a0472f2ea6a5e9956bc15933901')
+
+    def test_openbios_and_linux(self):
+        self.set_machine('40p')
+        self.require_accelerator("tcg")
+        drive_path = self.ASSET_40P_SANDALFOOT.fetch()
+        self.vm.set_console()
+        self.vm.add_args('-cdrom', drive_path,
+                         '-boot', 'd')
+
+        self.vm.launch()
+        wait_for_console_pattern(self, 'Please press Enter to activate this console.')
+        exec_command_and_wait_for_pattern(self, '\012', '#')
+        exec_command_and_wait_for_pattern(self, 'uname -a', 'Linux ppc 2.4.18')
+        exec_command_and_wait_for_pattern(self, 'poweroff', 'Terminated')
+
 if __name__ == '__main__':
     QemuSystemTest.main()
Signature · 1 line
2.48.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Cédric Le Goater

Fetch the cdrom image for the IBM 6015 PReP PowerPC machine hosted on the Juneau Linux Users Group site, boot and check Linux version.

---
  tests/functional/test_ppc_40p.py | 20 +++++++++++++++++++-
  1 file changed, 19 insertions(+), 1 deletion(-)
tests/functional/test_ppc_40p.py +0 -0
index 7a74e0cca70b..5ce79aec5e6b 100755

tests/functional/test_ppc_40p.py line 13

Quoted 6 lines
tests/functional/test_ppc_40p.py +1 -1
@@ -9,7 +9,7 @@
 
  from qemu_test import QemuSystemTest, Asset
  from qemu_test import wait_for_console_pattern, skipUntrustedTest
-
+from qemu_test import exec_command_and_wait_for_pattern
 

Please keep 2 empty lines between the imports and the class statements (Daniel recently tried to standardize on this coding style)

Quoted 16 lines
tests/functional/test_ppc_40p.py +10 -0
  class IbmPrep40pMachine(QemuSystemTest):
 
@@ -72,5 +72,23 @@ def test_openbios_and_netbsd(self):
          self.vm.launch()
          wait_for_console_pattern(self, 'NetBSD/prep BOOT, Revision 1.9')
 
+    ASSET_40P_SANDALFOOT = Asset(
+        'http://www.juneau-lug.org/zImage.initrd.sandalfoot',
+        '749ab02f576c6dc8f33b9fb022ecb44bf6a35a0472f2ea6a5e9956bc15933901')
+
+    def test_openbios_and_linux(self):
+        self.set_machine('40p')
+        self.require_accelerator("tcg")
+        drive_path = self.ASSET_40P_SANDALFOOT.fetch()
+        self.vm.set_console()
+        self.vm.add_args('-cdrom', drive_path,

tests/functional/test_ppc_40p.py def test_openbios_and_netbsd(self): · line 94

Quoted 10 lines
tests/functional/test_ppc_40p.py +8 -0
+                         '-boot', 'd')
+
+        self.vm.launch()
+        wait_for_console_pattern(self, 'Please press Enter to activate this console.')
+        exec_command_and_wait_for_pattern(self, '\012', '#')
+        exec_command_and_wait_for_pattern(self, 'uname -a', 'Linux ppc 2.4.18')
+        exec_command_and_wait_for_pattern(self, 'poweroff', 'Terminated')
+
  if __name__ == '__main__':
      QemuSystemTest.main()

With the nit fixed: