diff mbox series

[13/26] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p

Message ID 20191028073441.6448-14-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series tests/acceptance: Queue for 4.2 | expand

Commit Message

Philippe Mathieu-Daudé Oct. 28, 2019, 7:34 a.m. UTC
From: Philippe Mathieu-Daudé <f4bug@amsat.org>

As of this commit, NetBSD 4.0 is very old. However it is enough to
test the PRep/40p machine.

User case from:
http://mail-index.netbsd.org/port-prep/2017/04/11/msg000112.html

Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Installers after 4.0 doesn't work anymore, not sure if this is a
problem from the QEMU model or from NetBSD.

v3:
- use avocado_qemu.wait_for_console_pattern (Cleber)
- check getenv(AVOCADO_ALLOW_UNTRUSTED_CODE) (pm215)
---
 MAINTAINERS                      |  1 +
 tests/acceptance/ppc_prep_40p.py | 50 ++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 tests/acceptance/ppc_prep_40p.py

Comments

Cleber Rosa Oct. 28, 2019, 4:56 p.m. UTC | #1
On Mon, Oct 28, 2019 at 08:34:28AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> As of this commit, NetBSD 4.0 is very old. However it is enough to
> test the PRep/40p machine.
> 
> User case from:
> http://mail-index.netbsd.org/port-prep/2017/04/11/msg000112.html
> 
> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
> Acked-by: David Gibson <david@gibson.dropbear.id.au>
> Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Installers after 4.0 doesn't work anymore, not sure if this is a
> problem from the QEMU model or from NetBSD.
> 
> v3:
> - use avocado_qemu.wait_for_console_pattern (Cleber)
> - check getenv(AVOCADO_ALLOW_UNTRUSTED_CODE) (pm215)
> ---
>  MAINTAINERS                      |  1 +
>  tests/acceptance/ppc_prep_40p.py | 50 ++++++++++++++++++++++++++++++++
>  2 files changed, 51 insertions(+)
>  create mode 100644 tests/acceptance/ppc_prep_40p.py
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 17ff741c63..91746b87f5 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1068,6 +1068,7 @@ F: hw/rtc/m48t59-isa.c
>  F: include/hw/isa/pc87312.h
>  F: include/hw/rtc/m48t59.h
>  F: pc-bios/ppc_rom.bin
> +F: tests/acceptance/machine_ppc_prep_40p.py

File name in patch is ppc_prep_40p.py.

>  
>  sPAPR
>  M: David Gibson <david@gibson.dropbear.id.au>
> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
> new file mode 100644
> index 0000000000..7dd90bb2bb
> --- /dev/null
> +++ b/tests/acceptance/ppc_prep_40p.py
> @@ -0,0 +1,50 @@
> +# Functional test that boots a PReP/40p machine and checks its serial console.
> +#
> +# Copyright (c) Philippe Mathieu-Daudé <f4bug@amsat.org>
> +#
> +# This work is licensed under the terms of the GNU GPL, version 2 or
> +# later. See the COPYING file in the top-level directory.
> +
> +import os
> +import logging
> +

logging module is not used here.

> +from avocado import skipIf
> +from avocado import skipUnless
> +from avocado_qemu import MachineTest
> +from avocado_qemu import wait_for_console_pattern
> +
> +
> +class IbmPrep40pMachine(MachineTest):
> +
> +    timeout = 60
> +
> +    # 12H0455 PPS Firmware Licensed Materials
> +    # Property of IBM (C) Copyright IBM Corp. 1994.
> +    # All rights reserved.
> +    # U.S. Government Users Restricted Rights - Use, duplication or disclosure
> +    # restricted by GSA ADP Schedule Contract with IBM Corp.
> +    @skipIf(os.getenv('CONTINUOUS_INTEGRATION'), 'Running on Travis-CI')
> +    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
> +    def test_factory_firmware_and_netbsd(self):
> +        """
> +        :avocado: tags=arch:ppc
> +        :avocado: tags=machine:40p
> +        :avocado: tags=slowness:high
> +        """
> +        bios_url = ('ftp://ftp.boulder.ibm.com/rs6000/firmware/'
> +                    '7020-40p/P12H0456.IMG')
> +        bios_hash = '1775face4e6dc27f3a6ed955ef6eb331bf817f03'
> +        bios_path = self.fetch_asset(bios_url, asset_hash=bios_hash)
> +        drive_url = ('https://ftp.netbsd.org/pub/NetBSD/NetBSD-archive/'
> +                     'NetBSD-4.0/prep/installation/floppy/generic_com0.fs')
> +        drive_hash = 'dbcfc09912e71bd5f0d82c7c1ee43082fb596ceb'
> +        drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash)
> +
> +        self.vm.set_machine('40p')
> +        self.vm.set_console()
> +        self.vm.add_args('-bios', bios_path,
> +                         '-fda', drive_path)
> +        self.vm.launch()
> +        os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
> +        wait_for_console_pattern(self, os_banner)
> +        wait_for_console_pattern(self, 'Model: IBM PPS Model 6015')
> -- 
> 2.21.0
>

With the import and name changes above:

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>

Queuing on my python-next branch (and sending shortly in a PR).

Thanks,
- Cleber.
diff mbox series

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index 17ff741c63..91746b87f5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1068,6 +1068,7 @@  F: hw/rtc/m48t59-isa.c
 F: include/hw/isa/pc87312.h
 F: include/hw/rtc/m48t59.h
 F: pc-bios/ppc_rom.bin
+F: tests/acceptance/machine_ppc_prep_40p.py
 
 sPAPR
 M: David Gibson <david@gibson.dropbear.id.au>
diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
new file mode 100644
index 0000000000..7dd90bb2bb
--- /dev/null
+++ b/tests/acceptance/ppc_prep_40p.py
@@ -0,0 +1,50 @@ 
+# Functional test that boots a PReP/40p machine and checks its serial console.
+#
+# Copyright (c) Philippe Mathieu-Daudé <f4bug@amsat.org>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later. See the COPYING file in the top-level directory.
+
+import os
+import logging
+
+from avocado import skipIf
+from avocado import skipUnless
+from avocado_qemu import MachineTest
+from avocado_qemu import wait_for_console_pattern
+
+
+class IbmPrep40pMachine(MachineTest):
+
+    timeout = 60
+
+    # 12H0455 PPS Firmware Licensed Materials
+    # Property of IBM (C) Copyright IBM Corp. 1994.
+    # All rights reserved.
+    # U.S. Government Users Restricted Rights - Use, duplication or disclosure
+    # restricted by GSA ADP Schedule Contract with IBM Corp.
+    @skipIf(os.getenv('CONTINUOUS_INTEGRATION'), 'Running on Travis-CI')
+    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
+    def test_factory_firmware_and_netbsd(self):
+        """
+        :avocado: tags=arch:ppc
+        :avocado: tags=machine:40p
+        :avocado: tags=slowness:high
+        """
+        bios_url = ('ftp://ftp.boulder.ibm.com/rs6000/firmware/'
+                    '7020-40p/P12H0456.IMG')
+        bios_hash = '1775face4e6dc27f3a6ed955ef6eb331bf817f03'
+        bios_path = self.fetch_asset(bios_url, asset_hash=bios_hash)
+        drive_url = ('https://ftp.netbsd.org/pub/NetBSD/NetBSD-archive/'
+                     'NetBSD-4.0/prep/installation/floppy/generic_com0.fs')
+        drive_hash = 'dbcfc09912e71bd5f0d82c7c1ee43082fb596ceb'
+        drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash)
+
+        self.vm.set_machine('40p')
+        self.vm.set_console()
+        self.vm.add_args('-bios', bios_path,
+                         '-fda', drive_path)
+        self.vm.launch()
+        os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
+        wait_for_console_pattern(self, os_banner)
+        wait_for_console_pattern(self, 'Model: IBM PPS Model 6015')