qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine
@ 2019-09-15 21:19 Philippe Mathieu-Daudé
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 1/6] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p Philippe Mathieu-Daudé
                   ` (6 more replies)
  0 siblings, 7 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-15 21:19 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	Markus Armbruster, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Hervé Poussineau, Cleber Rosa,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson

Quick tests worth to avoid regressions with the 40p machine.
idea from the "Maintainers, please tell us how to boot your machines"
thread:
https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg04177.html

v2: Split Travis job, added Hervé R-b tag
v1: https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg05896.html

Regards,

Phil.

Philippe Mathieu-Daudé (6):
  tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
  tests/acceptance: Test Open Firmware on the PReP/40p
  tests/acceptance: Test OpenBIOS on the PReP/40p
  tests/acceptance: Test Sandalfoot initrd on the PReP/40p
  .travis.yml: Let the avocado job run the 40p tests
  .travis.yml: Split enterprise vs. hobbyist acceptance test job

 .travis.yml                      |  18 +++-
 MAINTAINERS                      |   1 +
 tests/acceptance/ppc_prep_40p.py | 150 +++++++++++++++++++++++++++++++
 3 files changed, 167 insertions(+), 2 deletions(-)
 create mode 100644 tests/acceptance/ppc_prep_40p.py

-- 
2.20.1



^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Qemu-devel] [PATCH v2 1/6] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
  2019-09-15 21:19 [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine Philippe Mathieu-Daudé
@ 2019-09-15 21:19 ` Philippe Mathieu-Daudé
  2019-09-16  9:44   ` Artyom Tarasenko
  2019-09-16 16:08   ` Cleber Rosa
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-15 21:19 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	Markus Armbruster, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Hervé Poussineau, Cleber Rosa,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson

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>
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.
---
 MAINTAINERS                      |  1 +
 tests/acceptance/ppc_prep_40p.py | 63 ++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)
 create mode 100644 tests/acceptance/ppc_prep_40p.py

diff --git a/MAINTAINERS b/MAINTAINERS
index 50eaf005f4..ce809c7dee 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1068,6 +1068,7 @@ F: hw/timer/m48t59-isa.c
 F: include/hw/isa/pc87312.h
 F: include/hw/timer/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..53f2d2ecf0
--- /dev/null
+++ b/tests/acceptance/ppc_prep_40p.py
@@ -0,0 +1,63 @@
+# 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_qemu import Test
+
+
+class IbmPrep40pMachine(Test):
+
+    timeout = 60
+
+    # TODO refactor to MachineTest
+    def wait_for_console_pattern(self, success_message, failure_message=None):
+        """
+        Waits for messages to appear on the console, while logging the content
+
+        :param success_message: if this message appears, test succeeds
+        :param failure_message: if this message appears, test fails
+        """
+        console = self.vm.console_socket.makefile()
+        console_logger = logging.getLogger('console')
+        while True:
+            msg = console.readline().strip()
+            if not msg:
+                continue
+            console_logger.debug(msg)
+            if success_message in msg:
+                break
+            if failure_message and failure_message in msg:
+                fail = 'Failure message found in console: %s' % failure_message
+                self.fail(fail)
+
+    @skipIf(os.getenv('CONTINUOUS_INTEGRATION'), 'Running on Travis-CI')
+    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'
+        self.wait_for_console_pattern(os_banner)
+        self.wait_for_console_pattern('Model: IBM PPS Model 6015')
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p
  2019-09-15 21:19 [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine Philippe Mathieu-Daudé
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 1/6] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p Philippe Mathieu-Daudé
@ 2019-09-15 21:19 ` Philippe Mathieu-Daudé
  2019-09-16  9:36   ` Artyom Tarasenko
  2019-09-16 17:59   ` Cleber Rosa
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS " Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-15 21:19 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	Markus Armbruster, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Hervé Poussineau, Cleber Rosa,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson

User case from:
https://tyom.blogspot.com/2019/04/aixprep-under-qemu-how-to.html

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/acceptance/ppc_prep_40p.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
index 53f2d2ecf0..a0eac40d9f 100644
--- a/tests/acceptance/ppc_prep_40p.py
+++ b/tests/acceptance/ppc_prep_40p.py
@@ -61,3 +61,24 @@ class IbmPrep40pMachine(Test):
         os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
         self.wait_for_console_pattern(os_banner)
         self.wait_for_console_pattern('Model: IBM PPS Model 6015')
+
+    def test_openfirmware(self):
+        """
+        :avocado: tags=arch:ppc
+        :avocado: tags=machine:40p
+        """
+        bios_url = ('https://github.com/artyom-tarasenko/openfirmware/'
+                    'releases/download/40p-20190413/q40pofw-serial.rom')
+        bios_hash = '880c80172ea5b2247c0ac2a8bf36bbe385192c72'
+        bios_path = self.fetch_asset(bios_url, asset_hash=bios_hash)
+
+        self.vm.set_machine('40p')
+        self.vm.set_console()
+        self.vm.add_args('-bios', bios_path)
+
+        self.vm.launch()
+        self.wait_for_console_pattern('QEMU PReP/40p')
+        fw_banner = 'Open Firmware, built  April 13, 2019 09:29:23'
+        self.wait_for_console_pattern(fw_banner)
+        prompt_msg = 'Type any key to interrupt automatic startup'
+        self.wait_for_console_pattern(prompt_msg)
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS on the PReP/40p
  2019-09-15 21:19 [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine Philippe Mathieu-Daudé
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 1/6] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p Philippe Mathieu-Daudé
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p Philippe Mathieu-Daudé
@ 2019-09-15 21:19 ` Philippe Mathieu-Daudé
  2019-09-16 19:32   ` Cleber Rosa
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 4/6] tests/acceptance: Test Sandalfoot initrd " Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-15 21:19 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	Markus Armbruster, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Hervé Poussineau, Cleber Rosa,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson

User case from:
https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/acceptance/ppc_prep_40p.py | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
index a0eac40d9f..87b5311b89 100644
--- a/tests/acceptance/ppc_prep_40p.py
+++ b/tests/acceptance/ppc_prep_40p.py
@@ -82,3 +82,35 @@ class IbmPrep40pMachine(Test):
         self.wait_for_console_pattern(fw_banner)
         prompt_msg = 'Type any key to interrupt automatic startup'
         self.wait_for_console_pattern(prompt_msg)
+
+    def test_openbios_192m(self):
+        """
+        :avocado: tags=arch:ppc
+        :avocado: tags=machine:40p
+        """
+        self.vm.set_machine('40p')
+        self.vm.set_console()
+        self.vm.add_args('-m', '192')
+
+        self.vm.launch()
+        self.wait_for_console_pattern('>> OpenBIOS')
+        self.wait_for_console_pattern('>> Memory: 192M')
+        self.wait_for_console_pattern('>> CPU type PowerPC,604')
+
+    def test_openbios_and_netbsd(self):
+        """
+        :avocado: tags=arch:ppc
+        :avocado: tags=machine:40p
+        """
+        drive_url = ('https://ftp.netbsd.org/pub/NetBSD/iso/7.1.2/'
+                     'NetBSD-7.1.2-prep.iso')
+        drive_hash = '78734c1bdda79778f0b6f391969ad2458ed8981c'
+        drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash)
+
+        self.vm.set_machine('40p')
+        self.vm.set_console()
+        self.vm.add_args('-cdrom', drive_path,
+                         '-boot', 'd')
+
+        self.vm.launch()
+        self.wait_for_console_pattern('NetBSD/prep BOOT, Revision 1.9')
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [Qemu-devel] [PATCH v2 4/6] tests/acceptance: Test Sandalfoot initrd on the PReP/40p
  2019-09-15 21:19 [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS " Philippe Mathieu-Daudé
@ 2019-09-15 21:19 ` Philippe Mathieu-Daudé
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 5/6] .travis.yml: Let the avocado job run the 40p tests Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-15 21:19 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	Markus Armbruster, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Hervé Poussineau, Cleber Rosa,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson

User case from:
https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html

Sandalfoot info:
http://www.juneau-lug.org/sandalfoot.php

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/acceptance/ppc_prep_40p.py | 34 ++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
index 87b5311b89..b78ad1383b 100644
--- a/tests/acceptance/ppc_prep_40p.py
+++ b/tests/acceptance/ppc_prep_40p.py
@@ -37,6 +37,11 @@ class IbmPrep40pMachine(Test):
                 fail = 'Failure message found in console: %s' % failure_message
                 self.fail(fail)
 
+    def exec_command_and_wait_for_pattern(self, command, success_message):
+        command += '\n'
+        self.vm.console_socket.sendall(command.encode())
+        self.wait_for_console_pattern(success_message)
+
     @skipIf(os.getenv('CONTINUOUS_INTEGRATION'), 'Running on Travis-CI')
     def test_factory_firmware_and_netbsd(self):
         """
@@ -114,3 +119,32 @@ class IbmPrep40pMachine(Test):
 
         self.vm.launch()
         self.wait_for_console_pattern('NetBSD/prep BOOT, Revision 1.9')
+
+    def test_sandalfoot_busybox(self):
+        """
+        :avocado: tags=arch:ppc
+        :avocado: tags=machine:40p
+        """
+        drive_url = ('http://www.juneau-lug.org/zImage.initrd.sandalfoot')
+        drive_hash = 'dacacfc4085ea51d34d99ef70e972b849e2c6949'
+        drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash)
+
+        self.vm.set_machine('40p')
+        self.vm.set_console()
+        self.vm.add_args('-cdrom', drive_path,
+                         '-boot', 'd')
+
+        self.vm.launch()
+        self.wait_for_console_pattern('Now booting the kernel')
+
+        msg = 'Please press Enter to activate this console.'
+        self.wait_for_console_pattern(msg)
+
+        version = 'BusyBox v0.60.0 (2001.08.19-09:26+0000) Built-in shell (ash)'
+        self.exec_command_and_wait_for_pattern('', version)
+
+        uname = 'Linux ppc 2.4.18 #5 Wed May 21 23:50:43 AKDT 2003 ppc unknown'
+        self.exec_command_and_wait_for_pattern('uname -a', uname)
+
+        cpu = 'PReP IBM 6015/7020 (Sandalfoot/Sandalbow)'
+        self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo', cpu)
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [Qemu-devel] [PATCH v2 5/6] .travis.yml: Let the avocado job run the 40p tests
  2019-09-15 21:19 [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 4/6] tests/acceptance: Test Sandalfoot initrd " Philippe Mathieu-Daudé
@ 2019-09-15 21:19 ` Philippe Mathieu-Daudé
  2019-09-16 10:01   ` Alex Bennée
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 6/6] .travis.yml: Split enterprise vs. hobbyist acceptance test job Philippe Mathieu-Daudé
  2019-09-16  0:42 ` [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine David Gibson
  6 siblings, 1 reply; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-15 21:19 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	Markus Armbruster, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Hervé Poussineau, Cleber Rosa,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
If this list continues to grow we can
- split it (as other jobs)
- move them to GitLab where we can have multi-stage jobs,
  avocado tests run on top of build jobs.
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index d0b9e099b9..69a37f7387 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -267,7 +267,7 @@ matrix:
 
     # Acceptance (Functional) tests
     - env:
-        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,ppc64-softmmu,m68k-softmmu"
+        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu"
         - TEST_CMD="make check-acceptance"
       after_failure:
         - cat tests/results/latest/job.log
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [Qemu-devel] [PATCH v2 6/6] .travis.yml: Split enterprise vs. hobbyist acceptance test job
  2019-09-15 21:19 [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 5/6] .travis.yml: Let the avocado job run the 40p tests Philippe Mathieu-Daudé
@ 2019-09-15 21:19 ` Philippe Mathieu-Daudé
  2019-09-16  8:43   ` Alex Bennée
  2019-09-16  0:42 ` [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine David Gibson
  6 siblings, 1 reply; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-15 21:19 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	Markus Armbruster, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Hervé Poussineau, Cleber Rosa,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 .travis.yml | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 69a37f7387..753276eb33 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -265,9 +265,23 @@ matrix:
         - "3.6"
 
 
-    # Acceptance (Functional) tests
+    # Acceptance (Functional) tests [enterprise]
     - env:
-        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu"
+        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips64el-softmmu,aarch64-softmmu,s390x-softmmu,ppc64-softmmu"
+        - TEST_CMD="make check-acceptance"
+      after_failure:
+        - cat tests/results/latest/job.log
+      addons:
+        apt:
+          packages:
+            - python3-pil
+            - python3-pip
+            - python3.5-venv
+
+
+    # Acceptance (Functional) tests [hobbyist]
+    - env:
+        - CONFIG="--python=/usr/bin/python3 --target-list=mips-softmmu,arm-softmmu,alpha-softmmu,ppc-softmmu,m68k-softmmu"
         - TEST_CMD="make check-acceptance"
       after_failure:
         - cat tests/results/latest/job.log
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine
  2019-09-15 21:19 [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 6/6] .travis.yml: Split enterprise vs. hobbyist acceptance test job Philippe Mathieu-Daudé
@ 2019-09-16  0:42 ` David Gibson
  2019-09-16  9:28   ` Philippe Mathieu-Daudé
  6 siblings, 1 reply; 36+ messages in thread
From: David Gibson @ 2019-09-16  0:42 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	qemu-devel, Markus Armbruster, Kamil Rytarowski,
	Hervé Poussineau, Cleber Rosa, qemu-ppc,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko

[-- Attachment #1: Type: text/plain, Size: 1530 bytes --]

On Sun, Sep 15, 2019 at 11:19:34PM +0200, Philippe Mathieu-Daudé wrote:
> Quick tests worth to avoid regressions with the 40p machine.
> idea from the "Maintainers, please tell us how to boot your machines"
> thread:
> https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg04177.html
> 
> v2: Split Travis job, added Hervé R-b tag
> v1: https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg05896.html
> 
> Regards,
> 
> Phil.

I'm guessing you're expecting these to go in via the testing tree, in
which case

Acked-by: David Gibson <david@gibson.dropbear.id.au>

Or do you want me to take them via the ppc tree?

> 
> Philippe Mathieu-Daudé (6):
>   tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
>   tests/acceptance: Test Open Firmware on the PReP/40p
>   tests/acceptance: Test OpenBIOS on the PReP/40p
>   tests/acceptance: Test Sandalfoot initrd on the PReP/40p
>   .travis.yml: Let the avocado job run the 40p tests
>   .travis.yml: Split enterprise vs. hobbyist acceptance test job
> 
>  .travis.yml                      |  18 +++-
>  MAINTAINERS                      |   1 +
>  tests/acceptance/ppc_prep_40p.py | 150 +++++++++++++++++++++++++++++++
>  3 files changed, 167 insertions(+), 2 deletions(-)
>  create mode 100644 tests/acceptance/ppc_prep_40p.py
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 6/6] .travis.yml: Split enterprise vs. hobbyist acceptance test job
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 6/6] .travis.yml: Split enterprise vs. hobbyist acceptance test job Philippe Mathieu-Daudé
@ 2019-09-16  8:43   ` Alex Bennée
  2019-09-16  9:23     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 36+ messages in thread
From: Alex Bennée @ 2019-09-16  8:43 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, qemu-devel,
	Markus Armbruster, Kamil Rytarowski, Hervé Poussineau,
	Cleber Rosa, qemu-ppc, Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson


Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  .travis.yml | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index 69a37f7387..753276eb33 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -265,9 +265,23 @@ matrix:
>          - "3.6"
>
>
> -    # Acceptance (Functional) tests
> +    # Acceptance (Functional) tests [enterprise]
>      - env:
> -        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu"
> +        - CONFIG="--python=/usr/bin/python3
> --target-list=x86_64-softmmu,mips64el-softmmu,aarch64-softmmu,s390x-softmmu,ppc64-softmmu"

You could use:

  --target-list=${MAIN_SOFTMMU_TARGETS}

and

  --disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}

> +        - TEST_CMD="make check-acceptance"
> +      after_failure:
> +        - cat tests/results/latest/job.log
> +      addons:
> +        apt:
> +          packages:
> +            - python3-pil
> +            - python3-pip
> +            - python3.5-venv
> +
> +
> +    # Acceptance (Functional) tests [hobbyist]
> +    - env:
> +        - CONFIG="--python=/usr/bin/python3 --target-list=mips-softmmu,arm-softmmu,alpha-softmmu,ppc-softmmu,m68k-softmmu"
>          - TEST_CMD="make check-acceptance"
>        after_failure:
>          - cat tests/results/latest/job.log


--
Alex Bennée


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 6/6] .travis.yml: Split enterprise vs. hobbyist acceptance test job
  2019-09-16  8:43   ` Alex Bennée
@ 2019-09-16  9:23     ` Philippe Mathieu-Daudé
  2019-09-16  9:46       ` Alex Bennée
  0 siblings, 1 reply; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16  9:23 UTC (permalink / raw)
  To: Alex Bennée, Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, qemu-devel,
	Markus Armbruster, Kamil Rytarowski, Hervé Poussineau,
	Aleksandar Markovic, Cleber Rosa, qemu-ppc, Artyom Tarasenko,
	David Gibson

On 9/16/19 10:43 AM, Alex Bennée wrote:
> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
> 
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  .travis.yml | 18 ++++++++++++++++--
>>  1 file changed, 16 insertions(+), 2 deletions(-)
>>
>> diff --git a/.travis.yml b/.travis.yml
>> index 69a37f7387..753276eb33 100644
>> --- a/.travis.yml
>> +++ b/.travis.yml
>> @@ -265,9 +265,23 @@ matrix:
>>          - "3.6"
>>
>>
>> -    # Acceptance (Functional) tests
>> +    # Acceptance (Functional) tests [enterprise]
>>      - env:
>> -        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu"
>> +        - CONFIG="--python=/usr/bin/python3
>> --target-list=x86_64-softmmu,mips64el-softmmu,aarch64-softmmu,s390x-softmmu,ppc64-softmmu"
> 
> You could use:
> 
>   --target-list=${MAIN_SOFTMMU_TARGETS}
> 
> and
> 
>   --disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}

I like the idea, but this variable is slighly different:

MAIN_SOFTMMU_TARGETS="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"

Are you suggesting we use MAIN_SOFTMMU_TARGETS for 'Enterprise' targets?

As long as mips64-softmmu is present, I think we can remove mips-softmmu
from MAIN_TARGETS. Maybe i386-softmmu can be removed too.

That would give the following hobbyist list:

i386-softmmu,mips-softmmu,alpha-softmmu,ppc-softmmu,m68k-softmmu

(I plan to add hppa-softmmu there too).

>> +        - TEST_CMD="make check-acceptance"
>> +      after_failure:
>> +        - cat tests/results/latest/job.log
>> +      addons:
>> +        apt:
>> +          packages:
>> +            - python3-pil
>> +            - python3-pip
>> +            - python3.5-venv
>> +
>> +
>> +    # Acceptance (Functional) tests [hobbyist]
>> +    - env:
>> +        - CONFIG="--python=/usr/bin/python3 --target-list=mips-softmmu,arm-softmmu,alpha-softmmu,ppc-softmmu,m68k-softmmu"
>>          - TEST_CMD="make check-acceptance"
>>        after_failure:
>>          - cat tests/results/latest/job.log
> 
> 
> --
> Alex Bennée
> 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine
  2019-09-16  0:42 ` [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine David Gibson
@ 2019-09-16  9:28   ` Philippe Mathieu-Daudé
  2019-09-16  9:52     ` Alex Bennée
  2019-09-16 16:14     ` [Qemu-devel] " Eduardo Habkost
  0 siblings, 2 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16  9:28 UTC (permalink / raw)
  To: David Gibson, Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, qemu-devel,
	Markus Armbruster, Kamil Rytarowski, Hervé Poussineau,
	Cleber Rosa, qemu-ppc, Alex Bennée, Artyom Tarasenko

Hi David,

On 9/16/19 2:42 AM, David Gibson wrote:
> On Sun, Sep 15, 2019 at 11:19:34PM +0200, Philippe Mathieu-Daudé wrote:
>> Quick tests worth to avoid regressions with the 40p machine.
>> idea from the "Maintainers, please tell us how to boot your machines"
>> thread:
>> https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg04177.html
>>
>> v2: Split Travis job, added Hervé R-b tag
>> v1: https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg05896.html
>>
>> Regards,
>>
>> Phil.
> 
> I'm guessing you're expecting these to go in via the testing tree, in
> which case
> 
> Acked-by: David Gibson <david@gibson.dropbear.id.au>

Thanks, appreciated :)

> Or do you want me to take them via the ppc tree?

I think the 'testing tree' should focus on the CI/testing
infrastructure, while each subsystem maintainers should care about the
tests covering their subsystem (the testing tree maintainers might not
have the required knowledge to be sure a test is correctly implemented).

In this particular case I assume you don't have much knowledge of that
PPC machine, which is a hobbyist one, but since you are the PPC
maintainer, I'd rather see this going via your tree :)

Alex/Cleber/Eduardo, any comment on this position?

Thanks,

Phil.

>> Philippe Mathieu-Daudé (6):
>>   tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
>>   tests/acceptance: Test Open Firmware on the PReP/40p
>>   tests/acceptance: Test OpenBIOS on the PReP/40p
>>   tests/acceptance: Test Sandalfoot initrd on the PReP/40p
>>   .travis.yml: Let the avocado job run the 40p tests
>>   .travis.yml: Split enterprise vs. hobbyist acceptance test job
>>
>>  .travis.yml                      |  18 +++-
>>  MAINTAINERS                      |   1 +
>>  tests/acceptance/ppc_prep_40p.py | 150 +++++++++++++++++++++++++++++++
>>  3 files changed, 167 insertions(+), 2 deletions(-)
>>  create mode 100644 tests/acceptance/ppc_prep_40p.py
>>
> 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p Philippe Mathieu-Daudé
@ 2019-09-16  9:36   ` Artyom Tarasenko
  2019-09-16 17:59   ` Cleber Rosa
  1 sibling, 0 replies; 36+ messages in thread
From: Artyom Tarasenko @ 2019-09-16  9:36 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	qemu-devel, Markus Armbruster, Kamil Rytarowski,
	Hervé Poussineau, Cleber Rosa, open list:PReP,
	Philippe Mathieu-Daudé,
	David Gibson

On Sun, Sep 15, 2019 at 11:19 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> User case from:
> https://tyom.blogspot.com/2019/04/aixprep-under-qemu-how-to.html
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Thanks a lot for this one, Philippe!
Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>

> ---
>  tests/acceptance/ppc_prep_40p.py | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>
> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
> index 53f2d2ecf0..a0eac40d9f 100644
> --- a/tests/acceptance/ppc_prep_40p.py
> +++ b/tests/acceptance/ppc_prep_40p.py
> @@ -61,3 +61,24 @@ class IbmPrep40pMachine(Test):
>          os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
>          self.wait_for_console_pattern(os_banner)
>          self.wait_for_console_pattern('Model: IBM PPS Model 6015')
> +
> +    def test_openfirmware(self):
> +        """
> +        :avocado: tags=arch:ppc
> +        :avocado: tags=machine:40p
> +        """
> +        bios_url = ('https://github.com/artyom-tarasenko/openfirmware/'
> +                    'releases/download/40p-20190413/q40pofw-serial.rom')
> +        bios_hash = '880c80172ea5b2247c0ac2a8bf36bbe385192c72'
> +        bios_path = self.fetch_asset(bios_url, asset_hash=bios_hash)
> +
> +        self.vm.set_machine('40p')
> +        self.vm.set_console()
> +        self.vm.add_args('-bios', bios_path)
> +
> +        self.vm.launch()
> +        self.wait_for_console_pattern('QEMU PReP/40p')
> +        fw_banner = 'Open Firmware, built  April 13, 2019 09:29:23'
> +        self.wait_for_console_pattern(fw_banner)
> +        prompt_msg = 'Type any key to interrupt automatic startup'
> +        self.wait_for_console_pattern(prompt_msg)
> --
> 2.20.1
>


-- 
Regards,
Artyom Tarasenko

SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 1/6] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 1/6] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p Philippe Mathieu-Daudé
@ 2019-09-16  9:44   ` Artyom Tarasenko
  2019-09-16 16:08   ` Cleber Rosa
  1 sibling, 0 replies; 36+ messages in thread
From: Artyom Tarasenko @ 2019-09-16  9:44 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	qemu-devel, Markus Armbruster, Kamil Rytarowski,
	Hervé Poussineau, Cleber Rosa, open list:PReP,
	Philippe Mathieu-Daudé,
	David Gibson

On Sun, Sep 15, 2019 at 11:19 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> As of this commit, NetBSD 4.0 is very old. However it is enough to
> test the PRep/40p machine.

Not just it's enough, it's also the NetBSD release which definitely
was tested on physical 40p machines.
(It already has reviewed-by maintainer, so I don't suppose you'll need
it, but just in case,
Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
)

>
> User case from:
> http://mail-index.netbsd.org/port-prep/2017/04/11/msg000112.html
>
> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
> 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.
> ---
>  MAINTAINERS                      |  1 +
>  tests/acceptance/ppc_prep_40p.py | 63 ++++++++++++++++++++++++++++++++
>  2 files changed, 64 insertions(+)
>  create mode 100644 tests/acceptance/ppc_prep_40p.py
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 50eaf005f4..ce809c7dee 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1068,6 +1068,7 @@ F: hw/timer/m48t59-isa.c
>  F: include/hw/isa/pc87312.h
>  F: include/hw/timer/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..53f2d2ecf0
> --- /dev/null
> +++ b/tests/acceptance/ppc_prep_40p.py
> @@ -0,0 +1,63 @@
> +# 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_qemu import Test
> +
> +
> +class IbmPrep40pMachine(Test):
> +
> +    timeout = 60
> +
> +    # TODO refactor to MachineTest
> +    def wait_for_console_pattern(self, success_message, failure_message=None):
> +        """
> +        Waits for messages to appear on the console, while logging the content
> +
> +        :param success_message: if this message appears, test succeeds
> +        :param failure_message: if this message appears, test fails
> +        """
> +        console = self.vm.console_socket.makefile()
> +        console_logger = logging.getLogger('console')
> +        while True:
> +            msg = console.readline().strip()
> +            if not msg:
> +                continue
> +            console_logger.debug(msg)
> +            if success_message in msg:
> +                break
> +            if failure_message and failure_message in msg:
> +                fail = 'Failure message found in console: %s' % failure_message
> +                self.fail(fail)
> +
> +    @skipIf(os.getenv('CONTINUOUS_INTEGRATION'), 'Running on Travis-CI')
> +    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'
> +        self.wait_for_console_pattern(os_banner)
> +        self.wait_for_console_pattern('Model: IBM PPS Model 6015')
> --
> 2.20.1
>


-- 
Regards,
Artyom Tarasenko

SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 6/6] .travis.yml: Split enterprise vs. hobbyist acceptance test job
  2019-09-16  9:23     ` Philippe Mathieu-Daudé
@ 2019-09-16  9:46       ` Alex Bennée
  2019-09-16 10:00         ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 36+ messages in thread
From: Alex Bennée @ 2019-09-16  9:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Markus Armbruster,
	Philippe Mathieu-Daudé,
	qemu-devel, Kamil Rytarowski, Hervé Poussineau,
	Aleksandar Markovic, Cleber Rosa, qemu-ppc, Artyom Tarasenko,
	David Gibson


Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> On 9/16/19 10:43 AM, Alex Bennée wrote:
>> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
>>
>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>> ---
>>>  .travis.yml | 18 ++++++++++++++++--
>>>  1 file changed, 16 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/.travis.yml b/.travis.yml
>>> index 69a37f7387..753276eb33 100644
>>> --- a/.travis.yml
>>> +++ b/.travis.yml
>>> @@ -265,9 +265,23 @@ matrix:
>>>          - "3.6"
>>>
>>>
>>> -    # Acceptance (Functional) tests
>>> +    # Acceptance (Functional) tests [enterprise]
>>>      - env:
>>> -        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu"
>>> +        - CONFIG="--python=/usr/bin/python3
>>> --target-list=x86_64-softmmu,mips64el-softmmu,aarch64-softmmu,s390x-softmmu,ppc64-softmmu"
>>
>> You could use:
>>
>>   --target-list=${MAIN_SOFTMMU_TARGETS}
>>
>> and
>>
>>   --disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}
>
> I like the idea, but this variable is slighly different:
>
> MAIN_SOFTMMU_TARGETS="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"
>
> Are you suggesting we use MAIN_SOFTMMU_TARGETS for 'Enterprise'
> targets?

Broadly - I'm note sure how we want to make the distinction in QEMU. We
have targets which are actively maintained and represent current
architectures that people still ship software to run on. The other
targets are machines that are either esoteric designs that exist in
particular niches or of academic interest and the old architecture kept
alive out of a sense of nostalgia.

>
> As long as mips64-softmmu is present, I think we can remove mips-softmmu
> from MAIN_TARGETS. Maybe i386-softmmu can be removed too.

Well the MIPS targets are actively maintained although for 32 bit you
don't see many distros for them these days. There might be an argument
for demoting i386-softmmu as I'm guessing there isn't much 32 bit kvm in
the enterprise right now (although It would be unsurprising to be told
otherwise).

>
> That would give the following hobbyist list:
>
> i386-softmmu,mips-softmmu,alpha-softmmu,ppc-softmmu,m68k-softmmu

I'm not sure about the hobbyist moniker as pretty much any of these TCG
targets is more actively maintained than the x86 which is mostly all
about the HW virtualisation these days. Trouble is I can't think of
another name that doesn't sound condescending:

  HISTORICAL_SOFTMMU_TARGETS
  LEGACY_SOFTMMU_TARGETS
  FASTERTHANNATIVE_SOFTMMU_TARGETS
  ARCHIVISTS_SOFTMMU_TARGETS

? As ever naming things is hard....

>
> (I plan to add hppa-softmmu there too).
>
>>> +        - TEST_CMD="make check-acceptance"
>>> +      after_failure:
>>> +        - cat tests/results/latest/job.log
>>> +      addons:
>>> +        apt:
>>> +          packages:
>>> +            - python3-pil
>>> +            - python3-pip
>>> +            - python3.5-venv
>>> +
>>> +
>>> +    # Acceptance (Functional) tests [hobbyist]
>>> +    - env:
>>> +        - CONFIG="--python=/usr/bin/python3 --target-list=mips-softmmu,arm-softmmu,alpha-softmmu,ppc-softmmu,m68k-softmmu"
>>>          - TEST_CMD="make check-acceptance"
>>>        after_failure:
>>>          - cat tests/results/latest/job.log
>>
>>
>> --
>> Alex Bennée
>>


--
Alex Bennée


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine
  2019-09-16  9:28   ` Philippe Mathieu-Daudé
@ 2019-09-16  9:52     ` Alex Bennée
  2019-09-16  9:56       ` Philippe Mathieu-Daudé
  2019-09-16 16:14     ` [Qemu-devel] " Eduardo Habkost
  1 sibling, 1 reply; 36+ messages in thread
From: Alex Bennée @ 2019-09-16  9:52 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Markus Armbruster,
	qemu-devel, Philippe Mathieu-Daudé,
	Kamil Rytarowski, qemu-ppc, Cleber Rosa, Hervé Poussineau,
	Artyom Tarasenko, David Gibson


Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> Hi David,
>
> On 9/16/19 2:42 AM, David Gibson wrote:
>> On Sun, Sep 15, 2019 at 11:19:34PM +0200, Philippe Mathieu-Daudé wrote:
>>> Quick tests worth to avoid regressions with the 40p machine.
>>> idea from the "Maintainers, please tell us how to boot your machines"
>>> thread:
>>> https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg04177.html
>>>
>>> v2: Split Travis job, added Hervé R-b tag
>>> v1: https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg05896.html
>>>
>>> Regards,
>>>
>>> Phil.
>>
>> I'm guessing you're expecting these to go in via the testing tree, in
>> which case
>>
>> Acked-by: David Gibson <david@gibson.dropbear.id.au>
>
> Thanks, appreciated :)
>
>> Or do you want me to take them via the ppc tree?
>
> I think the 'testing tree' should focus on the CI/testing
> infrastructure, while each subsystem maintainers should care about the
> tests covering their subsystem (the testing tree maintainers might not
> have the required knowledge to be sure a test is correctly implemented).
>
> In this particular case I assume you don't have much knowledge of that
> PPC machine, which is a hobbyist one, but since you are the PPC
> maintainer, I'd rather see this going via your tree :)
>
> Alex/Cleber/Eduardo, any comment on this position?

Once we have a .travis.yml I'm happy with it can go in via another tree
no problem. See other thread....

>
> Thanks,
>
> Phil.
>
>>> Philippe Mathieu-Daudé (6):
>>>   tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
>>>   tests/acceptance: Test Open Firmware on the PReP/40p
>>>   tests/acceptance: Test OpenBIOS on the PReP/40p
>>>   tests/acceptance: Test Sandalfoot initrd on the PReP/40p
>>>   .travis.yml: Let the avocado job run the 40p tests
>>>   .travis.yml: Split enterprise vs. hobbyist acceptance test job
>>>
>>>  .travis.yml                      |  18 +++-
>>>  MAINTAINERS                      |   1 +
>>>  tests/acceptance/ppc_prep_40p.py | 150 +++++++++++++++++++++++++++++++
>>>  3 files changed, 167 insertions(+), 2 deletions(-)
>>>  create mode 100644 tests/acceptance/ppc_prep_40p.py
>>>
>>


--
Alex Bennée


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine
  2019-09-16  9:52     ` Alex Bennée
@ 2019-09-16  9:56       ` Philippe Mathieu-Daudé
  2019-09-17  2:19         ` [Qemu-devel] [Qemu-ppc] " David Gibson
  0 siblings, 1 reply; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16  9:56 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Markus Armbruster,
	qemu-devel, Philippe Mathieu-Daudé,
	Kamil Rytarowski, qemu-ppc, Cleber Rosa, Hervé Poussineau,
	Artyom Tarasenko, David Gibson

On 9/16/19 11:52 AM, Alex Bennée wrote:
> 
> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> 
>> Hi David,
>>
>> On 9/16/19 2:42 AM, David Gibson wrote:
>>> On Sun, Sep 15, 2019 at 11:19:34PM +0200, Philippe Mathieu-Daudé wrote:
>>>> Quick tests worth to avoid regressions with the 40p machine.
>>>> idea from the "Maintainers, please tell us how to boot your machines"
>>>> thread:
>>>> https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg04177.html
>>>>
>>>> v2: Split Travis job, added Hervé R-b tag
>>>> v1: https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg05896.html
>>>>
>>>> Regards,
>>>>
>>>> Phil.
>>>
>>> I'm guessing you're expecting these to go in via the testing tree, in
>>> which case
>>>
>>> Acked-by: David Gibson <david@gibson.dropbear.id.au>
>>
>> Thanks, appreciated :)
>>
>>> Or do you want me to take them via the ppc tree?
>>
>> I think the 'testing tree' should focus on the CI/testing
>> infrastructure, while each subsystem maintainers should care about the
>> tests covering their subsystem (the testing tree maintainers might not
>> have the required knowledge to be sure a test is correctly implemented).
>>
>> In this particular case I assume you don't have much knowledge of that
>> PPC machine, which is a hobbyist one, but since you are the PPC
>> maintainer, I'd rather see this going via your tree :)
>>
>> Alex/Cleber/Eduardo, any comment on this position?
> 
> Once we have a .travis.yml I'm happy with it can go in via another tree
> no problem. See other thread....

Good :)

David can take patches 1-5 (I tagged patch 6 as RFC but messed something
with git-publish and lost it when I sent this series).

Thanks!

>>>> Philippe Mathieu-Daudé (6):
>>>>   tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
>>>>   tests/acceptance: Test Open Firmware on the PReP/40p
>>>>   tests/acceptance: Test OpenBIOS on the PReP/40p
>>>>   tests/acceptance: Test Sandalfoot initrd on the PReP/40p
>>>>   .travis.yml: Let the avocado job run the 40p tests
>>>>   .travis.yml: Split enterprise vs. hobbyist acceptance test job
>>>>
>>>>  .travis.yml                      |  18 +++-
>>>>  MAINTAINERS                      |   1 +
>>>>  tests/acceptance/ppc_prep_40p.py | 150 +++++++++++++++++++++++++++++++
>>>>  3 files changed, 167 insertions(+), 2 deletions(-)
>>>>  create mode 100644 tests/acceptance/ppc_prep_40p.py
>>>>
>>>
> 
> 
> --
> Alex Bennée
> 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 6/6] .travis.yml: Split enterprise vs. hobbyist acceptance test job
  2019-09-16  9:46       ` Alex Bennée
@ 2019-09-16 10:00         ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 10:00 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Markus Armbruster,
	Philippe Mathieu-Daudé,
	qemu-devel, Kamil Rytarowski, Hervé Poussineau,
	Aleksandar Markovic, Cleber Rosa, qemu-ppc, Artyom Tarasenko,
	David Gibson

On 9/16/19 11:46 AM, Alex Bennée wrote:
> 
> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> 
>> On 9/16/19 10:43 AM, Alex Bennée wrote:
>>> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
>>>
>>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>>> ---
>>>>  .travis.yml | 18 ++++++++++++++++--
>>>>  1 file changed, 16 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/.travis.yml b/.travis.yml
>>>> index 69a37f7387..753276eb33 100644
>>>> --- a/.travis.yml
>>>> +++ b/.travis.yml
>>>> @@ -265,9 +265,23 @@ matrix:
>>>>          - "3.6"
>>>>
>>>>
>>>> -    # Acceptance (Functional) tests
>>>> +    # Acceptance (Functional) tests [enterprise]
>>>>      - env:
>>>> -        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu"
>>>> +        - CONFIG="--python=/usr/bin/python3
>>>> --target-list=x86_64-softmmu,mips64el-softmmu,aarch64-softmmu,s390x-softmmu,ppc64-softmmu"
>>>
>>> You could use:
>>>
>>>   --target-list=${MAIN_SOFTMMU_TARGETS}
>>>
>>> and
>>>
>>>   --disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}
>>
>> I like the idea, but this variable is slighly different:
>>
>> MAIN_SOFTMMU_TARGETS="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"
>>
>> Are you suggesting we use MAIN_SOFTMMU_TARGETS for 'Enterprise'
>> targets?
> 
> Broadly - I'm note sure how we want to make the distinction in QEMU. We
> have targets which are actively maintained and represent current
> architectures that people still ship software to run on. The other
> targets are machines that are either esoteric designs that exist in
> particular niches or of academic interest and the old architecture kept
> alive out of a sense of nostalgia.
> 
>>
>> As long as mips64-softmmu is present, I think we can remove mips-softmmu
>> from MAIN_TARGETS. Maybe i386-softmmu can be removed too.
> 
> Well the MIPS targets are actively maintained although for 32 bit you
> don't see many distros for them these days. There might be an argument
> for demoting i386-softmmu as I'm guessing there isn't much 32 bit kvm in
> the enterprise right now (although It would be unsurprising to be told
> otherwise).
> 
>>
>> That would give the following hobbyist list:
>>
>> i386-softmmu,mips-softmmu,alpha-softmmu,ppc-softmmu,m68k-softmmu
> 
> I'm not sure about the hobbyist moniker as pretty much any of these TCG
> targets is more actively maintained than the x86 which is mostly all
> about the HW virtualisation these days. Trouble is I can't think of
> another name that doesn't sound condescending:
> 
>   HISTORICAL_SOFTMMU_TARGETS
>   LEGACY_SOFTMMU_TARGETS
>   FASTERTHANNATIVE_SOFTMMU_TARGETS
>   ARCHIVISTS_SOFTMMU_TARGETS
> 
> ? As ever naming things is hard....

:) I'm not trying to classify tests, I simply want users/maintainers to
not be reluctant/scared to add tests because "CI takes too long".

Also, I find it practical to have small jobs, what I do when testing a
series when I know it only affects a set of jobs, I push and directly
click "cancel all jobs" on the Travis web, then I just click on "restart
this job" on the set I'm interested in.
This way I can quickly figure out the series is OK or rework it.

>> (I plan to add hppa-softmmu there too).
>>
>>>> +        - TEST_CMD="make check-acceptance"
>>>> +      after_failure:
>>>> +        - cat tests/results/latest/job.log
>>>> +      addons:
>>>> +        apt:
>>>> +          packages:
>>>> +            - python3-pil
>>>> +            - python3-pip
>>>> +            - python3.5-venv
>>>> +
>>>> +
>>>> +    # Acceptance (Functional) tests [hobbyist]
>>>> +    - env:
>>>> +        - CONFIG="--python=/usr/bin/python3 --target-list=mips-softmmu,arm-softmmu,alpha-softmmu,ppc-softmmu,m68k-softmmu"
>>>>          - TEST_CMD="make check-acceptance"
>>>>        after_failure:
>>>>          - cat tests/results/latest/job.log
>>>
>>>
>>> --
>>> Alex Bennée
>>>
> 
> 
> --
> Alex Bennée
> 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 5/6] .travis.yml: Let the avocado job run the 40p tests
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 5/6] .travis.yml: Let the avocado job run the 40p tests Philippe Mathieu-Daudé
@ 2019-09-16 10:01   ` Alex Bennée
  0 siblings, 0 replies; 36+ messages in thread
From: Alex Bennée @ 2019-09-16 10:01 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, qemu-devel,
	Markus Armbruster, Kamil Rytarowski, Hervé Poussineau,
	Cleber Rosa, qemu-ppc, Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson


Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Acked-by: Alex Bennée <alex.bennee@linaro.org>

> ---
> If this list continues to grow we can
> - split it (as other jobs)
> - move them to GitLab where we can have multi-stage jobs,
>   avocado tests run on top of build jobs.
> ---
>  .travis.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index d0b9e099b9..69a37f7387 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -267,7 +267,7 @@ matrix:
>
>      # Acceptance (Functional) tests
>      - env:
> -        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,ppc64-softmmu,m68k-softmmu"
> +        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu"
>          - TEST_CMD="make check-acceptance"
>        after_failure:
>          - cat tests/results/latest/job.log


--
Alex Bennée


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 1/6] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 1/6] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p Philippe Mathieu-Daudé
  2019-09-16  9:44   ` Artyom Tarasenko
@ 2019-09-16 16:08   ` Cleber Rosa
  2019-09-16 16:19     ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 36+ messages in thread
From: Cleber Rosa @ 2019-09-16 16:08 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	qemu-devel, Markus Armbruster, Kamil Rytarowski,
	Hervé Poussineau, qemu-ppc, Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson

On Sun, Sep 15, 2019 at 11:19:35PM +0200, Philippe Mathieu-Daudé wrote:
> 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>
> 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.
> ---
>  MAINTAINERS                      |  1 +
>  tests/acceptance/ppc_prep_40p.py | 63 ++++++++++++++++++++++++++++++++
>  2 files changed, 64 insertions(+)
>  create mode 100644 tests/acceptance/ppc_prep_40p.py
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 50eaf005f4..ce809c7dee 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1068,6 +1068,7 @@ F: hw/timer/m48t59-isa.c
>  F: include/hw/isa/pc87312.h
>  F: include/hw/timer/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..53f2d2ecf0
> --- /dev/null
> +++ b/tests/acceptance/ppc_prep_40p.py
> @@ -0,0 +1,63 @@
> +# 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_qemu import Test
> +
> +
> +class IbmPrep40pMachine(Test):
> +
> +    timeout = 60
> +
> +    # TODO refactor to MachineTest

Your TODO is a clear sign of awareness of the duplicated code that
follows.  The mention of a MachineTest points into the direction that
I can see as the best final solution (that is, test classes that target
specific test scenarions).

But, it may be a more effective refactor strategy, to simply turn the
`wait_for_console_pattern` from a method into a utility function, and
then the discussion of the common test classes (say MachineTest,
GuestTest, MigrationTest) can follow later.

> +    def wait_for_console_pattern(self, success_message, failure_message=None):

Following the previous suggestion, `self` would become something like `test`.

> +        """
> +        Waits for messages to appear on the console, while logging the content
> +

Documented as something like:

  :param test: an Avocado test containing a VM that will have its console
               read and probed for a success or failure message
  :type test: :class:`avocado_qemu.Test`

> +        :param success_message: if this message appears, test succeeds
> +        :param failure_message: if this message appears, test fails
> +        """
> +        console = self.vm.console_socket.makefile()
> +        console_logger = logging.getLogger('console')
> +        while True:
> +            msg = console.readline().strip()
> +            if not msg:
> +                continue
> +            console_logger.debug(msg)
> +            if success_message in msg:
> +                break
> +            if failure_message and failure_message in msg:
> +                fail = 'Failure message found in console: %s' % failure_message
> +                self.fail(fail)
> +
> +    @skipIf(os.getenv('CONTINUOUS_INTEGRATION'), 'Running on Travis-CI')
> +    def test_factory_firmware_and_netbsd(self):
> +        """
> +        :avocado: tags=arch:ppc
> +        :avocado: tags=machine:40p
> +        :avocado: tags=slowness:high

This is certainly a discussion in itself, but I wonder what is your
criteria for definising the slowness level of a test.  FOY, this one
takes me ~17 seconds on my local machine.

> +        """
> +        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')

FIY, Avocado 72.0 (due Tomorrow) will have relaxed strictness for tags
values.  That will allow us to represent all current machine type
names in ":avocado: tags=machine:$VALUE" (such as "s390-ccw-virtio").
Then we'll be able to reuse them here, avoiding a bit of boiler plate
code.

> +        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'
> +        self.wait_for_console_pattern(os_banner)
> +        self.wait_for_console_pattern('Model: IBM PPS Model 6015')
> -- 
> 2.20.1
> 

Overall it looks good and works for me.  Let me know what you think of
the wait_for_console_pattern() refactor suggestions.

- Cleber.


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine
  2019-09-16  9:28   ` Philippe Mathieu-Daudé
  2019-09-16  9:52     ` Alex Bennée
@ 2019-09-16 16:14     ` Eduardo Habkost
  1 sibling, 0 replies; 36+ messages in thread
From: Eduardo Habkost @ 2019-09-16 16:14 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Thomas Huth, Markus Armbruster, qemu-devel,
	Philippe Mathieu-Daudé,
	Kamil Rytarowski, Hervé Poussineau, Cleber Rosa, qemu-ppc,
	Alex Bennée, Artyom Tarasenko, David Gibson

On Mon, Sep 16, 2019 at 11:28:23AM +0200, Philippe Mathieu-Daudé wrote:
> Hi David,
> 
> On 9/16/19 2:42 AM, David Gibson wrote:
> > On Sun, Sep 15, 2019 at 11:19:34PM +0200, Philippe Mathieu-Daudé wrote:
> >> Quick tests worth to avoid regressions with the 40p machine.
> >> idea from the "Maintainers, please tell us how to boot your machines"
> >> thread:
> >> https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg04177.html
> >>
> >> v2: Split Travis job, added Hervé R-b tag
> >> v1: https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg05896.html
> >>
> >> Regards,
> >>
> >> Phil.
> > 
> > I'm guessing you're expecting these to go in via the testing tree, in
> > which case
> > 
> > Acked-by: David Gibson <david@gibson.dropbear.id.au>
> 
> Thanks, appreciated :)
> 
> > Or do you want me to take them via the ppc tree?
> 
> I think the 'testing tree' should focus on the CI/testing
> infrastructure, while each subsystem maintainers should care about the
> tests covering their subsystem (the testing tree maintainers might not
> have the required knowledge to be sure a test is correctly implemented).
> 
> In this particular case I assume you don't have much knowledge of that
> PPC machine, which is a hobbyist one, but since you are the PPC
> maintainer, I'd rather see this going via your tree :)
> 
> Alex/Cleber/Eduardo, any comment on this position?

This makes sense to me.  We don't need all new tests to go
through the same tree.

-- 
Eduardo


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 1/6] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
  2019-09-16 16:08   ` Cleber Rosa
@ 2019-09-16 16:19     ` Philippe Mathieu-Daudé
  2019-09-16 16:40       ` [Qemu-devel] [PATCH] Acceptance tests: refactor wait_for_console_pattern Cleber Rosa
  0 siblings, 1 reply; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-16 16:19 UTC (permalink / raw)
  To: Cleber Rosa, Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, qemu-devel,
	Markus Armbruster, Kamil Rytarowski, Hervé Poussineau,
	qemu-ppc, Alex Bennée, Artyom Tarasenko, David Gibson

On 9/16/19 6:08 PM, Cleber Rosa wrote:
> On Sun, Sep 15, 2019 at 11:19:35PM +0200, Philippe Mathieu-Daudé wrote:
>> 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>
>> 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.
>> ---
>>  MAINTAINERS                      |  1 +
>>  tests/acceptance/ppc_prep_40p.py | 63 ++++++++++++++++++++++++++++++++
>>  2 files changed, 64 insertions(+)
>>  create mode 100644 tests/acceptance/ppc_prep_40p.py
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 50eaf005f4..ce809c7dee 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -1068,6 +1068,7 @@ F: hw/timer/m48t59-isa.c
>>  F: include/hw/isa/pc87312.h
>>  F: include/hw/timer/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..53f2d2ecf0
>> --- /dev/null
>> +++ b/tests/acceptance/ppc_prep_40p.py
>> @@ -0,0 +1,63 @@
>> +# 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_qemu import Test
>> +
>> +
>> +class IbmPrep40pMachine(Test):
>> +
>> +    timeout = 60
>> +
>> +    # TODO refactor to MachineTest
> 
> Your TODO is a clear sign of awareness of the duplicated code that
> follows.  The mention of a MachineTest points into the direction that
> I can see as the best final solution (that is, test classes that target
> specific test scenarions).
> 
> But, it may be a more effective refactor strategy, to simply turn the
> `wait_for_console_pattern` from a method into a utility function, and
> then the discussion of the common test classes (say MachineTest,
> GuestTest, MigrationTest) can follow later.

Yes, I'd like we clean this and make it robust, but for now, the more
tests we have, the better we can see how the common MachineTest should
be. Let's do this in another follow-up series.

>> +    def wait_for_console_pattern(self, success_message, failure_message=None):
> 
> Following the previous suggestion, `self` would become something like `test`.
> 
>> +        """
>> +        Waits for messages to appear on the console, while logging the content
>> +
> 
> Documented as something like:
> 
>   :param test: an Avocado test containing a VM that will have its console
>                read and probed for a success or failure message
>   :type test: :class:`avocado_qemu.Test`
> 
>> +        :param success_message: if this message appears, test succeeds
>> +        :param failure_message: if this message appears, test fails
>> +        """
>> +        console = self.vm.console_socket.makefile()
>> +        console_logger = logging.getLogger('console')
>> +        while True:
>> +            msg = console.readline().strip()
>> +            if not msg:
>> +                continue
>> +            console_logger.debug(msg)
>> +            if success_message in msg:
>> +                break
>> +            if failure_message and failure_message in msg:
>> +                fail = 'Failure message found in console: %s' % failure_message
>> +                self.fail(fail)
>> +
>> +    @skipIf(os.getenv('CONTINUOUS_INTEGRATION'), 'Running on Travis-CI')
>> +    def test_factory_firmware_and_netbsd(self):
>> +        """
>> +        :avocado: tags=arch:ppc
>> +        :avocado: tags=machine:40p
>> +        :avocado: tags=slowness:high
> 
> This is certainly a discussion in itself, but I wonder what is your
> criteria for definising the slowness level of a test.  FOY, this one
> takes me ~17 seconds on my local machine.

Ah, I was running this in my --enable-debug --enable-tcg-debug
out-of-tree directory, it takes >2min here.

>> +        """
>> +        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')
> 
> FIY, Avocado 72.0 (due Tomorrow) will have relaxed strictness for tags
> values.  That will allow us to represent all current machine type
> names in ":avocado: tags=machine:$VALUE" (such as "s390-ccw-virtio").
> Then we'll be able to reuse them here, avoiding a bit of boiler plate
> code.

Good news!

>> +        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'
>> +        self.wait_for_console_pattern(os_banner)
>> +        self.wait_for_console_pattern('Model: IBM PPS Model 6015')
>> -- 
>> 2.20.1
>>
> 
> Overall it looks good and works for me.  Let me know what you think of
> the wait_for_console_pattern() refactor suggestions.

Thanks, I agree we can do it later :)

Regards,

Phil.


^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Qemu-devel] [PATCH] Acceptance tests: refactor wait_for_console_pattern
  2019-09-16 16:19     ` Philippe Mathieu-Daudé
@ 2019-09-16 16:40       ` Cleber Rosa
  2019-10-17 12:57         ` Philippe Mathieu-Daudé
  2019-10-24 20:01         ` [Qemu-devel] " Wainer dos Santos Moschetta
  0 siblings, 2 replies; 36+ messages in thread
From: Cleber Rosa @ 2019-09-16 16:40 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Aleksandar Rikalo, Wainer dos Santos Moschetta,
	Willian Rampazzo, Cleber Rosa, Philippe Mathieu-Daudé,
	Aurelien Jarno

The same utility method is already present in two different test
files, so let's consolidate it into a single utility function.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 26 +++++++++++++
 tests/acceptance/boot_linux_console.py    | 47 +++++++----------------
 tests/acceptance/linux_ssh_mips_malta.py  | 18 ++-------
 3 files changed, 42 insertions(+), 49 deletions(-)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index bd41e0443c..a0fe16e47f 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -8,6 +8,7 @@
 # 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 logging
 import os
 import sys
 import uuid
@@ -53,6 +54,31 @@ def pick_default_qemu_bin(arch=None):
         return qemu_bin_from_src_dir_path
 
 
+def wait_for_console_pattern(test, success_message,
+                             failure_message='Kernel panic - not syncing'):
+    """
+    Waits for messages to appear on the console, while logging the content
+
+    :param test: an Avocado test containing a VM that will have its console
+                 read and probed for a success or failure message
+    :type test: :class:`avocado_qemu.Test`
+    :param success_message: if this message appears, test succeeds
+    :param failure_message: if this message appears, test fails
+    """
+    console = test.vm.console_socket.makefile()
+    console_logger = logging.getLogger('console')
+    while True:
+        msg = console.readline().strip()
+        if not msg:
+            continue
+        console_logger.debug(msg)
+        if success_message in msg:
+            break
+        if failure_message in msg:
+            fail = 'Failure message found in console: %s' % failure_message
+            test.fail(fail)
+
+
 class Test(avocado.Test):
     def setUp(self):
         self._vms = {}
diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 8a9a314ab4..9ff2213874 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -9,12 +9,12 @@
 # later.  See the COPYING file in the top-level directory.
 
 import os
-import logging
 import lzma
 import gzip
 import shutil
 
 from avocado_qemu import Test
+from avocado_qemu import wait_for_console_pattern
 from avocado.utils import process
 from avocado.utils import archive
 
@@ -29,31 +29,10 @@ class BootLinuxConsole(Test):
 
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
-    def wait_for_console_pattern(self, success_message,
-                                 failure_message='Kernel panic - not syncing'):
-        """
-        Waits for messages to appear on the console, while logging the content
-
-        :param success_message: if this message appears, test succeeds
-        :param failure_message: if this message appears, test fails
-        """
-        console = self.vm.console_socket.makefile()
-        console_logger = logging.getLogger('console')
-        while True:
-            msg = console.readline().strip()
-            if not msg:
-                continue
-            console_logger.debug(msg)
-            if success_message in msg:
-                break
-            if failure_message in msg:
-                fail = 'Failure message found in console: %s' % failure_message
-                self.fail(fail)
-
     def exec_command_and_wait_for_pattern(self, command, success_message):
         command += '\n'
         self.vm.console_socket.sendall(command.encode())
-        self.wait_for_console_pattern(success_message)
+        wait_for_console_pattern(self, success_message)
 
     def extract_from_deb(self, deb, path):
         """
@@ -89,7 +68,7 @@ class BootLinuxConsole(Test):
                          '-append', kernel_command_line)
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
+        wait_for_console_pattern(self, console_pattern)
 
     def test_mips_malta(self):
         """
@@ -112,7 +91,7 @@ class BootLinuxConsole(Test):
                          '-append', kernel_command_line)
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
+        wait_for_console_pattern(self, console_pattern)
 
     def test_mips64el_malta(self):
         """
@@ -145,7 +124,7 @@ class BootLinuxConsole(Test):
                          '-append', kernel_command_line)
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
+        wait_for_console_pattern(self, console_pattern)
 
     def test_mips_malta_cpio(self):
         """
@@ -181,7 +160,7 @@ class BootLinuxConsole(Test):
                          '-append', kernel_command_line,
                          '-no-reboot')
         self.vm.launch()
-        self.wait_for_console_pattern('Boot successful.')
+        wait_for_console_pattern(self, 'Boot successful.')
 
         self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
                                                'BogoMIPS')
@@ -208,7 +187,7 @@ class BootLinuxConsole(Test):
                          '-append', kernel_command_line)
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
+        wait_for_console_pattern(self, console_pattern)
 
     def test_mips_malta32el_nanomips_4k(self):
         """
@@ -266,7 +245,7 @@ class BootLinuxConsole(Test):
                          '-append', kernel_command_line)
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
+        wait_for_console_pattern(self, console_pattern)
 
     def test_arm_virt(self):
         """
@@ -287,7 +266,7 @@ class BootLinuxConsole(Test):
                          '-append', kernel_command_line)
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
+        wait_for_console_pattern(self, console_pattern)
 
     def test_arm_emcraft_sf2(self):
         """
@@ -314,7 +293,7 @@ class BootLinuxConsole(Test):
                          '-drive', 'file=' + spi_path + ',if=mtd,format=raw',
                          '-no-reboot')
         self.vm.launch()
-        self.wait_for_console_pattern('init started: BusyBox')
+        wait_for_console_pattern(self, 'init started: BusyBox')
 
     def test_s390x_s390_ccw_virtio(self):
         """
@@ -335,7 +314,7 @@ class BootLinuxConsole(Test):
                          '-append', kernel_command_line)
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
+        wait_for_console_pattern(self, console_pattern)
 
     def test_alpha_clipper(self):
         """
@@ -357,7 +336,7 @@ class BootLinuxConsole(Test):
                          '-append', kernel_command_line)
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
+        wait_for_console_pattern(self, console_pattern)
 
     def test_ppc64_pseries(self):
         """
@@ -377,4 +356,4 @@ class BootLinuxConsole(Test):
                          '-append', kernel_command_line)
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
+        wait_for_console_pattern(self, console_pattern)
diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/linux_ssh_mips_malta.py
index 134f10cac3..da7a386117 100644
--- a/tests/acceptance/linux_ssh_mips_malta.py
+++ b/tests/acceptance/linux_ssh_mips_malta.py
@@ -14,6 +14,7 @@ import time
 
 from avocado import skipIf
 from avocado_qemu import Test
+from avocado_qemu import wait_for_console_pattern
 from avocado.utils import process
 from avocado.utils import archive
 
@@ -56,19 +57,6 @@ class LinuxSSH(Test):
         },
     }
 
-    def wait_for_console_pattern(self, success_message,
-                                 failure_message='Oops'):
-        console = self.vm.console_socket.makefile()
-        console_logger = logging.getLogger('console')
-        while True:
-            msg = console.readline()
-            console_logger.debug(msg.strip())
-            if success_message in msg:
-                break
-            if failure_message in msg:
-                fail = 'Failure message found in console: %s' % failure_message
-                self.fail(fail)
-
     def get_portfwd(self):
         res = self.vm.command('human-monitor-command',
                               command_line='info usernet')
@@ -135,7 +123,7 @@ class LinuxSSH(Test):
 
         self.log.info('VM launched, waiting for sshd')
         console_pattern = 'Starting OpenBSD Secure Shell server: sshd'
-        self.wait_for_console_pattern(console_pattern)
+        wait_for_console_pattern(self, console_pattern, 'Oops')
         self.log.info('sshd ready')
 
         self.ssh_connect('root', 'root', rsa_hostkey_b64=rsa_hostkey_b64)
@@ -143,7 +131,7 @@ class LinuxSSH(Test):
     def shutdown_via_ssh(self):
         self.ssh_command('poweroff')
         self.ssh_disconnect_vm()
-        self.wait_for_console_pattern('Power down')
+        wait_for_console_pattern(self, 'Power down', 'Oops')
 
     def run_common_commands(self):
         stdout, stderr = self.ssh_command('lspci -d 11ab:4620')
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p Philippe Mathieu-Daudé
  2019-09-16  9:36   ` Artyom Tarasenko
@ 2019-09-16 17:59   ` Cleber Rosa
  2019-09-16 18:55     ` Cleber Rosa
  1 sibling, 1 reply; 36+ messages in thread
From: Cleber Rosa @ 2019-09-16 17:59 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	qemu-devel, Markus Armbruster, Kamil Rytarowski,
	Hervé Poussineau, qemu-ppc, Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson

On Sun, Sep 15, 2019 at 11:19:36PM +0200, Philippe Mathieu-Daudé wrote:
> User case from:
> https://tyom.blogspot.com/2019/04/aixprep-under-qemu-how-to.html
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/acceptance/ppc_prep_40p.py | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
> index 53f2d2ecf0..a0eac40d9f 100644
> --- a/tests/acceptance/ppc_prep_40p.py
> +++ b/tests/acceptance/ppc_prep_40p.py
> @@ -61,3 +61,24 @@ class IbmPrep40pMachine(Test):
>          os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
>          self.wait_for_console_pattern(os_banner)
>          self.wait_for_console_pattern('Model: IBM PPS Model 6015')
> +
> +    def test_openfirmware(self):
> +        """
> +        :avocado: tags=arch:ppc
> +        :avocado: tags=machine:40p
> +        """
> +        bios_url = ('https://github.com/artyom-tarasenko/openfirmware/'
> +                    'releases/download/40p-20190413/q40pofw-serial.rom')
> +        bios_hash = '880c80172ea5b2247c0ac2a8bf36bbe385192c72'
> +        bios_path = self.fetch_asset(bios_url, asset_hash=bios_hash)
> +
> +        self.vm.set_machine('40p')
> +        self.vm.set_console()
> +        self.vm.add_args('-bios', bios_path)
> +
> +        self.vm.launch()
> +        self.wait_for_console_pattern('QEMU PReP/40p')
> +        fw_banner = 'Open Firmware, built  April 13, 2019 09:29:23'
> +        self.wait_for_console_pattern(fw_banner)
> +        prompt_msg = 'Type any key to interrupt automatic startup'
> +        self.wait_for_console_pattern(prompt_msg)
> -- 
> 2.20.1
> 

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


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p
  2019-09-16 17:59   ` Cleber Rosa
@ 2019-09-16 18:55     ` Cleber Rosa
  2019-09-17  9:33       ` Alex Bennée
  0 siblings, 1 reply; 36+ messages in thread
From: Cleber Rosa @ 2019-09-16 18:55 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Alex Bennée,
	qemu-devel, Markus Armbruster, Kamil Rytarowski,
	Hervé Poussineau, qemu-ppc, Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson

On Mon, Sep 16, 2019 at 01:59:22PM -0400, Cleber Rosa wrote:
> On Sun, Sep 15, 2019 at 11:19:36PM +0200, Philippe Mathieu-Daudé wrote:
> > User case from:
> > https://tyom.blogspot.com/2019/04/aixprep-under-qemu-how-to.html
> > 
> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > ---
> >  tests/acceptance/ppc_prep_40p.py | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> > 
> > diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
> > index 53f2d2ecf0..a0eac40d9f 100644
> > --- a/tests/acceptance/ppc_prep_40p.py
> > +++ b/tests/acceptance/ppc_prep_40p.py
> > @@ -61,3 +61,24 @@ class IbmPrep40pMachine(Test):
> >          os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
> >          self.wait_for_console_pattern(os_banner)
> >          self.wait_for_console_pattern('Model: IBM PPS Model 6015')
> > +
> > +    def test_openfirmware(self):
> > +        """
> > +        :avocado: tags=arch:ppc
> > +        :avocado: tags=machine:40p
> > +        """
> > +        bios_url = ('https://github.com/artyom-tarasenko/openfirmware/'
> > +                    'releases/download/40p-20190413/q40pofw-serial.rom')
> > +        bios_hash = '880c80172ea5b2247c0ac2a8bf36bbe385192c72'
> > +        bios_path = self.fetch_asset(bios_url, asset_hash=bios_hash)
> > +
> > +        self.vm.set_machine('40p')
> > +        self.vm.set_console()
> > +        self.vm.add_args('-bios', bios_path)
> > +
> > +        self.vm.launch()
> > +        self.wait_for_console_pattern('QEMU PReP/40p')
> > +        fw_banner = 'Open Firmware, built  April 13, 2019 09:29:23'
> > +        self.wait_for_console_pattern(fw_banner)
> > +        prompt_msg = 'Type any key to interrupt automatic startup'
> > +        self.wait_for_console_pattern(prompt_msg)
> > -- 
> > 2.20.1
> > 
> 
> Tested-by: Cleber Rosa <crosa@redhat.com>
> Reviewed-by: Cleber Rosa <crosa@redhat.com>

Actually, I'm seeing random but consistent failures.  I've tracked
it down to the 'Open Firmware, built  April 13, 2019 09:29:23'.  Out
of 100 executions I got 27 failures, with that line logged as:

  2019-09-16 14:44:54,540 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:45:00,762 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:45:06,575 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:45:12,859 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:45:18,707 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:45:21,876 ppc_prep_40p     L0033 DEBUG| en Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:45:28,054 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:45:31,163 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:45:34,291 ppc_prep_40p     L0033 DEBUG| en Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:45:57,719 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:46:03,610 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:46:06,795 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:46:17,087 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:46:21,534 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:46:24,694 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:46:38,076 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:46:49,863 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:46:54,435 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:47:00,672 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:47:03,834 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:47:06,852 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:47:14,276 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:47:17,380 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:47:34,749 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:47:39,217 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:47:43,750 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
  2019-09-16 14:48:04,003 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23

Given that we're not seeing this behavior in other target/marchine
tests, my first impression is that this is what's being produced
by QEMU, and not what's being badly captured by the Avocado and/or
the test code.

Any ideas?

- Cleber.


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS on the PReP/40p
  2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS " Philippe Mathieu-Daudé
@ 2019-09-16 19:32   ` Cleber Rosa
  2019-09-17  9:31     ` Alex Bennée
  0 siblings, 1 reply; 36+ messages in thread
From: Cleber Rosa @ 2019-09-16 19:32 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth,
	Philippe Mathieu-Daudé,
	qemu-devel, Markus Armbruster, Kamil Rytarowski, qemu-ppc,
	Hervé Poussineau, Alex Bennée, Artyom Tarasenko,
	David Gibson

On Sun, Sep 15, 2019 at 11:19:37PM +0200, Philippe Mathieu-Daudé wrote:
> User case from:
> https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/acceptance/ppc_prep_40p.py | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
> index a0eac40d9f..87b5311b89 100644
> --- a/tests/acceptance/ppc_prep_40p.py
> +++ b/tests/acceptance/ppc_prep_40p.py
> @@ -82,3 +82,35 @@ class IbmPrep40pMachine(Test):
>          self.wait_for_console_pattern(fw_banner)
>          prompt_msg = 'Type any key to interrupt automatic startup'
>          self.wait_for_console_pattern(prompt_msg)
> +
> +    def test_openbios_192m(self):
> +        """
> +        :avocado: tags=arch:ppc
> +        :avocado: tags=machine:40p
> +        """
> +        self.vm.set_machine('40p')
> +        self.vm.set_console()
> +        self.vm.add_args('-m', '192')

Is 192 a magic number (some kind of limit)?  Or just a value to check
against later?

> +
> +        self.vm.launch()
> +        self.wait_for_console_pattern('>> OpenBIOS')
> +        self.wait_for_console_pattern('>> Memory: 192M')
> +        self.wait_for_console_pattern('>> CPU type PowerPC,604')
> +

On my testing, this is a very stable test, I'm only getting PASSes.

> +    def test_openbios_and_netbsd(self):
> +        """
> +        :avocado: tags=arch:ppc
> +        :avocado: tags=machine:40p
> +        """
> +        drive_url = ('https://ftp.netbsd.org/pub/NetBSD/iso/7.1.2/'
> +                     'NetBSD-7.1.2-prep.iso')
> +        drive_hash = '78734c1bdda79778f0b6f391969ad2458ed8981c'

According to https://ftp.netbsd.org/pub/NetBSD/iso/7.1.2/MD5 :

  MD5 (NetBSD-7.1.2-prep.iso) = ac6fa2707d888b36d6fa64de6e7fe48e

Which would require either:

  drive_hash = 'ac6fa2707d888b36d6fa64de6e7fe48e'
  drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash,
                                algorithm='md5')

Or, if you want to use sha1:

  drive_hash = '467ba366e4574d32b060532660369542d607ec5d'

- Cleber.

> +        drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash)
> +
> +        self.vm.set_machine('40p')
> +        self.vm.set_console()
> +        self.vm.add_args('-cdrom', drive_path,
> +                         '-boot', 'd')
> +
> +        self.vm.launch()
> +        self.wait_for_console_pattern('NetBSD/prep BOOT, Revision 1.9')
> -- 
> 2.20.1
> 
> 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine
  2019-09-16  9:56       ` Philippe Mathieu-Daudé
@ 2019-09-17  2:19         ` David Gibson
  2019-09-17 11:40           ` David Gibson
  0 siblings, 1 reply; 36+ messages in thread
From: David Gibson @ 2019-09-17  2:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, qemu-devel,
	Markus Armbruster, Kamil Rytarowski, qemu-ppc, Cleber Rosa,
	Hervé Poussineau, Alex Bennée, Artyom Tarasenko,
	Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 2929 bytes --]

On Mon, Sep 16, 2019 at 11:56:06AM +0200, Philippe Mathieu-Daudé wrote:
> On 9/16/19 11:52 AM, Alex Bennée wrote:
> > 
> > Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> > 
> >> Hi David,
> >>
> >> On 9/16/19 2:42 AM, David Gibson wrote:
> >>> On Sun, Sep 15, 2019 at 11:19:34PM +0200, Philippe Mathieu-Daudé wrote:
> >>>> Quick tests worth to avoid regressions with the 40p machine.
> >>>> idea from the "Maintainers, please tell us how to boot your machines"
> >>>> thread:
> >>>> https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg04177.html
> >>>>
> >>>> v2: Split Travis job, added Hervé R-b tag
> >>>> v1: https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg05896.html
> >>>>
> >>>> Regards,
> >>>>
> >>>> Phil.
> >>>
> >>> I'm guessing you're expecting these to go in via the testing tree, in
> >>> which case
> >>>
> >>> Acked-by: David Gibson <david@gibson.dropbear.id.au>
> >>
> >> Thanks, appreciated :)
> >>
> >>> Or do you want me to take them via the ppc tree?
> >>
> >> I think the 'testing tree' should focus on the CI/testing
> >> infrastructure, while each subsystem maintainers should care about the
> >> tests covering their subsystem (the testing tree maintainers might not
> >> have the required knowledge to be sure a test is correctly implemented).
> >>
> >> In this particular case I assume you don't have much knowledge of that
> >> PPC machine, which is a hobbyist one, but since you are the PPC
> >> maintainer, I'd rather see this going via your tree :)
> >>
> >> Alex/Cleber/Eduardo, any comment on this position?
> > 
> > Once we have a .travis.yml I'm happy with it can go in via another tree
> > no problem. See other thread....
> 
> Good :)
> 
> David can take patches 1-5 (I tagged patch 6 as RFC but messed something
> with git-publish and lost it when I sent this series).

Ok, I've taken patches 1-5 into my ppc-for-4.2 tree.

> 
> Thanks!
> 
> >>>> Philippe Mathieu-Daudé (6):
> >>>>   tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
> >>>>   tests/acceptance: Test Open Firmware on the PReP/40p
> >>>>   tests/acceptance: Test OpenBIOS on the PReP/40p
> >>>>   tests/acceptance: Test Sandalfoot initrd on the PReP/40p
> >>>>   .travis.yml: Let the avocado job run the 40p tests
> >>>>   .travis.yml: Split enterprise vs. hobbyist acceptance test job
> >>>>
> >>>>  .travis.yml                      |  18 +++-
> >>>>  MAINTAINERS                      |   1 +
> >>>>  tests/acceptance/ppc_prep_40p.py | 150 +++++++++++++++++++++++++++++++
> >>>>  3 files changed, 167 insertions(+), 2 deletions(-)
> >>>>  create mode 100644 tests/acceptance/ppc_prep_40p.py
> >>>>
> >>>
> > 
> > 
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS on the PReP/40p
  2019-09-16 19:32   ` Cleber Rosa
@ 2019-09-17  9:31     ` Alex Bennée
  2019-09-17  9:44       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 36+ messages in thread
From: Alex Bennée @ 2019-09-17  9:31 UTC (permalink / raw)
  To: Cleber Rosa
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Markus Armbruster,
	Philippe Mathieu-Daudé,
	qemu-devel, Kamil Rytarowski, qemu-ppc, Hervé Poussineau,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson


Cleber Rosa <crosa@redhat.com> writes:

> On Sun, Sep 15, 2019 at 11:19:37PM +0200, Philippe Mathieu-Daudé wrote:
>> User case from:
>> https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  tests/acceptance/ppc_prep_40p.py | 32 ++++++++++++++++++++++++++++++++
>>  1 file changed, 32 insertions(+)
>>
>> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
>> index a0eac40d9f..87b5311b89 100644
>> --- a/tests/acceptance/ppc_prep_40p.py
>> +++ b/tests/acceptance/ppc_prep_40p.py
>> @@ -82,3 +82,35 @@ class IbmPrep40pMachine(Test):
>>          self.wait_for_console_pattern(fw_banner)
>>          prompt_msg = 'Type any key to interrupt automatic startup'
>>          self.wait_for_console_pattern(prompt_msg)
>> +
>> +    def test_openbios_192m(self):
>> +        """
>> +        :avocado: tags=arch:ppc
>> +        :avocado: tags=machine:40p
>> +        """
>> +        self.vm.set_machine('40p')
>> +        self.vm.set_console()
>> +        self.vm.add_args('-m', '192')
>
> Is 192 a magic number (some kind of limit)?  Or just a value to check
> against later?

Just the memory configured for the machine, checked bellow. Or are you
wondering why 192m and not any other amount?

>> +
>> +        self.vm.launch()
>> +        self.wait_for_console_pattern('>> OpenBIOS')
>> +        self.wait_for_console_pattern('>> Memory: 192M')
>> +        self.wait_for_console_pattern('>> CPU type PowerPC,604')
>> +
>
> On my testing, this is a very stable test, I'm only getting PASSes.
<snip>

--
Alex Bennée


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p
  2019-09-16 18:55     ` Cleber Rosa
@ 2019-09-17  9:33       ` Alex Bennée
  2019-09-17  9:42         ` Artyom Tarasenko
  0 siblings, 1 reply; 36+ messages in thread
From: Alex Bennée @ 2019-09-17  9:33 UTC (permalink / raw)
  To: Cleber Rosa
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Markus Armbruster,
	Philippe Mathieu-Daudé,
	qemu-devel, Kamil Rytarowski, Hervé Poussineau, qemu-ppc,
	Philippe Mathieu-Daudé,
	Artyom Tarasenko, David Gibson


Cleber Rosa <crosa@redhat.com> writes:

> On Mon, Sep 16, 2019 at 01:59:22PM -0400, Cleber Rosa wrote:
>> On Sun, Sep 15, 2019 at 11:19:36PM +0200, Philippe Mathieu-Daudé wrote:
>> > User case from:
>> > https://tyom.blogspot.com/2019/04/aixprep-under-qemu-how-to.html
>> >
>> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> > ---
>> >  tests/acceptance/ppc_prep_40p.py | 21 +++++++++++++++++++++
>> >  1 file changed, 21 insertions(+)
>> >
>> > diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
>> > index 53f2d2ecf0..a0eac40d9f 100644
>> > --- a/tests/acceptance/ppc_prep_40p.py
>> > +++ b/tests/acceptance/ppc_prep_40p.py
>> > @@ -61,3 +61,24 @@ class IbmPrep40pMachine(Test):
>> >          os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
>> >          self.wait_for_console_pattern(os_banner)
>> >          self.wait_for_console_pattern('Model: IBM PPS Model 6015')
>> > +
>> > +    def test_openfirmware(self):
>> > +        """
>> > +        :avocado: tags=arch:ppc
>> > +        :avocado: tags=machine:40p
>> > +        """
>> > +        bios_url = ('https://github.com/artyom-tarasenko/openfirmware/'
>> > +                    'releases/download/40p-20190413/q40pofw-serial.rom')
>> > +        bios_hash = '880c80172ea5b2247c0ac2a8bf36bbe385192c72'
>> > +        bios_path = self.fetch_asset(bios_url, asset_hash=bios_hash)
>> > +
>> > +        self.vm.set_machine('40p')
>> > +        self.vm.set_console()
>> > +        self.vm.add_args('-bios', bios_path)
>> > +
>> > +        self.vm.launch()
>> > +        self.wait_for_console_pattern('QEMU PReP/40p')
>> > +        fw_banner = 'Open Firmware, built  April 13, 2019 09:29:23'
>> > +        self.wait_for_console_pattern(fw_banner)
>> > +        prompt_msg = 'Type any key to interrupt automatic startup'
>> > +        self.wait_for_console_pattern(prompt_msg)
>> > --
>> > 2.20.1
>> >
>>
>> Tested-by: Cleber Rosa <crosa@redhat.com>
>> Reviewed-by: Cleber Rosa <crosa@redhat.com>
>
> Actually, I'm seeing random but consistent failures.  I've tracked
> it down to the 'Open Firmware, built  April 13, 2019 09:29:23'.  Out
> of 100 executions I got 27 failures, with that line logged as:
>
>   2019-09-16 14:44:54,540 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:45:00,762 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:45:06,575 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:45:12,859 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:45:18,707 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:45:21,876 ppc_prep_40p     L0033 DEBUG| en Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:45:28,054 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:45:31,163 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:45:34,291 ppc_prep_40p     L0033 DEBUG| en Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:45:57,719 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:46:03,610 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:46:06,795 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:46:17,087 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:46:21,534 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:46:24,694 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:46:38,076 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:46:49,863 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:46:54,435 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:47:00,672 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:47:03,834 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:47:06,852 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:47:14,276 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:47:17,380 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:47:34,749 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:47:39,217 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:47:43,750 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>   2019-09-16 14:48:04,003 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>
> Given that we're not seeing this behavior in other target/marchine
> tests, my first impression is that this is what's being produced
> by QEMU, and not what's being badly captured by the Avocado and/or
> the test code.

Is the DEBUG line meant to show everything that avocado saw? I guess we
could have a bug in the serial port emulation causing characters to be
dropped?

>
> Any ideas?
>
> - Cleber.


--
Alex Bennée


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p
  2019-09-17  9:33       ` Alex Bennée
@ 2019-09-17  9:42         ` Artyom Tarasenko
  2019-09-17  9:49           ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 36+ messages in thread
From: Artyom Tarasenko @ 2019-09-17  9:42 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Markus Armbruster,
	qemu-devel, Philippe Mathieu-Daudé,
	Kamil Rytarowski, open list:PReP, Cleber Rosa,
	Hervé Poussineau, Philippe Mathieu-Daudé,
	David Gibson

On Tue, Sep 17, 2019 at 11:33 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
>
> Cleber Rosa <crosa@redhat.com> writes:
>
> > On Mon, Sep 16, 2019 at 01:59:22PM -0400, Cleber Rosa wrote:
> >> On Sun, Sep 15, 2019 at 11:19:36PM +0200, Philippe Mathieu-Daudé wrote:
> >> > User case from:
> >> > https://tyom.blogspot.com/2019/04/aixprep-under-qemu-how-to.html
> >> >
> >> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> >> > ---
> >> >  tests/acceptance/ppc_prep_40p.py | 21 +++++++++++++++++++++
> >> >  1 file changed, 21 insertions(+)
> >> >
> >> > diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
> >> > index 53f2d2ecf0..a0eac40d9f 100644
> >> > --- a/tests/acceptance/ppc_prep_40p.py
> >> > +++ b/tests/acceptance/ppc_prep_40p.py
> >> > @@ -61,3 +61,24 @@ class IbmPrep40pMachine(Test):
> >> >          os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
> >> >          self.wait_for_console_pattern(os_banner)
> >> >          self.wait_for_console_pattern('Model: IBM PPS Model 6015')
> >> > +
> >> > +    def test_openfirmware(self):
> >> > +        """
> >> > +        :avocado: tags=arch:ppc
> >> > +        :avocado: tags=machine:40p
> >> > +        """
> >> > +        bios_url = ('https://github.com/artyom-tarasenko/openfirmware/'
> >> > +                    'releases/download/40p-20190413/q40pofw-serial.rom')
> >> > +        bios_hash = '880c80172ea5b2247c0ac2a8bf36bbe385192c72'
> >> > +        bios_path = self.fetch_asset(bios_url, asset_hash=bios_hash)
> >> > +
> >> > +        self.vm.set_machine('40p')
> >> > +        self.vm.set_console()
> >> > +        self.vm.add_args('-bios', bios_path)
> >> > +
> >> > +        self.vm.launch()
> >> > +        self.wait_for_console_pattern('QEMU PReP/40p')
> >> > +        fw_banner = 'Open Firmware, built  April 13, 2019 09:29:23'
> >> > +        self.wait_for_console_pattern(fw_banner)
> >> > +        prompt_msg = 'Type any key to interrupt automatic startup'
> >> > +        self.wait_for_console_pattern(prompt_msg)
> >> > --
> >> > 2.20.1
> >> >
> >>
> >> Tested-by: Cleber Rosa <crosa@redhat.com>
> >> Reviewed-by: Cleber Rosa <crosa@redhat.com>
> >
> > Actually, I'm seeing random but consistent failures.  I've tracked
> > it down to the 'Open Firmware, built  April 13, 2019 09:29:23'.  Out
> > of 100 executions I got 27 failures, with that line logged as:
> >
> >   2019-09-16 14:44:54,540 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:45:00,762 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:45:06,575 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:45:12,859 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:45:18,707 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:45:21,876 ppc_prep_40p     L0033 DEBUG| en Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:45:28,054 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:45:31,163 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:45:34,291 ppc_prep_40p     L0033 DEBUG| en Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:45:57,719 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:46:03,610 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:46:06,795 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:46:17,087 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:46:21,534 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:46:24,694 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:46:38,076 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:46:49,863 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:46:54,435 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:47:00,672 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:47:03,834 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:47:06,852 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:47:14,276 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:47:17,380 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:47:34,749 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:47:39,217 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:47:43,750 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >   2019-09-16 14:48:04,003 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
> >
> > Given that we're not seeing this behavior in other target/marchine
> > tests, my first impression is that this is what's being produced
> > by QEMU, and not what's being badly captured by the Avocado and/or
> > the test code.
>
> Is the DEBUG line meant to show everything that avocado saw? I guess we
> could have a bug in the serial port emulation causing characters to be
> dropped?
>

FWIW back in April I launched QEMU really a lot and never saw a broken banner.
Either it's Avocado, or a regression. Is it possible to see the
complete serial log?

-- 
Regards,
Artyom Tarasenko

SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS on the PReP/40p
  2019-09-17  9:31     ` Alex Bennée
@ 2019-09-17  9:44       ` Philippe Mathieu-Daudé
  2019-09-17  9:55         ` Artyom Tarasenko
  0 siblings, 1 reply; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-17  9:44 UTC (permalink / raw)
  To: Alex Bennée, Cleber Rosa
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Markus Armbruster,
	Philippe Mathieu-Daudé,
	qemu-devel, Kamil Rytarowski, qemu-ppc, Hervé Poussineau,
	Artyom Tarasenko, David Gibson

On 9/17/19 11:31 AM, Alex Bennée wrote:
> Cleber Rosa <crosa@redhat.com> writes:
>> On Sun, Sep 15, 2019 at 11:19:37PM +0200, Philippe Mathieu-Daudé wrote:
>>> User case from:
>>> https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>> ---
>>>  tests/acceptance/ppc_prep_40p.py | 32 ++++++++++++++++++++++++++++++++
>>>  1 file changed, 32 insertions(+)
>>>
>>> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
>>> index a0eac40d9f..87b5311b89 100644
>>> --- a/tests/acceptance/ppc_prep_40p.py
>>> +++ b/tests/acceptance/ppc_prep_40p.py
>>> @@ -82,3 +82,35 @@ class IbmPrep40pMachine(Test):
>>>          self.wait_for_console_pattern(fw_banner)
>>>          prompt_msg = 'Type any key to interrupt automatic startup'
>>>          self.wait_for_console_pattern(prompt_msg)
>>> +
>>> +    def test_openbios_192m(self):
>>> +        """
>>> +        :avocado: tags=arch:ppc
>>> +        :avocado: tags=machine:40p
>>> +        """
>>> +        self.vm.set_machine('40p')
>>> +        self.vm.set_console()
>>> +        self.vm.add_args('-m', '192')
>>
>> Is 192 a magic number (some kind of limit)?  Or just a value to check
>> against later?
> 
> Just the memory configured for the machine, checked bellow. Or are you
> wondering why 192m and not any other amount?

The machine default is 128MiB. The firmware asks the memory controller
how many SIMMs of 8MiB are inserted. We can run OpenBIOS with 128MiB,
but by specifying a different default in this test, we also test the
memory controller device :)

Since this is not obvious I'll add a comment.

>>> +
>>> +        self.vm.launch()
>>> +        self.wait_for_console_pattern('>> OpenBIOS')
>>> +        self.wait_for_console_pattern('>> Memory: 192M')
>>> +        self.wait_for_console_pattern('>> CPU type PowerPC,604')
>>> +
>>
>> On my testing, this is a very stable test, I'm only getting PASSes.
> <snip>
> 
> --
> Alex Bennée
> 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p
  2019-09-17  9:42         ` Artyom Tarasenko
@ 2019-09-17  9:49           ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-17  9:49 UTC (permalink / raw)
  To: Artyom Tarasenko, Alex Bennée
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Markus Armbruster,
	qemu-devel, Philippe Mathieu-Daudé,
	Kamil Rytarowski, open list:PReP, Cleber Rosa,
	Hervé Poussineau, David Gibson

On 9/17/19 11:42 AM, Artyom Tarasenko wrote:
> On Tue, Sep 17, 2019 at 11:33 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>> Cleber Rosa <crosa@redhat.com> writes:
>>> On Mon, Sep 16, 2019 at 01:59:22PM -0400, Cleber Rosa wrote:
>>>> On Sun, Sep 15, 2019 at 11:19:36PM +0200, Philippe Mathieu-Daudé wrote:
>>>>> User case from:
>>>>> https://tyom.blogspot.com/2019/04/aixprep-under-qemu-how-to.html
>>>>>
>>>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>>>> ---
>>>>>  tests/acceptance/ppc_prep_40p.py | 21 +++++++++++++++++++++
>>>>>  1 file changed, 21 insertions(+)
>>>>>
>>>>> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
>>>>> index 53f2d2ecf0..a0eac40d9f 100644
>>>>> --- a/tests/acceptance/ppc_prep_40p.py
>>>>> +++ b/tests/acceptance/ppc_prep_40p.py
>>>>> @@ -61,3 +61,24 @@ class IbmPrep40pMachine(Test):
>>>>>          os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
>>>>>          self.wait_for_console_pattern(os_banner)
>>>>>          self.wait_for_console_pattern('Model: IBM PPS Model 6015')
>>>>> +
>>>>> +    def test_openfirmware(self):
>>>>> +        """
>>>>> +        :avocado: tags=arch:ppc
>>>>> +        :avocado: tags=machine:40p
>>>>> +        """
>>>>> +        bios_url = ('https://github.com/artyom-tarasenko/openfirmware/'
>>>>> +                    'releases/download/40p-20190413/q40pofw-serial.rom')
>>>>> +        bios_hash = '880c80172ea5b2247c0ac2a8bf36bbe385192c72'
>>>>> +        bios_path = self.fetch_asset(bios_url, asset_hash=bios_hash)
>>>>> +
>>>>> +        self.vm.set_machine('40p')
>>>>> +        self.vm.set_console()
>>>>> +        self.vm.add_args('-bios', bios_path)
>>>>> +
>>>>> +        self.vm.launch()
>>>>> +        self.wait_for_console_pattern('QEMU PReP/40p')
>>>>> +        fw_banner = 'Open Firmware, built  April 13, 2019 09:29:23'
>>>>> +        self.wait_for_console_pattern(fw_banner)
>>>>> +        prompt_msg = 'Type any key to interrupt automatic startup'
>>>>> +        self.wait_for_console_pattern(prompt_msg)
>>>>> --
>>>>> 2.20.1
>>>>>
>>>>
>>>> Tested-by: Cleber Rosa <crosa@redhat.com>
>>>> Reviewed-by: Cleber Rosa <crosa@redhat.com>
>>>
>>> Actually, I'm seeing random but consistent failures.  I've tracked
>>> it down to the 'Open Firmware, built  April 13, 2019 09:29:23'.  Out
>>> of 100 executions I got 27 failures, with that line logged as:
>>>
>>>   2019-09-16 14:44:54,540 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:45:00,762 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:45:06,575 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:45:12,859 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:45:18,707 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:45:21,876 ppc_prep_40p     L0033 DEBUG| en Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:45:28,054 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:45:31,163 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:45:34,291 ppc_prep_40p     L0033 DEBUG| en Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:45:57,719 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:46:03,610 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:46:06,795 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:46:17,087 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:46:21,534 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:46:24,694 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:46:38,076 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:46:49,863 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:46:54,435 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:47:00,672 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:47:03,834 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:47:06,852 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:47:14,276 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:47:17,380 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:47:34,749 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:47:39,217 ppc_prep_40p     L0033 DEBUG| n Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:47:43,750 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>   2019-09-16 14:48:04,003 ppc_prep_40p     L0033 DEBUG| Firmware, built  April 13, 2019 09:29:23
>>>
>>> Given that we're not seeing this behavior in other target/marchine
>>> tests, my first impression is that this is what's being produced
>>> by QEMU, and not what's being badly captured by the Avocado and/or
>>> the test code.
>>
>> Is the DEBUG line meant to show everything that avocado saw? I guess we
>> could have a bug in the serial port emulation causing characters to be
>> dropped?
> 
> FWIW back in April I launched QEMU really a lot and never saw a broken banner.
> Either it's Avocado, or a regression. Is it possible to see the
> complete serial log?

I never saw this either.

Around that time (April) we had some problem with VM/Avocado using
chardev devices with Python, Cleber/Alex do you know if this is now fixed?

Meanwhile I'll investigate Cleber's failure (what are your ./configure
options and Avocado version used?)

Thanks,

Phil.


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS on the PReP/40p
  2019-09-17  9:44       ` Philippe Mathieu-Daudé
@ 2019-09-17  9:55         ` Artyom Tarasenko
  0 siblings, 0 replies; 36+ messages in thread
From: Artyom Tarasenko @ 2019-09-17  9:55 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, Markus Armbruster,
	qemu-devel, Philippe Mathieu-Daudé,
	Kamil Rytarowski, open list:PReP, Cleber Rosa,
	Hervé Poussineau, Alex Bennée, David Gibson

On Tue, Sep 17, 2019 at 11:44 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> On 9/17/19 11:31 AM, Alex Bennée wrote:
> > Cleber Rosa <crosa@redhat.com> writes:
> >> On Sun, Sep 15, 2019 at 11:19:37PM +0200, Philippe Mathieu-Daudé wrote:
> >>> User case from:
> >>> https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
> >>>
> >>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> >>> ---
> >>>  tests/acceptance/ppc_prep_40p.py | 32 ++++++++++++++++++++++++++++++++
> >>>  1 file changed, 32 insertions(+)
> >>>
> >>> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
> >>> index a0eac40d9f..87b5311b89 100644
> >>> --- a/tests/acceptance/ppc_prep_40p.py
> >>> +++ b/tests/acceptance/ppc_prep_40p.py
> >>> @@ -82,3 +82,35 @@ class IbmPrep40pMachine(Test):
> >>>          self.wait_for_console_pattern(fw_banner)
> >>>          prompt_msg = 'Type any key to interrupt automatic startup'
> >>>          self.wait_for_console_pattern(prompt_msg)
> >>> +
> >>> +    def test_openbios_192m(self):
> >>> +        """
> >>> +        :avocado: tags=arch:ppc
> >>> +        :avocado: tags=machine:40p
> >>> +        """
> >>> +        self.vm.set_machine('40p')
> >>> +        self.vm.set_console()
> >>> +        self.vm.add_args('-m', '192')
> >>
> >> Is 192 a magic number (some kind of limit)?  Or just a value to check
> >> against later?
> >
> > Just the memory configured for the machine, checked bellow. Or are you
> > wondering why 192m and not any other amount?
>
> The machine default is 128MiB. The firmware asks the memory controller
> how many SIMMs of 8MiB are inserted. We can run OpenBIOS with 128MiB,
> but by specifying a different default in this test, we also test the
> memory controller device :)
>
> Since this is not obvious I'll add a comment.

Are you sure OpenBIOS does it? Doesn't it get the info from the qemu fw device?
At least when making OFW I haven't found a way to the info from the
memory controller. I think it's not implemented. Or at least wasn't
back then.
And since I wanted to be compatible with the real hw, which doesn't
have a fw device, I just kept the hardcoded value in OFW.
If it's in the MC meanwhile, I can add the check to OFW as well.

> >>> +
> >>> +        self.vm.launch()
> >>> +        self.wait_for_console_pattern('>> OpenBIOS')
> >>> +        self.wait_for_console_pattern('>> Memory: 192M')
> >>> +        self.wait_for_console_pattern('>> CPU type PowerPC,604')
> >>> +
> >>
> >> On my testing, this is a very stable test, I'm only getting PASSes.
> > <snip>
> >
> > --
> > Alex Bennée
> >



-- 
Regards,
Artyom Tarasenko

SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine
  2019-09-17  2:19         ` [Qemu-devel] [Qemu-ppc] " David Gibson
@ 2019-09-17 11:40           ` David Gibson
  2019-09-18 11:51             ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 36+ messages in thread
From: David Gibson @ 2019-09-17 11:40 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, qemu-devel,
	Markus Armbruster, Kamil Rytarowski, qemu-ppc, Cleber Rosa,
	Hervé Poussineau, Alex Bennée, Artyom Tarasenko,
	Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 3378 bytes --]

On Tue, Sep 17, 2019 at 12:19:52PM +1000, David Gibson wrote:
> On Mon, Sep 16, 2019 at 11:56:06AM +0200, Philippe Mathieu-Daudé wrote:
> > On 9/16/19 11:52 AM, Alex Bennée wrote:
> > > 
> > > Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> > > 
> > >> Hi David,
> > >>
> > >> On 9/16/19 2:42 AM, David Gibson wrote:
> > >>> On Sun, Sep 15, 2019 at 11:19:34PM +0200, Philippe Mathieu-Daudé wrote:
> > >>>> Quick tests worth to avoid regressions with the 40p machine.
> > >>>> idea from the "Maintainers, please tell us how to boot your machines"
> > >>>> thread:
> > >>>> https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg04177.html
> > >>>>
> > >>>> v2: Split Travis job, added Hervé R-b tag
> > >>>> v1: https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg05896.html
> > >>>>
> > >>>> Regards,
> > >>>>
> > >>>> Phil.
> > >>>
> > >>> I'm guessing you're expecting these to go in via the testing tree, in
> > >>> which case
> > >>>
> > >>> Acked-by: David Gibson <david@gibson.dropbear.id.au>
> > >>
> > >> Thanks, appreciated :)
> > >>
> > >>> Or do you want me to take them via the ppc tree?
> > >>
> > >> I think the 'testing tree' should focus on the CI/testing
> > >> infrastructure, while each subsystem maintainers should care about the
> > >> tests covering their subsystem (the testing tree maintainers might not
> > >> have the required knowledge to be sure a test is correctly implemented).
> > >>
> > >> In this particular case I assume you don't have much knowledge of that
> > >> PPC machine, which is a hobbyist one, but since you are the PPC
> > >> maintainer, I'd rather see this going via your tree :)
> > >>
> > >> Alex/Cleber/Eduardo, any comment on this position?
> > > 
> > > Once we have a .travis.yml I'm happy with it can go in via another tree
> > > no problem. See other thread....
> > 
> > Good :)
> > 
> > David can take patches 1-5 (I tagged patch 6 as RFC but messed something
> > with git-publish and lost it when I sent this series).
> 
> Ok, I've taken patches 1-5 into my ppc-for-4.2 tree.

Hrm.  Judging by both the continued comments on this thread, and the
fact it breaks the travis build, seems like this series needs a little
more work.  I've pulled it out of ppc-for-4.2 again, and I'll wait for
the next spin.

> 
> > 
> > Thanks!
> > 
> > >>>> Philippe Mathieu-Daudé (6):
> > >>>>   tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
> > >>>>   tests/acceptance: Test Open Firmware on the PReP/40p
> > >>>>   tests/acceptance: Test OpenBIOS on the PReP/40p
> > >>>>   tests/acceptance: Test Sandalfoot initrd on the PReP/40p
> > >>>>   .travis.yml: Let the avocado job run the 40p tests
> > >>>>   .travis.yml: Split enterprise vs. hobbyist acceptance test job
> > >>>>
> > >>>>  .travis.yml                      |  18 +++-
> > >>>>  MAINTAINERS                      |   1 +
> > >>>>  tests/acceptance/ppc_prep_40p.py | 150 +++++++++++++++++++++++++++++++
> > >>>>  3 files changed, 167 insertions(+), 2 deletions(-)
> > >>>>  create mode 100644 tests/acceptance/ppc_prep_40p.py
> > >>>>
> > >>>
> > > 
> > > 
> > 
> 



-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine
  2019-09-17 11:40           ` David Gibson
@ 2019-09-18 11:51             ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-18 11:51 UTC (permalink / raw)
  To: David Gibson
  Cc: Fam Zheng, Eduardo Habkost, Thomas Huth, qemu-devel,
	Markus Armbruster, Kamil Rytarowski, qemu-ppc, Cleber Rosa,
	Hervé Poussineau, Alex Bennée, Artyom Tarasenko,
	Philippe Mathieu-Daudé

On 9/17/19 1:40 PM, David Gibson wrote:
> On Tue, Sep 17, 2019 at 12:19:52PM +1000, David Gibson wrote:
>> On Mon, Sep 16, 2019 at 11:56:06AM +0200, Philippe Mathieu-Daudé wrote:
>>> On 9/16/19 11:52 AM, Alex Bennée wrote:
>>>>
>>>> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>>>>
>>>>> Hi David,
>>>>>
>>>>> On 9/16/19 2:42 AM, David Gibson wrote:
>>>>>> On Sun, Sep 15, 2019 at 11:19:34PM +0200, Philippe Mathieu-Daudé wrote:
>>>>>>> Quick tests worth to avoid regressions with the 40p machine.
>>>>>>> idea from the "Maintainers, please tell us how to boot your machines"
>>>>>>> thread:
>>>>>>> https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg04177.html
>>>>>>>
>>>>>>> v2: Split Travis job, added Hervé R-b tag
>>>>>>> v1: https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg05896.html
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Phil.
>>>>>>
>>>>>> I'm guessing you're expecting these to go in via the testing tree, in
>>>>>> which case
>>>>>>
>>>>>> Acked-by: David Gibson <david@gibson.dropbear.id.au>
>>>>>
>>>>> Thanks, appreciated :)
>>>>>
>>>>>> Or do you want me to take them via the ppc tree?
>>>>>
>>>>> I think the 'testing tree' should focus on the CI/testing
>>>>> infrastructure, while each subsystem maintainers should care about the
>>>>> tests covering their subsystem (the testing tree maintainers might not
>>>>> have the required knowledge to be sure a test is correctly implemented).
>>>>>
>>>>> In this particular case I assume you don't have much knowledge of that
>>>>> PPC machine, which is a hobbyist one, but since you are the PPC
>>>>> maintainer, I'd rather see this going via your tree :)
>>>>>
>>>>> Alex/Cleber/Eduardo, any comment on this position?
>>>>
>>>> Once we have a .travis.yml I'm happy with it can go in via another tree
>>>> no problem. See other thread....
>>>
>>> Good :)
>>>
>>> David can take patches 1-5 (I tagged patch 6 as RFC but messed something
>>> with git-publish and lost it when I sent this series).
>>
>> Ok, I've taken patches 1-5 into my ppc-for-4.2 tree.
> 
> Hrm.  Judging by both the continued comments on this thread, and the
> fact it breaks the travis build, seems like this series needs a little
> more work.  I've pulled it out of ppc-for-4.2 again, and I'll wait for
> the next spin.

OK, sorry :|


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] Acceptance tests: refactor wait_for_console_pattern
  2019-09-16 16:40       ` [Qemu-devel] [PATCH] Acceptance tests: refactor wait_for_console_pattern Cleber Rosa
@ 2019-10-17 12:57         ` Philippe Mathieu-Daudé
  2019-10-24 20:01         ` [Qemu-devel] " Wainer dos Santos Moschetta
  1 sibling, 0 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-17 12:57 UTC (permalink / raw)
  To: Cleber Rosa, qemu-devel
  Cc: Aleksandar Rikalo, Aurelien Jarno, Willian Rampazzo,
	Eduardo Habkost, Wainer dos Santos Moschetta

On 9/16/19 6:40 PM, Cleber Rosa wrote:
> The same utility method is already present in two different test
> files, so let's consolidate it into a single utility function.
> 
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>   tests/acceptance/avocado_qemu/__init__.py | 26 +++++++++++++
>   tests/acceptance/boot_linux_console.py    | 47 +++++++----------------
>   tests/acceptance/linux_ssh_mips_malta.py  | 18 ++-------
>   3 files changed, 42 insertions(+), 49 deletions(-)
> 
> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> index bd41e0443c..a0fe16e47f 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -8,6 +8,7 @@
>   # 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 logging
>   import os
>   import sys
>   import uuid
> @@ -53,6 +54,31 @@ def pick_default_qemu_bin(arch=None):
>           return qemu_bin_from_src_dir_path
>   
>   
> +def wait_for_console_pattern(test, success_message,
> +                             failure_message='Kernel panic - not syncing'):
> +    """
> +    Waits for messages to appear on the console, while logging the content
> +
> +    :param test: an Avocado test containing a VM that will have its console
> +                 read and probed for a success or failure message
> +    :type test: :class:`avocado_qemu.Test`
> +    :param success_message: if this message appears, test succeeds
> +    :param failure_message: if this message appears, test fails
> +    """
> +    console = test.vm.console_socket.makefile()
> +    console_logger = logging.getLogger('console')
> +    while True:
> +        msg = console.readline().strip()
> +        if not msg:
> +            continue
> +        console_logger.debug(msg)
> +        if success_message in msg:
> +            break
> +        if failure_message in msg:
> +            fail = 'Failure message found in console: %s' % failure_message
> +            test.fail(fail)
> +
> +
>   class Test(avocado.Test):
>       def setUp(self):
>           self._vms = {}
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 8a9a314ab4..9ff2213874 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -9,12 +9,12 @@
>   # later.  See the COPYING file in the top-level directory.
>   
>   import os
> -import logging
>   import lzma
>   import gzip
>   import shutil
>   
>   from avocado_qemu import Test
> +from avocado_qemu import wait_for_console_pattern
>   from avocado.utils import process
>   from avocado.utils import archive
>   
> @@ -29,31 +29,10 @@ class BootLinuxConsole(Test):
>   
>       KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
>   
> -    def wait_for_console_pattern(self, success_message,
> -                                 failure_message='Kernel panic - not syncing'):
> -        """
> -        Waits for messages to appear on the console, while logging the content
> -
> -        :param success_message: if this message appears, test succeeds
> -        :param failure_message: if this message appears, test fails
> -        """
> -        console = self.vm.console_socket.makefile()
> -        console_logger = logging.getLogger('console')
> -        while True:
> -            msg = console.readline().strip()
> -            if not msg:
> -                continue
> -            console_logger.debug(msg)
> -            if success_message in msg:
> -                break
> -            if failure_message in msg:
> -                fail = 'Failure message found in console: %s' % failure_message
> -                self.fail(fail)
> -
>       def exec_command_and_wait_for_pattern(self, command, success_message):
>           command += '\n'
>           self.vm.console_socket.sendall(command.encode())
> -        self.wait_for_console_pattern(success_message)
> +        wait_for_console_pattern(self, success_message)
>   
>       def extract_from_deb(self, deb, path):
>           """
> @@ -89,7 +68,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_mips_malta(self):
>           """
> @@ -112,7 +91,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_mips64el_malta(self):
>           """
> @@ -145,7 +124,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_mips_malta_cpio(self):
>           """
> @@ -181,7 +160,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line,
>                            '-no-reboot')
>           self.vm.launch()
> -        self.wait_for_console_pattern('Boot successful.')
> +        wait_for_console_pattern(self, 'Boot successful.')
>   
>           self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
>                                                  'BogoMIPS')
> @@ -208,7 +187,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_mips_malta32el_nanomips_4k(self):
>           """
> @@ -266,7 +245,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_arm_virt(self):
>           """
> @@ -287,7 +266,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_arm_emcraft_sf2(self):
>           """
> @@ -314,7 +293,7 @@ class BootLinuxConsole(Test):
>                            '-drive', 'file=' + spi_path + ',if=mtd,format=raw',
>                            '-no-reboot')
>           self.vm.launch()
> -        self.wait_for_console_pattern('init started: BusyBox')
> +        wait_for_console_pattern(self, 'init started: BusyBox')
>   
>       def test_s390x_s390_ccw_virtio(self):
>           """
> @@ -335,7 +314,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_alpha_clipper(self):
>           """
> @@ -357,7 +336,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_ppc64_pseries(self):
>           """
> @@ -377,4 +356,4 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
> diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/linux_ssh_mips_malta.py
> index 134f10cac3..da7a386117 100644
> --- a/tests/acceptance/linux_ssh_mips_malta.py
> +++ b/tests/acceptance/linux_ssh_mips_malta.py
> @@ -14,6 +14,7 @@ import time
>   
>   from avocado import skipIf
>   from avocado_qemu import Test
> +from avocado_qemu import wait_for_console_pattern
>   from avocado.utils import process
>   from avocado.utils import archive
>   
> @@ -56,19 +57,6 @@ class LinuxSSH(Test):
>           },
>       }
>   
> -    def wait_for_console_pattern(self, success_message,
> -                                 failure_message='Oops'):
> -        console = self.vm.console_socket.makefile()
> -        console_logger = logging.getLogger('console')
> -        while True:
> -            msg = console.readline()
> -            console_logger.debug(msg.strip())
> -            if success_message in msg:
> -                break
> -            if failure_message in msg:
> -                fail = 'Failure message found in console: %s' % failure_message
> -                self.fail(fail)
> -
>       def get_portfwd(self):
>           res = self.vm.command('human-monitor-command',
>                                 command_line='info usernet')
> @@ -135,7 +123,7 @@ class LinuxSSH(Test):
>   
>           self.log.info('VM launched, waiting for sshd')
>           console_pattern = 'Starting OpenBSD Secure Shell server: sshd'
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern, 'Oops')
>           self.log.info('sshd ready')
>   
>           self.ssh_connect('root', 'root', rsa_hostkey_b64=rsa_hostkey_b64)
> @@ -143,7 +131,7 @@ class LinuxSSH(Test):
>       def shutdown_via_ssh(self):
>           self.ssh_command('poweroff')
>           self.ssh_disconnect_vm()
> -        self.wait_for_console_pattern('Power down')
> +        wait_for_console_pattern(self, 'Power down', 'Oops')
>   
>       def run_common_commands(self):
>           stdout, stderr = self.ssh_command('lspci -d 11ab:4620')
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [Qemu-devel] [PATCH] Acceptance tests: refactor wait_for_console_pattern
  2019-09-16 16:40       ` [Qemu-devel] [PATCH] Acceptance tests: refactor wait_for_console_pattern Cleber Rosa
  2019-10-17 12:57         ` Philippe Mathieu-Daudé
@ 2019-10-24 20:01         ` Wainer dos Santos Moschetta
  1 sibling, 0 replies; 36+ messages in thread
From: Wainer dos Santos Moschetta @ 2019-10-24 20:01 UTC (permalink / raw)
  To: Cleber Rosa, qemu-devel
  Cc: Aleksandar Rikalo, Aurelien Jarno, Philippe Mathieu-Daudé,
	Eduardo Habkost, Willian Rampazzo

Hi Cleber,

On 9/16/19 1:40 PM, Cleber Rosa wrote:
> The same utility method is already present in two different test
> files, so let's consolidate it into a single utility function.
>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>   tests/acceptance/avocado_qemu/__init__.py | 26 +++++++++++++
>   tests/acceptance/boot_linux_console.py    | 47 +++++++----------------
>   tests/acceptance/linux_ssh_mips_malta.py  | 18 ++-------
>   3 files changed, 42 insertions(+), 49 deletions(-)
>
> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> index bd41e0443c..a0fe16e47f 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -8,6 +8,7 @@
>   # 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 logging
>   import os
>   import sys
>   import uuid
> @@ -53,6 +54,31 @@ def pick_default_qemu_bin(arch=None):
>           return qemu_bin_from_src_dir_path
>   
>   
> +def wait_for_console_pattern(test, success_message,
> +                             failure_message='Kernel panic - not syncing'):
> +    """
> +    Waits for messages to appear on the console, while logging the content
> +
> +    :param test: an Avocado test containing a VM that will have its console
> +                 read and probed for a success or failure message
> +    :type test: :class:`avocado_qemu.Test`
> +    :param success_message: if this message appears, test succeeds
> +    :param failure_message: if this message appears, test fails
> +    """
> +    console = test.vm.console_socket.makefile()
> +    console_logger = logging.getLogger('console')
> +    while True:
> +        msg = console.readline().strip()
> +        if not msg:
> +            continue
> +        console_logger.debug(msg)
> +        if success_message in msg:
> +            break
> +        if failure_message in msg:
> +            fail = 'Failure message found in console: %s' % failure_message
> +            test.fail(fail)
> +
> +

Note to self: it would be useful if wait_for_console_pattern could 
return the read lines. Example of use: a test case waits the kernel to 
boot - if succeed - then it can check if SMP topology is expected by 
parsing the console lines.

Regardless, this change looks good to me.

Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>


>   class Test(avocado.Test):
>       def setUp(self):
>           self._vms = {}
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 8a9a314ab4..9ff2213874 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -9,12 +9,12 @@
>   # later.  See the COPYING file in the top-level directory.
>   
>   import os
> -import logging
>   import lzma
>   import gzip
>   import shutil
>   
>   from avocado_qemu import Test
> +from avocado_qemu import wait_for_console_pattern
>   from avocado.utils import process
>   from avocado.utils import archive
>   
> @@ -29,31 +29,10 @@ class BootLinuxConsole(Test):
>   
>       KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
>   
> -    def wait_for_console_pattern(self, success_message,
> -                                 failure_message='Kernel panic - not syncing'):
> -        """
> -        Waits for messages to appear on the console, while logging the content
> -
> -        :param success_message: if this message appears, test succeeds
> -        :param failure_message: if this message appears, test fails
> -        """
> -        console = self.vm.console_socket.makefile()
> -        console_logger = logging.getLogger('console')
> -        while True:
> -            msg = console.readline().strip()
> -            if not msg:
> -                continue
> -            console_logger.debug(msg)
> -            if success_message in msg:
> -                break
> -            if failure_message in msg:
> -                fail = 'Failure message found in console: %s' % failure_message
> -                self.fail(fail)
> -
>       def exec_command_and_wait_for_pattern(self, command, success_message):
>           command += '\n'
>           self.vm.console_socket.sendall(command.encode())
> -        self.wait_for_console_pattern(success_message)
> +        wait_for_console_pattern(self, success_message)
>   
>       def extract_from_deb(self, deb, path):
>           """
> @@ -89,7 +68,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_mips_malta(self):
>           """
> @@ -112,7 +91,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_mips64el_malta(self):
>           """
> @@ -145,7 +124,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_mips_malta_cpio(self):
>           """
> @@ -181,7 +160,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line,
>                            '-no-reboot')
>           self.vm.launch()
> -        self.wait_for_console_pattern('Boot successful.')
> +        wait_for_console_pattern(self, 'Boot successful.')
>   
>           self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
>                                                  'BogoMIPS')
> @@ -208,7 +187,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_mips_malta32el_nanomips_4k(self):
>           """
> @@ -266,7 +245,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_arm_virt(self):
>           """
> @@ -287,7 +266,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_arm_emcraft_sf2(self):
>           """
> @@ -314,7 +293,7 @@ class BootLinuxConsole(Test):
>                            '-drive', 'file=' + spi_path + ',if=mtd,format=raw',
>                            '-no-reboot')
>           self.vm.launch()
> -        self.wait_for_console_pattern('init started: BusyBox')
> +        wait_for_console_pattern(self, 'init started: BusyBox')
>   
>       def test_s390x_s390_ccw_virtio(self):
>           """
> @@ -335,7 +314,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_alpha_clipper(self):
>           """
> @@ -357,7 +336,7 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
>   
>       def test_ppc64_pseries(self):
>           """
> @@ -377,4 +356,4 @@ class BootLinuxConsole(Test):
>                            '-append', kernel_command_line)
>           self.vm.launch()
>           console_pattern = 'Kernel command line: %s' % kernel_command_line
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern)
> diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/linux_ssh_mips_malta.py
> index 134f10cac3..da7a386117 100644
> --- a/tests/acceptance/linux_ssh_mips_malta.py
> +++ b/tests/acceptance/linux_ssh_mips_malta.py
> @@ -14,6 +14,7 @@ import time
>   
>   from avocado import skipIf
>   from avocado_qemu import Test
> +from avocado_qemu import wait_for_console_pattern
>   from avocado.utils import process
>   from avocado.utils import archive
>   
> @@ -56,19 +57,6 @@ class LinuxSSH(Test):
>           },
>       }
>   
> -    def wait_for_console_pattern(self, success_message,
> -                                 failure_message='Oops'):
> -        console = self.vm.console_socket.makefile()
> -        console_logger = logging.getLogger('console')
> -        while True:
> -            msg = console.readline()
> -            console_logger.debug(msg.strip())
> -            if success_message in msg:
> -                break
> -            if failure_message in msg:
> -                fail = 'Failure message found in console: %s' % failure_message
> -                self.fail(fail)
> -
>       def get_portfwd(self):
>           res = self.vm.command('human-monitor-command',
>                                 command_line='info usernet')
> @@ -135,7 +123,7 @@ class LinuxSSH(Test):
>   
>           self.log.info('VM launched, waiting for sshd')
>           console_pattern = 'Starting OpenBSD Secure Shell server: sshd'
> -        self.wait_for_console_pattern(console_pattern)
> +        wait_for_console_pattern(self, console_pattern, 'Oops')
>           self.log.info('sshd ready')
>   
>           self.ssh_connect('root', 'root', rsa_hostkey_b64=rsa_hostkey_b64)
> @@ -143,7 +131,7 @@ class LinuxSSH(Test):
>       def shutdown_via_ssh(self):
>           self.ssh_command('poweroff')
>           self.ssh_disconnect_vm()
> -        self.wait_for_console_pattern('Power down')
> +        wait_for_console_pattern(self, 'Power down', 'Oops')
>   
>       def run_common_commands(self):
>           stdout, stderr = self.ssh_command('lspci -d 11ab:4620')



^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2019-10-24 20:02 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-15 21:19 [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine Philippe Mathieu-Daudé
2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 1/6] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p Philippe Mathieu-Daudé
2019-09-16  9:44   ` Artyom Tarasenko
2019-09-16 16:08   ` Cleber Rosa
2019-09-16 16:19     ` Philippe Mathieu-Daudé
2019-09-16 16:40       ` [Qemu-devel] [PATCH] Acceptance tests: refactor wait_for_console_pattern Cleber Rosa
2019-10-17 12:57         ` Philippe Mathieu-Daudé
2019-10-24 20:01         ` [Qemu-devel] " Wainer dos Santos Moschetta
2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 2/6] tests/acceptance: Test Open Firmware on the PReP/40p Philippe Mathieu-Daudé
2019-09-16  9:36   ` Artyom Tarasenko
2019-09-16 17:59   ` Cleber Rosa
2019-09-16 18:55     ` Cleber Rosa
2019-09-17  9:33       ` Alex Bennée
2019-09-17  9:42         ` Artyom Tarasenko
2019-09-17  9:49           ` Philippe Mathieu-Daudé
2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 3/6] tests/acceptance: Test OpenBIOS " Philippe Mathieu-Daudé
2019-09-16 19:32   ` Cleber Rosa
2019-09-17  9:31     ` Alex Bennée
2019-09-17  9:44       ` Philippe Mathieu-Daudé
2019-09-17  9:55         ` Artyom Tarasenko
2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 4/6] tests/acceptance: Test Sandalfoot initrd " Philippe Mathieu-Daudé
2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 5/6] .travis.yml: Let the avocado job run the 40p tests Philippe Mathieu-Daudé
2019-09-16 10:01   ` Alex Bennée
2019-09-15 21:19 ` [Qemu-devel] [PATCH v2 6/6] .travis.yml: Split enterprise vs. hobbyist acceptance test job Philippe Mathieu-Daudé
2019-09-16  8:43   ` Alex Bennée
2019-09-16  9:23     ` Philippe Mathieu-Daudé
2019-09-16  9:46       ` Alex Bennée
2019-09-16 10:00         ` Philippe Mathieu-Daudé
2019-09-16  0:42 ` [Qemu-devel] [PATCH v2 0/6] tests/acceptance: Add tests for the PReP/40p machine David Gibson
2019-09-16  9:28   ` Philippe Mathieu-Daudé
2019-09-16  9:52     ` Alex Bennée
2019-09-16  9:56       ` Philippe Mathieu-Daudé
2019-09-17  2:19         ` [Qemu-devel] [Qemu-ppc] " David Gibson
2019-09-17 11:40           ` David Gibson
2019-09-18 11:51             ` Philippe Mathieu-Daudé
2019-09-16 16:14     ` [Qemu-devel] " Eduardo Habkost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).