All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/26] tests/acceptance: Queue for 4.2
@ 2019-10-28  7:34 Philippe Mathieu-Daudé
  2019-10-28  7:34 ` [PATCH 01/26] python/qemu/machine: Allow to use other serial consoles than default Philippe Mathieu-Daudé
                   ` (27 more replies)
  0 siblings, 28 replies; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Kamil Rytarowski,
	Wainer dos Santos Moschetta, Cleber Rosa, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

Hi,

These Avocado-related patches were posted some weeks/months ago
but got lost in the mailing list traffic.

Please review,

Phil.

Cleber Rosa (1):
  Acceptance tests: refactor wait_for_console_pattern

Philippe Mathieu-Daudé (25):
  python/qemu/machine: Allow to use other serial consoles than default
  tests/acceptance: Fixe wait_for_console_pattern() hangs
  tests/acceptance: Send <carriage return> on serial lines
  tests/acceptance: Refactor exec_command_and_wait_for_pattern()
  tests/acceptance: Rename avocado_qemu.Test as MachineTest
  tests/acceptance: Make pick_default_qemu_bin() more generic
  tests/acceptance: Introduce LinuxUserTest base class
  tests/acceptance: Add bFLT loader linux-user test
  tests/acceptance: Add test that boots the HelenOS microkernel on Leon3
  tests/acceptance: Add test that boots Linux up to BusyBox on Leon3
  .travis.yml: Let the avocado job run the Leon3 test
  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
  tests/boot_console: Test booting HP-UX firmware upgrade
  tests/boot_linux_console: Use Avocado archive::gzip_uncompress()
  tests/boot_linux_console: Add a test for the Raspberry Pi 2
  tests/boot_linux_console: Test the raspi2 UART1 (16550 based)
  tests/boot_linux_console: Boot Linux and run few commands on raspi3
  tests/boot_linux_console: Test SDHCI and termal sensor on raspi3
  tests/boot_linux_console: Add initrd test for the Exynos4210
  tests/boot_linux_console: Add sdcard test for the Exynos4210
  tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpu

 .travis.yml                               |   2 +-
 MAINTAINERS                               |   2 +
 docs/devel/testing.rst                    |   8 +-
 python/qemu/machine.py                    |   9 +-
 tests/acceptance/avocado_qemu/__init__.py |  71 ++++-
 tests/acceptance/boot_linux_console.py    | 348 +++++++++++++++++++---
 tests/acceptance/cpu_queries.py           |   4 +-
 tests/acceptance/empty_cpu_model.py       |   4 +-
 tests/acceptance/linux_initrd.py          |   4 +-
 tests/acceptance/linux_ssh_mips_malta.py  |  22 +-
 tests/acceptance/load_bflt.py             |  52 ++++
 tests/acceptance/machine_sparc_leon3.py   |  65 ++++
 tests/acceptance/migration.py             |   4 +-
 tests/acceptance/ppc_prep_40p.py          | 134 +++++++++
 tests/acceptance/version.py               |   4 +-
 tests/acceptance/virtio_version.py        |   4 +-
 tests/acceptance/vnc.py                   |   4 +-
 17 files changed, 660 insertions(+), 81 deletions(-)
 create mode 100644 tests/acceptance/load_bflt.py
 create mode 100644 tests/acceptance/machine_sparc_leon3.py
 create mode 100644 tests/acceptance/ppc_prep_40p.py

-- 
2.21.0



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

* [PATCH 01/26] python/qemu/machine: Allow to use other serial consoles than default
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 14:51   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 02/26] Acceptance tests: refactor wait_for_console_pattern Philippe Mathieu-Daudé
                   ` (26 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

Currently the QEMU Python module limits the QEMUMachine class to
use the first serial console.

Some machines/guest might use another console than the first one as
the 'boot console'. For example the Raspberry Pi uses the second
(AUX) console.

To be able to use the Nth console as default, we simply need to
connect all the N - 1 consoles to the null chardev.

Add an index argument, so we can use a specific serial console as
default.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v2:
- renamed 'console_index', added docstring (Cleber)
- reworded description (pm215)
---
 python/qemu/machine.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 128a3d1dc2..6fa68fa35a 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -235,6 +235,8 @@ class QEMUMachine(object):
                 '-display', 'none', '-vga', 'none']
         if self._machine is not None:
             args.extend(['-machine', self._machine])
+        for i in range(self._console_index):
+            args.extend(['-serial', 'null'])
         if self._console_set:
             self._console_address = os.path.join(self._temp_dir,
                                                  self._name + "-console.sock")
@@ -495,7 +497,7 @@ class QEMUMachine(object):
         """
         self._machine = machine_type
 
-    def set_console(self, device_type=None):
+    def set_console(self, device_type=None, console_index=0):
         """
         Sets the device type for a console device
 
@@ -516,9 +518,14 @@ class QEMUMachine(object):
                             chardev:console" command line argument will
                             be used instead, resorting to the machine's
                             default device type.
+        @param console_index: the index of the console device to use.
+                              If not zero, the command line will create
+                              'index - 1' consoles and connect them to
+                              the 'null' backing character device.
         """
         self._console_set = True
         self._console_device_type = device_type
+        self._console_index = console_index
 
     @property
     def console_socket(self):
-- 
2.21.0



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

* [PATCH 02/26] Acceptance tests: refactor wait_for_console_pattern
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
  2019-10-28  7:34 ` [PATCH 01/26] python/qemu/machine: Allow to use other serial consoles than default Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28  7:58   ` Aleksandar Markovic
  2019-10-28 15:18   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 03/26] tests/acceptance: Fixe wait_for_console_pattern() hangs Philippe Mathieu-Daudé
                   ` (25 subsequent siblings)
  27 siblings, 2 replies; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Kamil Rytarowski,
	Wainer dos Santos Moschetta, Cleber Rosa, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno, David Gibson

From: Cleber Rosa <crosa@redhat.com>

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>
Message-Id: <20190916164011.7653-1-crosa@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[PMD: failure_message is optional]
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 25 +++++++++++++++++++++
 tests/acceptance/boot_linux_console.py    | 27 +++++------------------
 tests/acceptance/linux_ssh_mips_malta.py  | 18 +++------------
 3 files changed, 33 insertions(+), 37 deletions(-)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index bd41e0443c..e3101cba30 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,30 @@ def pick_default_qemu_bin(arch=None):
         return qemu_bin_from_src_dir_path
 
 
+def wait_for_console_pattern(test, success_message, failure_message=None):
+    """
+    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 and 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..8897e0c253 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,14 @@ 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 wait_for_console_pattern(self, success_message):
+        wait_for_console_pattern(self, success_message,
+                                 failure_message='Kernel panic - not syncing')
 
     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):
         """
diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/linux_ssh_mips_malta.py
index aa12001942..fc13f9e4d4 100644
--- a/tests/acceptance/linux_ssh_mips_malta.py
+++ b/tests/acceptance/linux_ssh_mips_malta.py
@@ -13,6 +13,7 @@ import time
 
 from avocado import skipUnless
 from avocado_qemu import Test
+from avocado_qemu import wait_for_console_pattern
 from avocado.utils import process
 from avocado.utils import archive
 from avocado.utils import ssh
@@ -69,19 +70,6 @@ class LinuxSSH(Test):
     def setUp(self):
         super(LinuxSSH, self).setUp()
 
-    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')
@@ -137,7 +125,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')
@@ -145,7 +133,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 ssh_command_output_contains(self, cmd, exp):
         stdout, _ = self.ssh_command(cmd)
-- 
2.21.0



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

* [PATCH 03/26] tests/acceptance: Fixe wait_for_console_pattern() hangs
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
  2019-10-28  7:34 ` [PATCH 01/26] python/qemu/machine: Allow to use other serial consoles than default Philippe Mathieu-Daudé
  2019-10-28  7:34 ` [PATCH 02/26] Acceptance tests: refactor wait_for_console_pattern Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28  8:01   ` Aleksandar Markovic
  2019-10-28 15:24   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 04/26] tests/acceptance: Send <carriage return> on serial lines Philippe Mathieu-Daudé
                   ` (24 subsequent siblings)
  27 siblings, 2 replies; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Kamil Rytarowski,
	Wainer dos Santos Moschetta, Cleber Rosa, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

Because of a possible deadlock (QEMU waiting for the socket to
become writable) let's close the console socket as soon as we
stop to use it.

Suggested-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index e3101cba30..a0450e5263 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -74,6 +74,7 @@ def wait_for_console_pattern(test, success_message, failure_message=None):
         if success_message in msg:
             break
         if failure_message and failure_message in msg:
+            console.close()
             fail = 'Failure message found in console: %s' % failure_message
             test.fail(fail)
 
-- 
2.21.0



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

* [PATCH 04/26] tests/acceptance: Send <carriage return> on serial lines
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 03/26] tests/acceptance: Fixe wait_for_console_pattern() hangs Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 15:36   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 05/26] tests/acceptance: Refactor exec_command_and_wait_for_pattern() Philippe Mathieu-Daudé
                   ` (23 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

Some firmwares don't parse the <Newline> control character and
expect a <carriage return>.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
since previous: do not send NewLine
---
 tests/acceptance/boot_linux_console.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 8897e0c253..f9b77af359 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -34,7 +34,7 @@ class BootLinuxConsole(Test):
                                  failure_message='Kernel panic - not syncing')
 
     def exec_command_and_wait_for_pattern(self, command, success_message):
-        command += '\n'
+        command += '\r'
         self.vm.console_socket.sendall(command.encode())
         wait_for_console_pattern(self, success_message)
 
-- 
2.21.0



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

* [PATCH 05/26] tests/acceptance: Refactor exec_command_and_wait_for_pattern()
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 04/26] tests/acceptance: Send <carriage return> on serial lines Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 15:50   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 06/26] tests/acceptance: Rename avocado_qemu.Test as MachineTest Philippe Mathieu-Daudé
                   ` (22 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Kamil Rytarowski,
	Wainer dos Santos Moschetta, Cleber Rosa, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

Refactor the exec_command_and_wait_for_pattern() utility method
so we can reuse it in other files.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
v2: fix self -> test, failure_message is optional, added doc
v3: reword because after rebasing only 1 file has to be modified
---
 tests/acceptance/avocado_qemu/__init__.py | 19 +++++++++++++++++++
 tests/acceptance/boot_linux_console.py    | 18 +++++++-----------
 2 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index a0450e5263..bdece76723 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -79,6 +79,25 @@ def wait_for_console_pattern(test, success_message, failure_message=None):
             test.fail(fail)
 
 
+def exec_command_and_wait_for_pattern(test, command,
+                                      success_message, failure_message=None):
+    """
+    Send a command to a console (appending CRLF characters), then wait
+    for success_message to appear on the console, while logging the.
+    content. Mark the test as failed if failure_message is found instead.
+
+    :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 command: the command to send
+    :param success_message: if this message appears, test succeeds
+    :param failure_message: if this message appears, test fails
+    """
+    command += '\r'
+    test.vm.console_socket.sendall(command.encode())
+    wait_for_console_pattern(test, success_message, failure_message)
+
+
 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 f9b77af359..4b419b0559 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -14,6 +14,7 @@ import gzip
 import shutil
 
 from avocado_qemu import Test
+from avocado_qemu import exec_command_and_wait_for_pattern
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import process
 from avocado.utils import archive
@@ -33,11 +34,6 @@ class BootLinuxConsole(Test):
         wait_for_console_pattern(self, success_message,
                                  failure_message='Kernel panic - not syncing')
 
-    def exec_command_and_wait_for_pattern(self, command, success_message):
-        command += '\r'
-        self.vm.console_socket.sendall(command.encode())
-        wait_for_console_pattern(self, success_message)
-
     def extract_from_deb(self, deb, path):
         """
         Extracts a file from a deb package into the test workdir
@@ -166,12 +162,12 @@ class BootLinuxConsole(Test):
         self.vm.launch()
         self.wait_for_console_pattern('Boot successful.')
 
-        self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
-                                               'BogoMIPS')
-        self.exec_command_and_wait_for_pattern('uname -a',
-                                               'Debian')
-        self.exec_command_and_wait_for_pattern('reboot',
-                                               'reboot: Restarting system')
+        exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
+                                                'BogoMIPS')
+        exec_command_and_wait_for_pattern(self, 'uname -a',
+                                                'Debian')
+        exec_command_and_wait_for_pattern(self, 'reboot',
+                                                'reboot: Restarting system')
 
     def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash):
         kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
-- 
2.21.0



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

* [PATCH 06/26] tests/acceptance: Rename avocado_qemu.Test as MachineTest
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 05/26] tests/acceptance: Refactor exec_command_and_wait_for_pattern() Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-11-19 13:52   ` Wainer dos Santos Moschetta
  2019-10-28  7:34 ` [PATCH 07/26] tests/acceptance: Make pick_default_qemu_bin() more generic Philippe Mathieu-Daudé
                   ` (21 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Kamil Rytarowski,
	Wainer dos Santos Moschetta, Cleber Rosa, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

This class is used to test QEMU machines, rename it as MachineTest.
This will allow us to add a UserTest class for qemu-user tests.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 docs/devel/testing.rst                    | 8 ++++----
 tests/acceptance/avocado_qemu/__init__.py | 7 ++++++-
 tests/acceptance/boot_linux_console.py    | 4 ++--
 tests/acceptance/cpu_queries.py           | 4 ++--
 tests/acceptance/empty_cpu_model.py       | 4 ++--
 tests/acceptance/linux_initrd.py          | 4 ++--
 tests/acceptance/linux_ssh_mips_malta.py  | 4 ++--
 tests/acceptance/migration.py             | 4 ++--
 tests/acceptance/version.py               | 4 ++--
 tests/acceptance/virtio_version.py        | 4 ++--
 tests/acceptance/vnc.py                   | 4 ++--
 11 files changed, 28 insertions(+), 23 deletions(-)

diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index 8e981e062d..d9fab83458 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -601,7 +601,7 @@ class.  Here's a simple usage example:
   from avocado_qemu import Test
 
 
-  class Version(Test):
+  class Version(MachineTest):
       """
       :avocado: tags=quick
       """
@@ -625,7 +625,7 @@ in the current directory, tagged as "quick", run:
 
   avocado run -t quick .
 
-The ``avocado_qemu.Test`` base test class
+The ``avocado_qemu.MachineTest`` base test class
 -----------------------------------------
 
 The ``avocado_qemu.Test`` class has a number of characteristics that
@@ -646,10 +646,10 @@ and hypothetical example follows:
 
 .. code::
 
-  from avocado_qemu import Test
+  from avocado_qemu import MachineTest
 
 
-  class MultipleMachines(Test):
+  class MultipleMachines(MachineTest):
       """
       :avocado: enable
       """
diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index bdece76723..a2cc3d689b 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -100,7 +100,6 @@ def exec_command_and_wait_for_pattern(test, command,
 
 class Test(avocado.Test):
     def setUp(self):
-        self._vms = {}
         arches = self.tags.get('arch', [])
         if len(arches) == 1:
             arch = arches.pop()
@@ -113,6 +112,12 @@ class Test(avocado.Test):
         if self.qemu_bin is None:
             self.cancel("No QEMU binary defined or found in the source tree")
 
+
+class MachineTest(Test):
+    def setUp(self):
+        self._vms = {}
+        super().setUp()
+
     def _new_vm(self, *args):
         vm = QEMUMachine(self.qemu_bin)
         if args:
diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 4b419b0559..f94dc4bbca 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -13,14 +13,14 @@ import lzma
 import gzip
 import shutil
 
-from avocado_qemu import Test
+from avocado_qemu import MachineTest
 from avocado_qemu import exec_command_and_wait_for_pattern
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import process
 from avocado.utils import archive
 
 
-class BootLinuxConsole(Test):
+class BootLinuxConsole(MachineTest):
     """
     Boots a Linux kernel and checks that the console is operational and the
     kernel command line is properly passed from QEMU to the kernel
diff --git a/tests/acceptance/cpu_queries.py b/tests/acceptance/cpu_queries.py
index af47d2795a..40df8264cf 100644
--- a/tests/acceptance/cpu_queries.py
+++ b/tests/acceptance/cpu_queries.py
@@ -10,9 +10,9 @@
 
 import logging
 
-from avocado_qemu import Test
+from avocado_qemu import MachineTest
 
-class QueryCPUModelExpansion(Test):
+class QueryCPUModelExpansion(MachineTest):
     """
     Run query-cpu-model-expansion for each CPU model, and validate results
     """
diff --git a/tests/acceptance/empty_cpu_model.py b/tests/acceptance/empty_cpu_model.py
index 3f4f663582..a4e9cc62f8 100644
--- a/tests/acceptance/empty_cpu_model.py
+++ b/tests/acceptance/empty_cpu_model.py
@@ -8,9 +8,9 @@
 # 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 subprocess
-from avocado_qemu import Test
+from avocado_qemu import MachineTest
 
-class EmptyCPUModel(Test):
+class EmptyCPUModel(MachineTest):
     def test(self):
         cmd = [self.qemu_bin, '-S', '-display', 'none', '-machine', 'none', '-cpu', '']
         r = subprocess.run(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
diff --git a/tests/acceptance/linux_initrd.py b/tests/acceptance/linux_initrd.py
index c61d9826a4..e8afb007d0 100644
--- a/tests/acceptance/linux_initrd.py
+++ b/tests/acceptance/linux_initrd.py
@@ -12,10 +12,10 @@ import logging
 import tempfile
 from avocado.utils.process import run
 
-from avocado_qemu import Test
+from avocado_qemu import MachineTest
 
 
-class LinuxInitrd(Test):
+class LinuxInitrd(MachineTest):
     """
     Checks QEMU evaluates correctly the initrd file passed as -initrd option.
 
diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/linux_ssh_mips_malta.py
index fc13f9e4d4..5db64affda 100644
--- a/tests/acceptance/linux_ssh_mips_malta.py
+++ b/tests/acceptance/linux_ssh_mips_malta.py
@@ -12,14 +12,14 @@ import logging
 import time
 
 from avocado import skipUnless
-from avocado_qemu import Test
+from avocado_qemu import MachineTest
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import process
 from avocado.utils import archive
 from avocado.utils import ssh
 
 
-class LinuxSSH(Test):
+class LinuxSSH(MachineTest):
 
     timeout = 150 # Not for 'configure --enable-debug --enable-debug-tcg'
 
diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index a44c1ae58f..3a823c9cc7 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -10,13 +10,13 @@
 # later.  See the COPYING file in the top-level directory.
 
 
-from avocado_qemu import Test
+from avocado_qemu import MachineTest
 
 from avocado.utils import network
 from avocado.utils import wait
 
 
-class Migration(Test):
+class Migration(MachineTest):
 
     timeout = 10
 
diff --git a/tests/acceptance/version.py b/tests/acceptance/version.py
index 67c2192c93..e11661f780 100644
--- a/tests/acceptance/version.py
+++ b/tests/acceptance/version.py
@@ -9,10 +9,10 @@
 # later.  See the COPYING file in the top-level directory.
 
 
-from avocado_qemu import Test
+from avocado_qemu import MachineTest
 
 
-class Version(Test):
+class Version(MachineTest):
     """
     :avocado: tags=quick
     """
diff --git a/tests/acceptance/virtio_version.py b/tests/acceptance/virtio_version.py
index 33593c29dd..ea33363b0f 100644
--- a/tests/acceptance/virtio_version.py
+++ b/tests/acceptance/virtio_version.py
@@ -13,7 +13,7 @@ import os
 
 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
 from qemu.machine import QEMUMachine
-from avocado_qemu import Test
+from avocado_qemu import MachineTest
 
 # Virtio Device IDs:
 VIRTIO_NET = 1
@@ -55,7 +55,7 @@ def get_pci_interfaces(vm, devtype):
     interfaces = ('pci-express-device', 'conventional-pci-device')
     return [i for i in interfaces if devtype_implements(vm, devtype, i)]
 
-class VirtioVersionCheck(Test):
+class VirtioVersionCheck(MachineTest):
     """
     Check if virtio-version-specific device types result in the
     same device tree created by `disable-modern` and
diff --git a/tests/acceptance/vnc.py b/tests/acceptance/vnc.py
index 3f40bc2be1..c2a364d23e 100644
--- a/tests/acceptance/vnc.py
+++ b/tests/acceptance/vnc.py
@@ -8,10 +8,10 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
 
-from avocado_qemu import Test
+from avocado_qemu import MachineTest
 
 
-class Vnc(Test):
+class Vnc(MachineTest):
     """
     :avocado: tags=vnc,quick
     """
-- 
2.21.0



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

* [PATCH 07/26] tests/acceptance: Make pick_default_qemu_bin() more generic
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 06/26] tests/acceptance: Rename avocado_qemu.Test as MachineTest Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28  7:34 ` [PATCH 08/26] tests/acceptance: Introduce LinuxUserTest base class Philippe Mathieu-Daudé
                   ` (20 subsequent siblings)
  27 siblings, 0 replies; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Kamil Rytarowski,
	Wainer dos Santos Moschetta, Cleber Rosa, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

Make pick_default_qemu_bin() generic to find qemu-system or
qemu-user binaries.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index a2cc3d689b..d23681818d 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -24,7 +24,7 @@ def is_readable_executable_file(path):
     return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK)
 
 
-def pick_default_qemu_bin(arch=None):
+def pick_default_qemu_bin(path_fmt, bin_fmt, arch=None):
     """
     Picks the path of a QEMU binary, starting either in the current working
     directory or in the source tree root directory.
@@ -43,8 +43,7 @@ def pick_default_qemu_bin(arch=None):
     # qemu binary path does not match arch for powerpc, handle it
     if 'ppc64le' in arch:
         arch = 'ppc64'
-    qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
-                                          "qemu-system-%s" % arch)
+    qemu_bin_relative_path = os.path.join(path_fmt % arch, bin_fmt % arch)
     if is_readable_executable_file(qemu_bin_relative_path):
         return qemu_bin_relative_path
 
@@ -99,14 +98,15 @@ def exec_command_and_wait_for_pattern(test, command,
 
 
 class Test(avocado.Test):
-    def setUp(self):
+    def base_setUp(self, path_fmt, bin_fmt):
         arches = self.tags.get('arch', [])
         if len(arches) == 1:
             arch = arches.pop()
         else:
             arch = None
         self.arch = self.params.get('arch', default=arch)
-        default_qemu_bin = pick_default_qemu_bin(arch=self.arch)
+        default_qemu_bin = pick_default_qemu_bin(path_fmt, bin_fmt,
+                                                 arch=self.arch)
         self.qemu_bin = self.params.get('qemu_bin',
                                         default=default_qemu_bin)
         if self.qemu_bin is None:
@@ -116,7 +116,7 @@ class Test(avocado.Test):
 class MachineTest(Test):
     def setUp(self):
         self._vms = {}
-        super().setUp()
+        self.base_setUp("%s-softmmu", "qemu-system-%s")
 
     def _new_vm(self, *args):
         vm = QEMUMachine(self.qemu_bin)
-- 
2.21.0



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

* [PATCH 08/26] tests/acceptance: Introduce LinuxUserTest base class
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (6 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 07/26] tests/acceptance: Make pick_default_qemu_bin() more generic Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-11-18 12:16   ` Philippe Mathieu-Daudé
  2019-10-28  7:34 ` [PATCH 09/26] tests/acceptance: Add bFLT loader linux-user test Philippe Mathieu-Daudé
                   ` (19 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Kamil Rytarowski,
	Wainer dos Santos Moschetta, Cleber Rosa, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

Similarly to the MachineTest base class, this class contains
methods common to linux-user tests.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index d23681818d..2611a5146c 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -14,6 +14,7 @@ import sys
 import uuid
 
 import avocado
+from avocado.utils import process
 
 SRC_ROOT_DIR = os.path.join(os.path.dirname(__file__), '..', '..', '..')
 sys.path.append(os.path.join(SRC_ROOT_DIR, 'python'))
@@ -138,3 +139,11 @@ class MachineTest(Test):
     def tearDown(self):
         for vm in self._vms.values():
             vm.shutdown()
+
+
+class LinuxUserTest(Test):
+    def setUp(self):
+        self.base_setUp("%s-linux-user", "qemu-%s")
+
+    def run(self, cmd):
+        return process.run("%s %s" % (self.qemu_bin, cmd))
-- 
2.21.0



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

* [PATCH 09/26] tests/acceptance: Add bFLT loader linux-user test
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (7 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 08/26] tests/acceptance: Introduce LinuxUserTest base class Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28  7:34 ` [PATCH 10/26] tests/acceptance: Add test that boots the HelenOS microkernel on Leon3 Philippe Mathieu-Daudé
                   ` (18 subsequent siblings)
  27 siblings, 0 replies; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

Add a very quick test that runs a busybox binary in bFLT format:

  $ avocado --show=app run tests/acceptance/load_bflt.py
  JOB ID     : db94d5960ce564c50904d666a7e259148c27e88f
  JOB LOG    : ~/avocado/job-results/job-2019-06-25T10.52-db94d59/job.log
   (1/1) tests/acceptance/load_bflt.py:LoadBFLT.test_stm32: PASS (0.15 s)
  RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
  JOB TIME   : 0.54 s

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
This test currently fails on Aarch64 host, see LP#1833668
https://bugs.launchpad.net/qemu/+bug/1833668
---
 tests/acceptance/load_bflt.py | 52 +++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 tests/acceptance/load_bflt.py

diff --git a/tests/acceptance/load_bflt.py b/tests/acceptance/load_bflt.py
new file mode 100644
index 0000000000..fdcaf8ad88
--- /dev/null
+++ b/tests/acceptance/load_bflt.py
@@ -0,0 +1,52 @@
+# Test the bFLT format
+#
+# Copyright (C) 2019 Philippe Mathieu-Daudé <f4bug@amsat.org>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+import bz2
+import subprocess
+
+from avocado_qemu import LinuxUserTest
+
+
+class LoadBFLT(LinuxUserTest):
+
+    def extract_cpio(self, cpio_path):
+        """
+        Extracts a cpio archive into the test workdir
+
+        :param cpio_path: path to the cpio archive
+        """
+        cwd = os.getcwd()
+        os.chdir(self.workdir)
+        with bz2.open(cpio_path, 'rb') as archive_cpio:
+            subprocess.run(['cpio', '-i'], input=archive_cpio.read(),
+                           stderr=subprocess.DEVNULL)
+        os.chdir(cwd)
+
+    def test_stm32(self):
+        """
+        :avocado: tags=arch:arm
+        :avocado: tags=linux_user
+        :avocado: tags=quick
+        """
+        # See https://elinux.org/STM32#User_Space
+        rootfs_url = ('https://elinux.org/images/5/51/'
+                      'Stm32_mini_rootfs.cpio.bz2')
+        rootfs_hash = '9f065e6ba40cce7411ba757f924f30fcc57951e6'
+        rootfs_path_bz2 = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
+        busybox_path = self.workdir + "/bin/busybox"
+
+        self.extract_cpio(rootfs_path_bz2)
+
+        cmd = ''
+        res = self.run("%s %s" % (busybox_path, cmd))
+        ver = 'BusyBox v1.24.0.git (2015-02-03 22:17:13 CET) multi-call binary.'
+        self.assertIn(ver, res.stdout_text)
+
+        cmd = 'uname -a'
+        res = self.run("%s %s" % (busybox_path, cmd))
+        unm = 'armv7l GNU/Linux'
+        self.assertIn(unm, res.stdout_text)
-- 
2.21.0



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

* [PATCH 10/26] tests/acceptance: Add test that boots the HelenOS microkernel on Leon3
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (8 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 09/26] tests/acceptance: Add bFLT loader linux-user test Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 16:38   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 11/26] tests/acceptance: Add test that boots Linux up to BusyBox " Philippe Mathieu-Daudé
                   ` (17 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

Release notes:
http://www.helenos.org/wiki/Download#HelenOS0.6.0

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 MAINTAINERS                             |  1 +
 tests/acceptance/machine_sparc_leon3.py | 37 +++++++++++++++++++++++++
 2 files changed, 38 insertions(+)
 create mode 100644 tests/acceptance/machine_sparc_leon3.py

diff --git a/MAINTAINERS b/MAINTAINERS
index 556ce0bfe3..17ff741c63 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1173,6 +1173,7 @@ S: Maintained
 F: hw/sparc/leon3.c
 F: hw/*/grlib*
 F: include/hw/*/grlib*
+F: tests/acceptance/machine_sparc_leon3.py
 
 S390 Machines
 -------------
diff --git a/tests/acceptance/machine_sparc_leon3.py b/tests/acceptance/machine_sparc_leon3.py
new file mode 100644
index 0000000000..a1394ba8ad
--- /dev/null
+++ b/tests/acceptance/machine_sparc_leon3.py
@@ -0,0 +1,37 @@
+# Functional test that boots a Leon3 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 MachineTest
+
+
+class Leon3Machine(MachineTest):
+
+    timeout = 60
+
+    def test_leon3_helenos_uimage(self):
+        """
+        :avocado: tags=arch:sparc
+        :avocado: tags=machine:leon3
+        :avocado: tags=binfmt:uimage
+        """
+        kernel_url = ('http://www.helenos.org/releases/'
+                      'HelenOS-0.6.0-sparc32-leon3.bin')
+        kernel_hash = 'a88c9cfdb8430c66650e5290a08765f9bf049a30'
+        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+
+        self.vm.set_machine('leon3_generic')
+        self.vm.set_console()
+        self.vm.add_args('-kernel', kernel_path)
+
+        self.vm.launch()
+
+        wait_for_console_pattern(self,'Copyright (c) 2001-2014 HelenOS project')
+        wait_for_console_pattern(self,'Booting the kernel ...')
-- 
2.21.0



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

* [PATCH 11/26] tests/acceptance: Add test that boots Linux up to BusyBox on Leon3
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (9 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 10/26] tests/acceptance: Add test that boots the HelenOS microkernel on Leon3 Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 16:47   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 12/26] .travis.yml: Let the avocado job run the Leon3 test Philippe Mathieu-Daudé
                   ` (16 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

Gaisler provides convenient images:
https://www.gaisler.com/index.php/downloads/linux

HOWTO build:
https://www.gaisler.com/index.php/products/operating-systems/linux

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

diff --git a/tests/acceptance/machine_sparc_leon3.py b/tests/acceptance/machine_sparc_leon3.py
index a1394ba8ad..1172fd5da0 100644
--- a/tests/acceptance/machine_sparc_leon3.py
+++ b/tests/acceptance/machine_sparc_leon3.py
@@ -10,6 +10,8 @@ import logging
 
 from avocado import skipIf
 from avocado_qemu import MachineTest
+from avocado_qemu import wait_for_console_pattern
+from avocado_qemu import exec_command_and_wait_for_pattern
 
 
 class Leon3Machine(MachineTest):
@@ -35,3 +37,29 @@ class Leon3Machine(MachineTest):
 
         wait_for_console_pattern(self,'Copyright (c) 2001-2014 HelenOS project')
         wait_for_console_pattern(self,'Booting the kernel ...')
+
+    def test_leon3_linux_kernel_4_9_busybox(self):
+        """
+        :avocado: tags=arch:sparc
+        :avocado: tags=machine:leon3
+        """
+        kernel_url = ('https://www.gaisler.com/anonftp/linux/linux-4/images/'
+                     'leon-linux-4.9/leon-linux-4.9-1.0/up/image.ram')
+        kernel_hash = '289bd1bcca10cda76d0ef2264a8657adc251f5f5'
+        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+
+        self.vm.set_machine('leon3_generic')
+        self.vm.set_console()
+        self.vm.add_args('-kernel', kernel_path)
+
+        self.vm.launch()
+
+        wait_for_console_pattern(self, 'TYPE: Leon3 System-on-a-Chip')
+
+        wait_for_console_pattern(self, 'Welcome to Buildroot')
+
+        wait_for_console_pattern(self, 'buildroot login:')
+        exec_command_and_wait_for_pattern(self, 'root', '#')
+        uname = 'Linux buildroot 4.9.54-00018-g62dab2c #2 ' \
+                'Wed Oct 18 09:45:51 CEST 2017 sparc GNU/Linux'
+        exec_command_and_wait_for_pattern(self, 'uname -a', uname)
-- 
2.21.0



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

* [PATCH 12/26] .travis.yml: Let the avocado job run the Leon3 test
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (10 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 11/26] tests/acceptance: Add test that boots Linux up to BusyBox " Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 16:50   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 13/26] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p Philippe Mathieu-Daudé
                   ` (15 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

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..4ca0d0fdf1 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,ppc64-softmmu,m68k-softmmu,sparc-softmmu"
         - TEST_CMD="make check-acceptance"
       after_failure:
         - cat tests/results/latest/job.log
-- 
2.21.0



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

* [PATCH 13/26] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (11 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 12/26] .travis.yml: Let the avocado job run the Leon3 test Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 16:56   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 14/26] tests/acceptance: Test Open Firmware on the PReP/40p Philippe Mathieu-Daudé
                   ` (14 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Hervé Poussineau,
	Wainer dos Santos Moschetta, Artyom Tarasenko, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno,
	David Gibson

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

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

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

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

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

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



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

* [PATCH 14/26] tests/acceptance: Test Open Firmware on the PReP/40p
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (12 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 13/26] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 17:47   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 15/26] tests/acceptance: Test OpenBIOS " Philippe Mathieu-Daudé
                   ` (13 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Artyom Tarasenko,
	Cleber Rosa, Aleksandar Rikalo, Alex Bennée, Aurelien Jarno,
	David Gibson

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

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

Acked-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
Tested-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v3: use avocado_qemu.wait_for_console_pattern (Cleber)
---
 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 7dd90bb2bb..ebde5b7dc4 100644
--- a/tests/acceptance/ppc_prep_40p.py
+++ b/tests/acceptance/ppc_prep_40p.py
@@ -48,3 +48,24 @@ class IbmPrep40pMachine(MachineTest):
         os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
         wait_for_console_pattern(self, os_banner)
         wait_for_console_pattern(self, 'Model: IBM PPS Model 6015')
+
+    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()
+        wait_for_console_pattern(self, 'QEMU PReP/40p')
+        fw_banner = 'Open Firmware, built  April 13, 2019 09:29:23'
+        wait_for_console_pattern(self, fw_banner)
+        prompt_msg = 'Type any key to interrupt automatic startup'
+        wait_for_console_pattern(self, prompt_msg)
-- 
2.21.0



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

* [PATCH 15/26] tests/acceptance: Test OpenBIOS on the PReP/40p
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (13 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 14/26] tests/acceptance: Test Open Firmware on the PReP/40p Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 18:41   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 16/26] tests/acceptance: Test Sandalfoot initrd " Philippe Mathieu-Daudé
                   ` (12 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno,
	David Gibson

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

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

Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v3:
- use avocado_qemu.wait_for_console_pattern (Cleber)
- use MD5 hash
---
 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 ebde5b7dc4..b4109a7af3 100644
--- a/tests/acceptance/ppc_prep_40p.py
+++ b/tests/acceptance/ppc_prep_40p.py
@@ -69,3 +69,35 @@ class IbmPrep40pMachine(MachineTest):
         wait_for_console_pattern(self, fw_banner)
         prompt_msg = 'Type any key to interrupt automatic startup'
         wait_for_console_pattern(self, 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') # test fw_cfg
+
+        self.vm.launch()
+        wait_for_console_pattern(self, '>> OpenBIOS')
+        wait_for_console_pattern(self, '>> Memory: 192M')
+        wait_for_console_pattern(self, '>> 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 = 'ac6fa2707d888b36d6fa64de6e7fe48e'
+        drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash,
+                                      algorithm='md5')
+        self.vm.set_machine('40p')
+        self.vm.set_console()
+        self.vm.add_args('-cdrom', drive_path,
+                         '-boot', 'd')
+
+        self.vm.launch()
+        wait_for_console_pattern(self, 'NetBSD/prep BOOT, Revision 1.9')
-- 
2.21.0



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

* [PATCH 16/26] tests/acceptance: Test Sandalfoot initrd on the PReP/40p
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (14 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 15/26] tests/acceptance: Test OpenBIOS " Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 19:08   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 17/26] .travis.yml: Let the avocado job run the 40p tests Philippe Mathieu-Daudé
                   ` (11 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno,
	David Gibson

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

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

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

Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v3:
- use avocado_qemu.wait_for_console_pattern (Cleber)
- use exec_command_and_wait_for_pattern
- check getenv(AVOCADO_ALLOW_UNTRUSTED_CODE) (pm215)
---
 tests/acceptance/ppc_prep_40p.py | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
index b4109a7af3..c5ecabf52f 100644
--- a/tests/acceptance/ppc_prep_40p.py
+++ b/tests/acceptance/ppc_prep_40p.py
@@ -11,6 +11,7 @@ import logging
 from avocado import skipIf
 from avocado import skipUnless
 from avocado_qemu import MachineTest
+from avocado_qemu import exec_command_and_wait_for_pattern
 from avocado_qemu import wait_for_console_pattern
 
 
@@ -101,3 +102,33 @@ class IbmPrep40pMachine(MachineTest):
 
         self.vm.launch()
         wait_for_console_pattern(self, 'NetBSD/prep BOOT, Revision 1.9')
+
+    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
+    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()
+        wait_for_console_pattern(self, 'Now booting the kernel')
+
+        msg = 'Please press Enter to activate this console.'
+        wait_for_console_pattern(self, msg)
+
+        version = 'BusyBox v0.60.0 (2001.08.19-09:26+0000) Built-in shell (ash)'
+        exec_command_and_wait_for_pattern(self, '', version)
+
+        uname = 'Linux ppc 2.4.18 #5 Wed May 21 23:50:43 AKDT 2003 ppc unknown'
+        exec_command_and_wait_for_pattern(self, 'uname -a', uname)
+
+        cpu = 'PReP IBM 6015/7020 (Sandalfoot/Sandalbow)'
+        exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', cpu)
-- 
2.21.0



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

* [PATCH 17/26] .travis.yml: Let the avocado job run the 40p tests
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (15 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 16/26] tests/acceptance: Test Sandalfoot initrd " Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 19:25   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 18/26] tests/boot_console: Test booting HP-UX firmware upgrade Philippe Mathieu-Daudé
                   ` (10 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

Acked-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 4ca0d0fdf1..2a1013f8f4 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,sparc-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,sparc-softmmu"
         - TEST_CMD="make check-acceptance"
       after_failure:
         - cat tests/results/latest/job.log
-- 
2.21.0



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

* [PATCH 18/26] tests/boot_console: Test booting HP-UX firmware upgrade
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (16 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 17/26] .travis.yml: Let the avocado job run the 40p tests Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 20:09   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 19/26] tests/boot_linux_console: Use Avocado archive::gzip_uncompress() Philippe Mathieu-Daudé
                   ` (9 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	Sven Schnelle, KONRAD Frederic, Fabien Chouteau,
	Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

Add a test which boots a HP-UX firmware upgrade CD-ROM.
It exercise the PCI LSI53C895A SCSI controller.

The ISO image comes from:
https://web.archive.org/web/20101204061612/http://ftp.parisc-linux.org/kernels/712/PF_C7120023

This test is very quick, less than 3s:

  $ AVOCADO_ALLOW_UNTRUSTED_CODE=yes \
    avocado --show=app,console run -t arch:hppa \
      tests/acceptance/boot_linux_console.py
  console: Firmware Version 6.1
  console: Duplex Console IO Dependent Code (IODC) revision 1
  console: Memory Test/Initialization Completed
  console: ------------------------------------------------------------------------------
  console: (c) Copyright 2017-2018 Helge Deller <deller@gmx.de> and SeaBIOS developers.
  console: ------------------------------------------------------------------------------
  console: Processor   Speed            State           Coprocessor State  Cache Size
  console: ---------  --------   ---------------------  -----------------  ----------
  console: 0      250 MHz    Active                 Functional            0 KB
  console: Available memory:     512 MB
  console: Good memory required: 16 MB
  console: Primary boot path:    FWSCSI.0.0
  console: Alternate boot path:  FWSCSI.2.0
  console: Console path:         SERIAL_1.9600.8.none
  console: Keyboard path:        PS2
  console: Available boot devices:
  console: 1. DVD/CD [lsi 00:00.0 2:0 Drive QEMU QEMU CD-ROM 2.5+]
  console: Booting from DVD/CD [lsi 00:00.0 2:0 Drive QEMU QEMU CD-ROM 2.5+]
  console: Booting...
  console: Boot IO Dependent Code (IODC) revision 153
  console: HARD Booted.
  console: ISL Revision A.00.25 November 18, 1992
  console: ISL booting  ODE UPDATE ; stable off ; RUN
  console: Loading...
  console: ***************************************************************************
  console: ******                                                               ******
  console: ******             Offline Diagnostic Environment                    ******
  console: ******                                                               ******
  console: ******      (C) Copyright Hewlett-Packard Co 1993                    ******
  console: ******                    All Rights Reserved                        ******
  console: ******                                                               ******
  console: ******  HP shall not be liable for any damages resulting from the    ******
  console: ******  use of this program.                                         ******
  console: ******                                                               ******
  console: ******                TC  Version A.00.15                            ******
  console: ******                SysLib Version A.00.44                         ******
  console: ******                                                               ******
  console: ***************************************************************************
  console: Type HELP for command information.
  console: ISL_CMD> UPDATE ; stable off ; RUN
  console: ***************************************************************************
  console: ******                                                               ******
  console: ******                           PDC UPDATER                         ******
  console: ******                                                               ******
  console: ******    Copyright (C) 1993, 1994, 1995 by Hewlett-Packard Company  ******
  console: ******                         Version A.00.19                       ******
  console: ******                                                               ******
  console: ***************************************************************************
  console: Type HELP for command information.
  console: Stable Storage will NOT be updated
  console: STARTING EXECUTION OF UPDATE
  console: Unrecognized MODEL TYPE = 502
  console: ERROR 0001
  console: UPDATE PAUSED> exit
  console: UPDATE>
  console: UPDATE> ls
  console: Modules on this boot media are:
  console: filename    type    size     created   description
  console: -----------------------------------------------------------------------------
  console: DAGGER      DATA    118      96/02/15  ?
  console: IMAGE1A     DATA    512      96/02/15  ?
  console: IMAGE1B     DATA    388      96/02/15  ?
  console: UPDATE> exit
  console: THIS UTILITY WILL NOW RESET THE SYSTEM.....
  PASS (2.39 s)
  JOB TIME   : 2.54 s

Suggested-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v2:
- check getenv(AVOCADO_ALLOW_UNTRUSTED_CODE) (pm215)

I know this is not a 'Linux' test, but all our console functions
reside in this file and I don't want to duplicate again.
Maybe we could rename this file as 'boot_console_tests.py' or
extract the console related functions.
---
 tests/acceptance/boot_linux_console.py | 27 ++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index f94dc4bbca..67b396169b 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -13,6 +13,7 @@ import lzma
 import gzip
 import shutil
 
+from avocado import skipUnless
 from avocado_qemu import MachineTest
 from avocado_qemu import exec_command_and_wait_for_pattern
 from avocado_qemu import wait_for_console_pattern
@@ -357,3 +358,29 @@ class BootLinuxConsole(MachineTest):
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
         self.wait_for_console_pattern(console_pattern)
+
+    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
+    def test_hppa_fwupdate(self):
+        """
+        :avocado: tags=arch:hppa
+        :avocado: tags=device:lsi53c895a
+        """
+        cdrom_url = ('https://github.com/philmd/qemu-testing-blob/raw/ec1b741/'
+                     'hppa/hp9000/712/C7120023.frm')
+        cdrom_hash = '17944dee46f768791953009bcda551be5ab9fac9'
+        cdrom_path = self.fetch_asset(cdrom_url, asset_hash=cdrom_hash)
+
+        self.vm.set_console()
+        self.vm.add_args('-cdrom', cdrom_path,
+                         '-boot', 'd',
+                         '-no-reboot')
+        self.vm.launch()
+        self.wait_for_console_pattern('Unrecognized MODEL TYPE = 502')
+
+        exec_command_and_wait_for_pattern(self, 'exit',
+                                                'UPDATE>')
+        exec_command_and_wait_for_pattern(self, 'ls',
+                                                'IMAGE1B')
+        exec_command_and_wait_for_pattern(self, 'exit',
+                                                'THIS UTILITY WILL NOW '
+                                                'RESET THE SYSTEM.....')
-- 
2.21.0



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

* [PATCH 19/26] tests/boot_linux_console: Use Avocado archive::gzip_uncompress()
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (17 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 18/26] tests/boot_console: Test booting HP-UX firmware upgrade Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 20:13   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 20/26] tests/boot_linux_console: Add a test for the Raspberry Pi 2 Philippe Mathieu-Daudé
                   ` (8 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

Avocado 67.0 [*] introduced the avocado.utils.archive module which
provides handling of gzip files. Use the gzip_uncompress() method.

[*] https://avocado-framework.readthedocs.io/en/67.0/api/utils/avocado.utils.html#avocado.utils.archive.gzip_uncompress

Suggested-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v2: New patch replacing the gunzip() refactor
---
 tests/acceptance/boot_linux_console.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 67b396169b..a689c09cfe 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -146,10 +146,7 @@ class BootLinuxConsole(MachineTest):
         initrd_hash = 'bf806e17009360a866bf537f6de66590de349a99'
         initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
         initrd_path = self.workdir + "rootfs.cpio"
-
-        with gzip.open(initrd_path_gz, 'rb') as f_in:
-            with open(initrd_path, 'wb') as f_out:
-                shutil.copyfileobj(f_in, f_out)
+        archive.gzip_uncompress(initrd_path_gz, initrd_path)
 
         self.vm.set_machine('malta')
         self.vm.set_console()
-- 
2.21.0



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

* [PATCH 20/26] tests/boot_linux_console: Add a test for the Raspberry Pi 2
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (18 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 19/26] tests/boot_linux_console: Use Avocado archive::gzip_uncompress() Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 20:24   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 21/26] tests/boot_linux_console: Test the raspi2 UART1 (16550 based) Philippe Mathieu-Daudé
                   ` (7 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

Similar to the x86_64/pc test, it boots a Linux kernel on a raspi2
board and verify the serial is working.

The kernel image and DeviceTree blob are built by the Raspbian
project (based on Debian):
https://www.raspbian.org/RaspbianImages
as recommended by the Raspberry Pi project:
https://www.raspberrypi.org/downloads/raspbian/

If ARM is a target being built, "make check-acceptance" will
automatically include this test by the use of the "arch:arm" tags.

Alternatively, this test can be run using:

    $ avocado run -t arch:arm tests/acceptance
    $ avocado run -t machine:raspi2 tests/acceptance

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v2: removed debug printf (Cleber)
    use serial_kernel_cmdline dict
---
 tests/acceptance/boot_linux_console.py | 36 ++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index a689c09cfe..cc0c73b9c1 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -293,6 +293,42 @@ class BootLinuxConsole(MachineTest):
         self.vm.launch()
         self.wait_for_console_pattern('init started: BusyBox')
 
+    def do_test_arm_raspi2(self, uart_id):
+        """
+        The kernel can be rebuilt using the kernel source referenced
+        and following the instructions on the on:
+        https://www.raspberrypi.org/documentation/linux/kernel/building.md
+        """
+        serial_kernel_cmdline = {
+            0: 'earlycon=pl011,0x3f201000 console=ttyAMA0',
+        }
+        deb_url = ('http://archive.raspberrypi.org/debian/'
+                   'pool/main/r/raspberrypi-firmware/'
+                   'raspberrypi-kernel_1.20190215-1_armhf.deb')
+        deb_hash = 'cd284220b32128c5084037553db3c482426f3972'
+        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
+        kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img')
+        dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb')
+
+        self.vm.set_machine('raspi2')
+        self.vm.set_console()
+        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+                               serial_kernel_cmdline[uart_id])
+        self.vm.add_args('-kernel', kernel_path,
+                         '-dtb', dtb_path,
+                         '-append', kernel_command_line)
+        self.vm.launch()
+        console_pattern = 'Kernel command line: %s' % kernel_command_line
+        self.wait_for_console_pattern(console_pattern)
+
+    def test_arm_raspi2_uart0(self):
+        """
+        :avocado: tags=arch:arm
+        :avocado: tags=machine:raspi2
+        :avocado: tags=device:pl011
+        """
+        self.do_test_arm_raspi2(0)
+
     def test_s390x_s390_ccw_virtio(self):
         """
         :avocado: tags=arch:s390x
-- 
2.21.0



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

* [PATCH 21/26] tests/boot_linux_console: Test the raspi2 UART1 (16550 based)
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (19 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 20/26] tests/boot_linux_console: Add a test for the Raspberry Pi 2 Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 20:30   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 22/26] tests/boot_linux_console: Boot Linux and run few commands on raspi3 Philippe Mathieu-Daudé
                   ` (6 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

The current do_test_arm_raspi2() case tests the PL011 UART0.
Our model also supports the AUX UART (16550 based).
We can very simply test the UART1 with Linux, modifying the
kernel command line.

Add few lines to expand our previous test and cover the AUX
UART.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/acceptance/boot_linux_console.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index cc0c73b9c1..1c9ff2bda3 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -301,6 +301,7 @@ class BootLinuxConsole(MachineTest):
         """
         serial_kernel_cmdline = {
             0: 'earlycon=pl011,0x3f201000 console=ttyAMA0',
+            1: 'earlycon=uart8250,mmio32,0x3f215040 console=ttyS1,115200'
         }
         deb_url = ('http://archive.raspberrypi.org/debian/'
                    'pool/main/r/raspberrypi-firmware/'
@@ -311,7 +312,7 @@ class BootLinuxConsole(MachineTest):
         dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb')
 
         self.vm.set_machine('raspi2')
-        self.vm.set_console()
+        self.vm.set_console(console_index=uart_id)
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
                                serial_kernel_cmdline[uart_id])
         self.vm.add_args('-kernel', kernel_path,
@@ -329,6 +330,14 @@ class BootLinuxConsole(MachineTest):
         """
         self.do_test_arm_raspi2(0)
 
+    def test_arm_raspi2_uart1(self):
+        """
+        :avocado: tags=arch:arm
+        :avocado: tags=machine:raspi2
+        :avocado: tags=device:bcm2835_aux
+        """
+        self.do_test_arm_raspi2(1)
+
     def test_s390x_s390_ccw_virtio(self):
         """
         :avocado: tags=arch:s390x
-- 
2.21.0



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

* [PATCH 22/26] tests/boot_linux_console: Boot Linux and run few commands on raspi3
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (20 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 21/26] tests/boot_linux_console: Test the raspi2 UART1 (16550 based) Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 20:47   ` Cleber Rosa
  2019-10-28 20:48   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 23/26] tests/boot_linux_console: Test SDHCI and termal sensor " Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  27 siblings, 2 replies; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

Add a test which boots Linux and run basic commands using the serial
port console.

The kernel image is built by the Debian project:
https://wiki.debian.org/RaspberryPi

The DeviceTree blob comes from the official Raspberry Pi project:
https://www.raspberrypi.org/

The cpio image used comes from the linux-build-test project:
https://github.com/groeck/linux-build-test

This test can be run using:

  $ avocado run --show=console,app run -t machine:raspi3 tests/acceptance
  console: [    0.000000] Linux version 4.14.0-3-arm64 (debian-kernel@lists.debian.org) (gcc version 7.2.0 (Debian 7.2.0-18)) #1 SMP Debian 4.14.12-2 (2018-01-06)
  console: [    0.000000] Boot CPU: AArch64 Processor [410fd034]
  console: [    0.000000] Machine model: Raspberry Pi 3 Model B
  console: [    0.000000] earlycon: pl11 at MMIO 0x000000003f201000 (options '')
  console: [    0.000000] bootconsole [pl11] enabled
  [...]
  console: Starting network: OK
  console: Found console ttyAMA0
  console: Boot successful.
  console: / # cat /proc/cpuinfo
  console: processor      : 0
  console: BogoMIPS       : 125.00
  console: r      : 0x41
  console: CPU architecture: 8
  console: CPU variant
  console: : 0x0
  console: CPU part       : 0xd03
  console: CPU revision   : 4
  console: / # uname -a
  console: Linux buildroot 4.14.0-3-arm64 #1 SMP Debian 4.14.12-2 (2018-01-06) aarch64 GNU/Linux
  console: reboot
  console: / # reboot
  console: / # Found console ttyAMA0
  console: Stopping network: OK
  console: Saving random seed... done.
  console: Stopping logging: OK
  console: umount: devtmpfs busy - remounted read-only
  console: umount: can't unmount /: Invalid argument
  console: The system is going down NOW!
  console: Sent SIGTERM to all processes
  console: Sent SIGKILL to all processes
  console: Requesting system reboot
  console: kvm: exiting hardware virtualization
  console: reboot: Restarting system
  PASS (11.08 s)

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v2: Use archive.gzip_uncompress (Cleber)

some chars are scrambled on the console?
Cleber ran this 100 times and doesn't have issue.
---
 tests/acceptance/boot_linux_console.py | 48 ++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 1c9ff2bda3..dc27d79199 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -338,6 +338,54 @@ class BootLinuxConsole(MachineTest):
         """
         self.do_test_arm_raspi2(1)
 
+    def test_arm_raspi3_initrd_uart0(self):
+        """
+        :avocado: tags=arch:aarch64
+        :avocado: tags=machine:raspi3
+        """
+        deb_url = ('https://snapshot.debian.org/archive/debian/'
+                   '20180106T174014Z/pool/main/l/linux/'
+                   'linux-image-4.14.0-3-arm64_4.14.12-2_arm64.deb')
+        deb_hash = 'e71c995de57921921895c1162baea5df527d1c6b'
+        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
+        kernel_path = self.extract_from_deb(deb_path,
+                                            '/boot/vmlinuz-4.14.0-3-arm64')
+
+        dtb_url = ('https://github.com/raspberrypi/firmware/raw/'
+                   '1.20180313/boot/bcm2710-rpi-3-b.dtb')
+        dtb_hash = 'eb14d67133401ef2f93523be7341456d38bfc077'
+        dtb_path = self.fetch_asset(dtb_url, asset_hash=dtb_hash)
+
+        initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
+                      '9b6b392ea7bc15f0d6632328d429d31c9c6273da/rootfs/'
+                      'arm64/rootfs.cpio.gz')
+        initrd_hash = '6fd05324f17bb950196b5ad9d3a0fa996339f4cd'
+        initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
+        initrd_path = self.workdir + "rootfs.cpio"
+        archive.gzip_uncompress(initrd_path_gz, initrd_path)
+
+        self.vm.set_machine('raspi3')
+        self.vm.set_console()
+        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+                               'earlycon=pl011,0x3f201000 console=ttyAMA0 ' +
+                               'panic=-1 noreboot')
+        self.vm.add_args('-kernel', kernel_path,
+                         '-dtb', dtb_path,
+                         '-initrd', initrd_path,
+                         '-append', kernel_command_line,
+                         '-no-reboot')
+        self.vm.launch()
+
+        self.wait_for_console_pattern('Boot successful.',
+                                      failure_message='-----[ cut here ]-----')
+
+        exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
+                                                'BogoMIPS')
+        exec_command_and_wait_for_pattern(self, 'uname -a',
+                                                'Debian')
+        exec_command_and_wait_for_pattern(self, 'reboot',
+                                                'reboot: Restarting system')
+
     def test_s390x_s390_ccw_virtio(self):
         """
         :avocado: tags=arch:s390x
-- 
2.21.0



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

* [PATCH 23/26] tests/boot_linux_console: Test SDHCI and termal sensor on raspi3
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (21 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 22/26] tests/boot_linux_console: Boot Linux and run few commands on raspi3 Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 20:54   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 24/26] tests/boot_linux_console: Add initrd test for the Exynos4210 Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

Add a test which loads the root filesystem on a SD card.
Use a kernel recent enough to also test the thermal sensor.

The kernel image comes from:
https://github.com/sakaki-/bcmrpi3-kernel#description

The cpio image used comes from the linux-build-test project:
https://github.com/groeck/linux-build-test

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v2: Use archive.gzip_uncompress (Cleber)
---
 tests/acceptance/boot_linux_console.py | 46 ++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index dc27d79199..44a046bd64 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -386,6 +386,52 @@ class BootLinuxConsole(MachineTest):
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
 
+    def test_arm_raspi3_initrd_sd_temp(self):
+        """
+        :avocado: tags=arch:aarch64
+        :avocado: tags=machine:raspi3
+        """
+        tarball_url = ('https://github.com/sakaki-/bcmrpi3-kernel/releases/'
+                       'download/4.19.71.20190910/'
+                       'bcmrpi3-kernel-4.19.71.20190910.tar.xz')
+        tarball_hash = '844f117a1a6de0532ba92d2a7bceb5b2acfbb298'
+        tarball_path = self.fetch_asset(tarball_url, asset_hash=tarball_hash)
+        archive.extract(tarball_path, self.workdir)
+        dtb_path    = self.workdir + "/boot/bcm2837-rpi-3-b.dtb"
+        kernel_path = self.workdir + "/boot/kernel8.img"
+
+        rootfs_url = ('https://github.com/groeck/linux-build-test/raw/'
+                      '9b6b392ea7bc15f0d6632328d429d31c9c6273da/rootfs/'
+                      'arm64/rootfs.ext2.gz')
+        rootfs_hash = 'dbe4136f0b4a0d2180b93fd2a3b9a784f9951d10'
+        rootfs_path_gz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
+        rootfs_path = self.workdir + "rootfs.ext2"
+        archive.gzip_uncompress(rootfs_path_gz, rootfs_path)
+
+        self.vm.set_machine('raspi3')
+        self.vm.set_console()
+        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+                               'earlycon=pl011,0x3f201000 console=ttyAMA0 ' +
+                               'root=/dev/mmcblk0 rootwait rw ' +
+                               'panic=-1 noreboot')
+        self.vm.add_args('-kernel', kernel_path,
+                         '-dtb', dtb_path,
+                         '-append', kernel_command_line,
+                         '-drive', 'file=' + rootfs_path + ',if=sd,format=raw',
+                         '-no-reboot')
+        self.vm.launch()
+
+        self.wait_for_console_pattern('Boot successful.',
+                                      failure_message='-----[ cut here ]-----')
+
+        exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
+                                                'Raspberry Pi 3 Model B')
+        exec_command_and_wait_for_pattern(self, ('cat /sys/devices/virtual/'
+                                                 'thermal/thermal_zone0/temp'),
+                                                '25178')
+        exec_command_and_wait_for_pattern(self, 'reboot',
+                                                'reboot: Restarting system')
+
     def test_s390x_s390_ccw_virtio(self):
         """
         :avocado: tags=arch:s390x
-- 
2.21.0



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

* [PATCH 24/26] tests/boot_linux_console: Add initrd test for the Exynos4210
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (22 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 23/26] tests/boot_linux_console: Test SDHCI and termal sensor " Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 21:40   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 25/26] tests/boot_linux_console: Add sdcard " Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

This test boots a Linux kernel on a smdkc210 board and verify
the serial output is working.

The cpio image used comes from the linux-build-test project:
https://github.com/groeck/linux-build-test

If ARM is a target being built, "make check-acceptance" will
automatically include this test by the use of the "arch:arm" tags.

This test can be run using:

  $ IGNORE_AVOCADO_CONSOLE_BUG=yes \
    avocado --show=app,console run -t machine:smdkc210 \
      tests/acceptance/boot_linux_console.py
  console: Booting Linux on physical CPU 0x900
  console: Linux version 4.19.0-6-armmp (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20)
  console: CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c5387d
  console: CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
  console: OF: fdt: Machine model: Samsung smdkv310 evaluation board based on Exynos4210
  [...]
  console: Samsung CPU ID: 0x43210211
  console: random: get_random_bytes called from start_kernel+0xa0/0x504 with crng_init=0
  console: percpu: Embedded 17 pages/cpu s39756 r8192 d21684 u69632
  console: Built 1 zonelists, mobility grouping on.  Total pages: 249152
  console: Kernel command line: printk.time=0 console=ttySAC0,115200n8 earlyprintk random.trust_cpu=off cryptomgr.notests cpuidle.off=1 panic=-1 noreboot
  [...]
  console: L2C: platform modifies aux control register: 0x02020000 -> 0x3e420001
  console: L2C: platform provided aux values permit register corruption.
  console: L2C: DT/platform modifies aux control register: 0x02020000 -> 0x3e420001
  console: L2C-310 erratum 769419 enabled
  console: L2C-310 enabling early BRESP for Cortex-A9
  console: L2C-310: enabling full line of zeros but not enabled in Cortex-A9
  console: L2C-310 ID prefetch enabled, offset 1 lines
  console: L2C-310 dynamic clock gating disabled, standby mode disabled
  console: L2C-310 cache controller enabled, 8 ways, 128 kB
  console: L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x7e420001
  console: Exynos4210 clocks: sclk_apll = 12000000, sclk_mpll = 12000000
  console: sclk_epll = 12000000, sclk_vpll = 12000000, arm_clk = 12000000
  [...]
  console: s3c-i2c 13860000.i2c: slave address 0x00
  console: s3c-i2c 13860000.i2c: bus frequency set to 93 KHz
  console: s3c-i2c 13860000.i2c: i2c-0: S3C I2C adapter
  [...]
  console: dma-pl330 12680000.pdma: Loaded driver for PL330 DMAC-241330
  console: dma-pl330 12680000.pdma:       DBUFF-256x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
  console: dma-pl330 12690000.pdma: Loaded driver for PL330 DMAC-241330
  console: dma-pl330 12690000.pdma:       DBUFF-256x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
  console: dma-pl330 12850000.mdma: Loaded driver for PL330 DMAC-241330
  console: dma-pl330 12850000.mdma:       DBUFF-256x8bytes Num_Chans-8 Num_Peri-1 Num_Events-16
  console: dma-pl330 12850000.mdma: PM domain LCD0 will not be powered off
  console: Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
  console: Serial: AMBA driver
  console: 13800000.serial: ttySAC0 at MMIO 0x13800000 (irq = 40, base_baud = 0) is a S3C6400/10
  console: console [ttySAC0] enabled
  console: 13810000.serial: ttySAC1 at MMIO 0x13810000 (irq = 41, base_baud = 0) is a S3C6400/10
  console: 13820000.serial: ttySAC2 at MMIO 0x13820000 (irq = 42, base_baud = 0) is a S3C6400/10
  console: 13830000.serial: ttySAC3 at MMIO 0x13830000 (irq = 43, base_baud = 0) is a S3C6400/10
  [...]
  console: Freeing unused kernel memory: 2048K
  console: Run /init as init process
  console: mount: mounting devtmpfs on /dev failed: Device or resource busy
  console: Starting logging: OK
  console: Initializing random number generator... random: dd: uninitialized urandom read (512 bytes read)
  console: done.
  console: Starting network: OK
  console: Found console ttySAC0
  console: Linux version 4.19.0-6-armmp (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20)
  console: Boot successful.
  PASS (37.98 s)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v2: use archive.gzip_uncompress (Cleber)

serial input is not working :(

I sometime get (not always):

Starting network: OK
[   70.403690] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
[   70.423212] rcu:     0-...!: (36 GPs behind) idle=c7a/1/0x40000000 softirq=287/288 fqs=1
[   70.428209] rcu:     (detected by 1, t=2602 jiffies, g=-443, q=2209)
[   70.432826] Sending NMI from CPU 1 to CPUs 0:
[   70.473866] NMI backtrace for cpu 0
[   70.476621] CPU: 0 PID: 112 Comm: cat Not tainted 4.19.0 #1
[   70.476711] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[   70.476916] PC is at mntput_no_expire+0x88/0x464
[   70.476996] LR is at rcu_is_watching+0x24/0x78
[   70.477074] pc : [<c02b256c>]    lr : [<c01a2fb4>]    psr: a0000013
[   70.477150] sp : ee2afdb0  ip : 9dff9a2f  fp : ee2aff70
[   70.477225] r10: 00000142  r9 : ee219dc0  r8 : ee2afec0
[   70.477302] r7 : ee2afec0  r6 : c0298d6c  r5 : ef02c400  r4 : ef018200
[   70.477385] r3 : c0f99274  r2 : 00000031  r1 : 2e87c000  r0 : a0000013
[   70.477461] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   70.477537] Control: 10c5387d  Table: 6e30806a  DAC: 00000051
[   70.477613] CPU: 0 PID: 112 Comm: cat Not tainted 4.19.0 #1
[   70.477688] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[   70.477765] [<c01128f4>] (unwind_backtrace) from [<c010e5b4>] (show_stack+0x10/0x14)
[   70.477847] [<c010e5b4>] (show_stack) from [<c0a36160>] (dump_stack+0x98/0xc4)
[   70.477925] [<c0a36160>] (dump_stack) from [<c0a3cc90>] (nmi_cpu_backtrace+0x6c/0xb4)
[   70.478000] [<c0a3cc90>] (nmi_cpu_backtrace) from [<c0111530>] (handle_IPI+0x108/0x420)
[   70.478076] [<c0111530>] (handle_IPI) from [<c04950a8>] (gic_handle_irq+0x98/0x9c)
[   70.478151] [<c04950a8>] (gic_handle_irq) from [<c01019f0>] (__irq_svc+0x70/0xb0)
[   70.478226] Exception stack(0xee2afd60 to 0xee2afda8)
[   70.478303] fd60: a0000013 2e87c000 00000031 c0f99274 ef018200 ef02c400 c0298d6c ee2afec0
[   70.478378] fd80: ee2afec0 ee219dc0 00000142 ee2aff70 9dff9a2f ee2afdb0 c01a2fb4 c02b256c
[   70.478453] fda0: a0000013 ffffffff
[   70.478529] [<c01019f0>] (__irq_svc) from [<c02b256c>] (mntput_no_expire+0x88/0x464)
[   70.478605] [<c02b256c>] (mntput_no_expire) from [<c0298d6c>] (terminate_walk+0x154/0x160)
[   70.478681] [<c0298d6c>] (terminate_walk) from [<c029ce3c>] (path_openat+0x324/0xfe4)
[   70.478759] [<c029ce3c>] (path_openat) from [<c029ea9c>] (do_filp_open+0x70/0xdc)
[   70.478835] [<c029ea9c>] (do_filp_open) from [<c028b36c>] (do_sys_open+0x134/0x1e4)
[   70.478911] [<c028b36c>] (do_sys_open) from [<c0101000>] (ret_fast_syscall+0x0/0x28)
[   70.478989] Exception stack(0xee2affa8 to 0xee2afff0)
[   70.479064] ffa0:                   b6fc7d6c 0000000a ffffff9c bebbf268 000a0000 00000000
[   70.479139] ffc0: b6fc7d6c 0000000a 00000050 00000142 bebbf268 b6fc6970 b6fc6b28 bebbf254
[   70.479214] ffe0: b6fc6970 bebbf1e0 b6f9dd94 b6fb0c0c
[   70.484892] rcu: rcu_preempt kthread starved for 2600 jiffies! g-443 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->cpu=0
[   70.514943] rcu: RCU grace-period kthread stack dump:
[   70.516687] rcu_preempt     I    0    10      2 0x00000000
[   70.523711] [<c0a4caac>] (__schedule) from [<c0a4d28c>] (schedule+0x4c/0xac)
[   70.525103] [<c0a4d28c>] (schedule) from [<c0a52c34>] (schedule_timeout+0x230/0x564)
[   70.526472] [<c0a52c34>] (schedule_timeout) from [<c01a7818>] (rcu_gp_kthread+0x6e4/0xbf0)
[   70.527784] [<c01a7818>] (rcu_gp_kthread) from [<c014d7f0>] (kthread+0x138/0x168)
[   70.528989] [<c014d7f0>] (kthread) from [<c01010b4>] (ret_from_fork+0x14/0x20)
[   70.530387] Exception stack(0xef111fb0 to 0xef111ff8)
[   70.532556] 1fa0:                                     00000000 00000000 00000000 00000000
[   70.534904] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   70.536920] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
Found console ttySAC0

Linux version 4.19.0 (root@591d0a36fd03) (gcc version 6.3.0 20170516 (Debian 6.3.0-18)) #1 SMP PREEMPT Fri Oct 4 19:53:43 UTC 2019
Boot successful.
/ #

Also:

[   73.000405] [<c01128f4>] (unwind_backtrace) from [<c010e5b4>] (show_stack+0x10/0x14)
[   73.000537] [<c010e5b4>] (show_stack) from [<c0a36160>] (dump_stack+0x98/0xc4)
[   73.000631] [<c0a36160>] (dump_stack) from [<c0a3cc90>] (nmi_cpu_backtrace+0x6c/0xb4)
[   73.000701] [<c0a3cc90>] (nmi_cpu_backtrace) from [<c0111530>] (handle_IPI+0x108/0x420)
[   73.000823] [<c0111530>] (handle_IPI) from [<c04950a8>] (gic_handle_irq+0x98/0x9c)
[   73.000924] [<c04950a8>] (gic_handle_irq) from [<c01019f0>] (__irq_svc+0x70/0xb0)
[   73.000990] Exception stack(0xef123f80 to 0xef123fc8)
[   73.001064] 3f80: 00000001 00000001 00000000 ef11b300 ef122000 c1007470 c10074b4 00000002
[   73.001131] 3fa0: 4000406a 410fc090 00000000 00000000 00000000 ef123fd0 c018759c c010a4c8
[   73.001196] 3fc0: 20000013 ffffffff
[   73.001262] [<c01019f0>] (__irq_svc) from [<c010a4c8>] (arch_cpu_idle+0x24/0x3c)
[   73.001328] [<c010a4c8>] (arch_cpu_idle) from [<c015f1f0>] (do_idle+0xcc/0x168)
[   73.001394] [<c015f1f0>] (do_idle) from [<c015f60c>] (cpu_startup_entry+0x18/0x1c)
[   73.001462] [<c015f60c>] (cpu_startup_entry) from [<4010276c>] (0x4010276c)

Based-on: 20190926173428.10713-16-f4bug@amsat.org
"tests/boot_linux_console: Extract the gunzip() helper"
---
 tests/acceptance/boot_linux_console.py | 42 ++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 44a046bd64..cbb8cddf47 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -432,6 +432,48 @@ class BootLinuxConsole(MachineTest):
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
 
+    @skipUnless(os.getenv('IGNORE_AVOCADO_CONSOLE_BUG'), 'Console buggy')
+    def test_arm_exynos4210_initrd(self):
+        """
+        :avocado: tags=arch:arm
+        :avocado: tags=machine:smdkc210
+        """
+        deb_url = ('https://snapshot.debian.org/archive/debian/'
+                   '20190928T224601Z/pool/main/l/linux/'
+                   'linux-image-4.19.0-6-armmp_4.19.67-2+deb10u1_armhf.deb')
+        deb_hash = 'fa9df4a0d38936cb50084838f2cb933f570d7d82'
+        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
+        kernel_path = self.extract_from_deb(deb_path,
+                                            '/boot/vmlinuz-4.19.0-6-armmp')
+        dtb_path = '/usr/lib/linux-image-4.19.0-6-armmp/exynos4210-smdkv310.dtb'
+        dtb_path = self.extract_from_deb(deb_path, dtb_path)
+
+        initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
+                      '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
+                      'arm/rootfs-armv5.cpio.gz')
+        initrd_hash = '2b50f1873e113523967806f4da2afe385462ff9b'
+        initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
+        initrd_path = os.path.join(self.workdir, 'rootfs.cpio')
+        archive.gzip_uncompress(initrd_path_gz, initrd_path)
+
+        self.vm.set_machine('smdkc210')
+        self.vm.set_console()
+        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+                               'earlycon=exynos4210,0x13800000 earlyprintk ' +
+                               'console=ttySAC0,115200n8 ' +
+                               'random.trust_cpu=off cryptomgr.notests ' +
+                               'cpuidle.off=1 panic=-1 noreboot')
+
+        self.vm.add_args('-kernel', kernel_path,
+                         '-dtb', dtb_path,
+                         '-initrd', initrd_path,
+                         '-append', kernel_command_line,
+                         '-no-reboot')
+        self.vm.launch()
+
+        self.wait_for_console_pattern('Boot successful.')
+        # TODO user command, for now the uart is stuck
+
     def test_s390x_s390_ccw_virtio(self):
         """
         :avocado: tags=arch:s390x
-- 
2.21.0



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

* [PATCH 25/26] tests/boot_linux_console: Add sdcard test for the Exynos4210
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (23 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 24/26] tests/boot_linux_console: Add initrd test for the Exynos4210 Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28 21:48   ` Cleber Rosa
  2019-10-28  7:34 ` [PATCH 26/26] tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpu Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

This test boots a Linux kernel on a smdkc210 board and verify
the serial output is working.

The cpio image used comes from the linux-build-test project:
https://github.com/groeck/linux-build-test

Since this test is not reliable due to clock timing issues,
it is disabled with the 'skip' property.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v2:
- use archive.gzip_uncompress (Cleber)
- check getenv(AVOCADO_ALLOW_UNTRUSTED_CODE) (pm215)
---
 tests/acceptance/boot_linux_console.py | 47 ++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index cbb8cddf47..489df4862c 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -13,6 +13,7 @@ import lzma
 import gzip
 import shutil
 
+from avocado import skip
 from avocado import skipUnless
 from avocado_qemu import MachineTest
 from avocado_qemu import exec_command_and_wait_for_pattern
@@ -474,6 +475,52 @@ class BootLinuxConsole(MachineTest):
         self.wait_for_console_pattern('Boot successful.')
         # TODO user command, for now the uart is stuck
 
+    @skip("unstable clock timings")
+    def test_arm_exynos4210_sdcard(self):
+        """
+        :avocado: tags=arch:arm
+        :avocado: tags=machine:smdkc210
+        """
+        deb_url = ('https://snapshot.debian.org/archive/debian/'
+                   '20190928T224601Z/pool/main/l/linux/'
+                   'linux-image-4.19.0-6-armmp_4.19.67-2+deb10u1_armhf.deb')
+        deb_hash = 'fa9df4a0d38936cb50084838f2cb933f570d7d82'
+        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
+        kernel_path = self.extract_from_deb(deb_path,
+                                            '/boot/vmlinuz-4.19.0-6-armmp')
+        dtb_path = '/usr/lib/linux-image-4.19.0-6-armmp/exynos4210-smdkv310.dtb'
+        dtb_path = self.extract_from_deb(deb_path, dtb_path)
+
+        rootfs_url = ('https://github.com/groeck/linux-build-test/raw/'
+                      '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
+                      'arm/rootfs-armv5.ext2.gz')
+        rootfs_hash = '093e89d2b4d982234bf528bc9fb2f2f17a9d1f93'
+        rootfs_path_gz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
+        rootfs_path = os.path.join(self.workdir, 'rootfs.ext2')
+        archive.gzip_uncompress(rootfs_path_gz, rootfs_path)
+
+        self.vm.set_machine('smdkc210')
+        self.vm.set_console(console_index=1)
+        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+                               'earlycon=exynos4210,0x13810000 earlyprintk ' +
+                               'console=ttySAC1,115200n8 ' +
+                               'random.trust_cpu=off cryptomgr.notests ' +
+                               'root=/dev/mmcblk0 rootwait rw ' +
+                               'cpuidle.off=1 panic=-1 noreboot')
+
+        self.vm.add_args('-kernel', kernel_path,
+                         '-dtb', dtb_path,
+                         '-append', kernel_command_line,
+                         # The external MMC is on the 3rd slot
+                         '-drive', 'if=sd,driver=null-co',
+                         '-drive', 'if=sd,driver=null-co',
+                         '-drive', 'if=sd,file=' + rootfs_path + ',format=raw',
+                         '-no-reboot')
+        self.vm.launch()
+
+        self.wait_for_console_pattern('Boot successful.')
+        # TODO user command, for now the uart is stuck
+
     def test_s390x_s390_ccw_virtio(self):
         """
         :avocado: tags=arch:s390x
-- 
2.21.0



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

* [PATCH 26/26] tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpu
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (24 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 25/26] tests/boot_linux_console: Add sdcard " Philippe Mathieu-Daudé
@ 2019-10-28  7:34 ` Philippe Mathieu-Daudé
  2019-10-28  8:17   ` Aleksandar Markovic
  2019-10-28  8:18 ` [PATCH 00/26] tests/acceptance: Queue for 4.2 no-reply
  2019-10-28  9:47 ` no-reply
  27 siblings, 1 reply; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-28  7:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, Philippe Mathieu-Daudé,
	KONRAD Frederic, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

This tests boots a Linux kernel on a Malta machine up to a
busybox shell on the serial console. Few commands are executed
before halting the machine (via reboot).

We use the Fedora 24 kernel extracted from the image at:
https://fedoraproject.org/wiki/Architectures/MIPS
and the initrd cpio image from the kerneltests project:
https://kerneltests.org/

If MIPS is a target being built, "make check-acceptance" will
automatically include this test by the use of the "arch:mips" tags.

Alternatively, this test can be run using:

  $ AVOCADO_ALLOW_UNTRUSTED_CODE=yes \
    avocado --show=console run -t arch:mips64el \
      tests/acceptance/boot_linux_console.py
  console: [    0.000000] Linux version 3.19.3.mtoman.20150408 (mtoman@debian-co3-1) (gcc version 5.0.0 20150316 (Red Hat 5.0.0-0.20) (GCC) ) #3 Wed Apr 8 14:32:50 UTC 2015
  console: [    0.000000] Early serial console at I/O port 0x3f8 (options '38400n8')
  console: [    0.000000] bootconsole [uart0] enabled
  console: [    0.000000] CPU0 revision is: 00018900 (MIPS 5KE)
  console: [    0.000000] Checking for the multiply/shift bug... no.
  console: [    0.000000] Checking for the daddiu bug... no.
  [...]
  console: Boot successful.
  console: cat /proc/cpuinfo
  console: / # cat /proc/cpuinfo
  console: system type            : MIPS Malta
  console: machine                        : Unknown
  console: processor              : 0
  console: cpu model              : MIPS 5KE V0.0
  console: : 1616.89
  console: wait instruction       : nouname -a
  console: microsecond timers     : yes
  console: tlb_entries            : 32
  console: extra interrupt vector : yes
  console: hardware watchpoint    : yes, count: 1, address/irw mask: [0x0ff8]
  console: isa                    : mips1 mips2 mips3 mips4 mips5 mips32r1 mips32r2 mips64r1 mips64r2
  console: ASEs implemented       :
  console: shadow register sets   : 1
  console: kscratch registers     : 0
  console: package                        : 0
  console: core                   : 0
  console: VCED exceptions                : not available
  console: VCEI exceptions                : not available
  console: / #
  console: / # uname -a
  console: Linux buildroot 3.19.3.mtoman.20150408 #3 Wed Apr 8 14:32:50 UTC 2015 mips64 GNU/Linux
  console: reboot
  console: / #
  console: / # reboot
  console: / #
  console: / # reboot: Restarting system
  PASS (7.04 s)
  JOB TIME   : 7.20 s

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

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 489df4862c..959d4557c9 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -168,6 +168,47 @@ class BootLinuxConsole(MachineTest):
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
 
+    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
+    def test_mips64el_malta_5KEc_cpio(self):
+        """
+        :avocado: tags=arch:mips64el
+        :avocado: tags=machine:malta
+        :avocado: tags=endian:little
+        """
+        kernel_url = ('https://github.com/philmd/qemu-testing-blob/'
+                      'raw/9ad2df38/mips/malta/mips64el/'
+                      'vmlinux-3.19.3.mtoman.20150408')
+        kernel_hash = '00d1d268fb9f7d8beda1de6bebcc46e884d71754'
+        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+        initrd_url = ('https://github.com/groeck/linux-build-test/'
+                      'raw/8584a59e/rootfs/'
+                      'mipsel64/rootfs.mipsel64r1.cpio.gz')
+        initrd_hash = '1dbb8a396e916847325284dbe2151167'
+        initrd_path_gz = self.fetch_asset(initrd_url, algorithm='md5',
+                                          asset_hash=initrd_hash)
+        initrd_path = self.workdir + "rootfs.cpio"
+        archive.gzip_uncompress(initrd_path_gz, initrd_path)
+
+        self.vm.set_machine('malta')
+        self.vm.set_console()
+        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
+                               + 'console=ttyS0 console=tty '
+                               + 'rdinit=/sbin/init noreboot')
+        self.vm.add_args('-cpu', '5KEc',
+                         '-kernel', kernel_path,
+                         '-initrd', initrd_path,
+                         '-append', kernel_command_line,
+                         '-no-reboot')
+        self.vm.launch()
+        wait_for_console_pattern(self, 'Boot successful.')
+
+        exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
+                                                'MIPS 5KE')
+        exec_command_and_wait_for_pattern(self, 'uname -a',
+                                                '3.19.3.mtoman.20150408')
+        exec_command_and_wait_for_pattern(self, 'reboot',
+                                                'reboot: Restarting system')
+
     def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash):
         kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
         kernel_path = self.workdir + "kernel"
-- 
2.21.0



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

* [PATCH 02/26] Acceptance tests: refactor wait_for_console_pattern
  2019-10-28  7:34 ` [PATCH 02/26] Acceptance tests: refactor wait_for_console_pattern Philippe Mathieu-Daudé
@ 2019-10-28  7:58   ` Aleksandar Markovic
  2019-10-28 15:09     ` Cleber Rosa
  2019-10-28 15:18   ` Cleber Rosa
  1 sibling, 1 reply; 62+ messages in thread
From: Aleksandar Markovic @ 2019-10-28  7:58 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Kamil Rytarowski, Fabien Chouteau,
	qemu-devel, KONRAD Frederic, Wainer dos Santos Moschetta,
	Cleber Rosa, Aleksandar Rikalo, Alex Bennée, Aurelien Jarno,
	David Gibson

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

On Monday, October 28, 2019, Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:

> From: Cleber Rosa <crosa@redhat.com>
>
> 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>
> Message-Id: <20190916164011.7653-1-crosa@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> [PMD: failure_message is optional]
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/acceptance/avocado_qemu/__init__.py | 25 +++++++++++++++++++++
>  tests/acceptance/boot_linux_console.py    | 27 +++++------------------
>  tests/acceptance/linux_ssh_mips_malta.py  | 18 +++------------
>  3 files changed, 33 insertions(+), 37 deletions(-)
>
>

You missed my r-b, that I gave here:

https://lists.gnu.org/archive/html/qemu-devel/2019-10/msg06378.html

A.



> diff --git a/tests/acceptance/avocado_qemu/__init__.py
> b/tests/acceptance/avocado_qemu/__init__.py
> index bd41e0443c..e3101cba30 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,30 @@ def pick_default_qemu_bin(arch=None):
>          return qemu_bin_from_src_dir_path
>
>
> +def wait_for_console_pattern(test, success_message, failure_message=None):
> +    """
> +    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 and 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..8897e0c253 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,14 @@ 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 wait_for_console_pattern(self, success_message):
> +        wait_for_console_pattern(self, success_message,
> +                                 failure_message='Kernel panic - not
> syncing')
>
>      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):
>          """
> diff --git a/tests/acceptance/linux_ssh_mips_malta.py
> b/tests/acceptance/linux_ssh_mips_malta.py
> index aa12001942..fc13f9e4d4 100644
> --- a/tests/acceptance/linux_ssh_mips_malta.py
> +++ b/tests/acceptance/linux_ssh_mips_malta.py
> @@ -13,6 +13,7 @@ import time
>
>  from avocado import skipUnless
>  from avocado_qemu import Test
> +from avocado_qemu import wait_for_console_pattern
>  from avocado.utils import process
>  from avocado.utils import archive
>  from avocado.utils import ssh
> @@ -69,19 +70,6 @@ class LinuxSSH(Test):
>      def setUp(self):
>          super(LinuxSSH, self).setUp()
>
> -    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')
> @@ -137,7 +125,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')
> @@ -145,7 +133,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 ssh_command_output_contains(self, cmd, exp):
>          stdout, _ = self.ssh_command(cmd)
> --
> 2.21.0
>
>
>

[-- Attachment #2: Type: text/html, Size: 9214 bytes --]

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

* Re: [PATCH 03/26] tests/acceptance: Fixe wait_for_console_pattern() hangs
  2019-10-28  7:34 ` [PATCH 03/26] tests/acceptance: Fixe wait_for_console_pattern() hangs Philippe Mathieu-Daudé
@ 2019-10-28  8:01   ` Aleksandar Markovic
  2019-10-28 15:28     ` Cleber Rosa
  2019-10-28 15:24   ` Cleber Rosa
  1 sibling, 1 reply; 62+ messages in thread
From: Aleksandar Markovic @ 2019-10-28  8:01 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, Kamil Rytarowski, Fabien Chouteau,
	qemu-devel, KONRAD Frederic, Wainer dos Santos Moschetta,
	Cleber Rosa, Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

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

On Monday, October 28, 2019, Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:

> Because of a possible deadlock (QEMU waiting for the socket to
> become writable) let's close the console socket as soon as we
> stop to use it.
>
> Suggested-by: Cleber Rosa <crosa@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/acceptance/avocado_qemu/__init__.py | 1 +
>  1 file changed, 1 insertion(+)
>
>
Fixe -> Fix

You missed my r-b again, given in:

https://lists.gnu.org/archive/html/qemu-devel/2019-10/msg06376.html

A.



> diff --git a/tests/acceptance/avocado_qemu/__init__.py
> b/tests/acceptance/avocado_qemu/__init__.py
> index e3101cba30..a0450e5263 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -74,6 +74,7 @@ def wait_for_console_pattern(test, success_message,
> failure_message=None):
>          if success_message in msg:
>              break
>          if failure_message and failure_message in msg:
> +            console.close()
>              fail = 'Failure message found in console: %s' %
> failure_message
>              test.fail(fail)
>
> --
> 2.21.0
>
>
>

[-- Attachment #2: Type: text/html, Size: 1916 bytes --]

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

* [PATCH 26/26] tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpu
  2019-10-28  7:34 ` [PATCH 26/26] tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpu Philippe Mathieu-Daudé
@ 2019-10-28  8:17   ` Aleksandar Markovic
  2019-10-28 22:05     ` Cleber Rosa
  0 siblings, 1 reply; 62+ messages in thread
From: Aleksandar Markovic @ 2019-10-28  8:17 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Kamil Rytarowski, Eduardo Habkost,
	Philippe Mathieu-Daudé,
	Fabien Chouteau, qemu-devel, KONRAD Frederic,
	Wainer dos Santos Moschetta, Cleber Rosa, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

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

On Monday, October 28, 2019, Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:

> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
> This tests boots a Linux kernel on a Malta machine up to a
> busybox shell on the serial console. Few commands are executed
> before halting the machine (via reboot).
>
>

A very nice test.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>


> We use the Fedora 24 kernel extracted from the image at:
> https://fedoraproject.org/wiki/Architectures/MIPS
> and the initrd cpio image from the kerneltests project:
> https://kerneltests.org/
>
> If MIPS is a target being built, "make check-acceptance" will
> automatically include this test by the use of the "arch:mips" tags.
>
> Alternatively, this test can be run using:
>
>   $ AVOCADO_ALLOW_UNTRUSTED_CODE=yes \
>     avocado --show=console run -t arch:mips64el \
>       tests/acceptance/boot_linux_console.py
>   console: [    0.000000] Linux version 3.19.3.mtoman.20150408
> (mtoman@debian-co3-1) (gcc version 5.0.0 20150316 (Red Hat 5.0.0-0.20)
> (GCC) ) #3 Wed Apr 8 14:32:50 UTC 2015
>   console: [    0.000000] Early serial console at I/O port 0x3f8 (options
> '38400n8')
>   console: [    0.000000] bootconsole [uart0] enabled
>   console: [    0.000000] CPU0 revision is: 00018900 (MIPS 5KE)
>   console: [    0.000000] Checking for the multiply/shift bug... no.
>   console: [    0.000000] Checking for the daddiu bug... no.
>   [...]
>   console: Boot successful.
>   console: cat /proc/cpuinfo
>   console: / # cat /proc/cpuinfo
>   console: system type            : MIPS Malta
>   console: machine                        : Unknown
>   console: processor              : 0
>   console: cpu model              : MIPS 5KE V0.0
>   console: : 1616.89
>   console: wait instruction       : nouname -a
>   console: microsecond timers     : yes
>   console: tlb_entries            : 32
>   console: extra interrupt vector : yes
>   console: hardware watchpoint    : yes, count: 1, address/irw mask:
> [0x0ff8]
>   console: isa                    : mips1 mips2 mips3 mips4 mips5 mips32r1
> mips32r2 mips64r1 mips64r2
>   console: ASEs implemented       :
>   console: shadow register sets   : 1
>   console: kscratch registers     : 0
>   console: package                        : 0
>   console: core                   : 0
>   console: VCED exceptions                : not available
>   console: VCEI exceptions                : not available
>   console: / #
>   console: / # uname -a
>   console: Linux buildroot 3.19.3.mtoman.20150408 #3 Wed Apr 8 14:32:50
> UTC 2015 mips64 GNU/Linux
>   console: reboot
>   console: / #
>   console: / # reboot
>   console: / #
>   console: / # reboot: Restarting system
>   PASS (7.04 s)
>   JOB TIME   : 7.20 s
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/acceptance/boot_linux_console.py | 41 ++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
>
> diff --git a/tests/acceptance/boot_linux_console.py
> b/tests/acceptance/boot_linux_console.py
> index 489df4862c..959d4557c9 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -168,6 +168,47 @@ class BootLinuxConsole(MachineTest):
>          exec_command_and_wait_for_pattern(self, 'reboot',
>                                                  'reboot: Restarting
> system')
>
> +    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted
> code')
> +    def test_mips64el_malta_5KEc_cpio(self):
> +        """
> +        :avocado: tags=arch:mips64el
> +        :avocado: tags=machine:malta
> +        :avocado: tags=endian:little
> +        """
> +        kernel_url = ('https://github.com/philmd/qemu-testing-blob/'
> +                      'raw/9ad2df38/mips/malta/mips64el/'
> +                      'vmlinux-3.19.3.mtoman.20150408')
> +        kernel_hash = '00d1d268fb9f7d8beda1de6bebcc46e884d71754'
> +        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> +        initrd_url = ('https://github.com/groeck/linux-build-test/'
> +                      'raw/8584a59e/rootfs/'
> +                      'mipsel64/rootfs.mipsel64r1.cpio.gz')
> +        initrd_hash = '1dbb8a396e916847325284dbe2151167'
> +        initrd_path_gz = self.fetch_asset(initrd_url, algorithm='md5',
> +                                          asset_hash=initrd_hash)
> +        initrd_path = self.workdir + "rootfs.cpio"
> +        archive.gzip_uncompress(initrd_path_gz, initrd_path)
> +
> +        self.vm.set_machine('malta')
> +        self.vm.set_console()
> +        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> +                               + 'console=ttyS0 console=tty '
> +                               + 'rdinit=/sbin/init noreboot')
> +        self.vm.add_args('-cpu', '5KEc',
> +                         '-kernel', kernel_path,
> +                         '-initrd', initrd_path,
> +                         '-append', kernel_command_line,
> +                         '-no-reboot')
> +        self.vm.launch()
> +        wait_for_console_pattern(self, 'Boot successful.')
> +
> +        exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
> +                                                'MIPS 5KE')
> +        exec_command_and_wait_for_pattern(self, 'uname -a',
> +                                                '3.19.3.mtoman.20150408')
> +        exec_command_and_wait_for_pattern(self, 'reboot',
> +                                                'reboot: Restarting
> system')
> +
>      def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash):
>          kernel_path_xz = self.fetch_asset(kernel_url,
> asset_hash=kernel_hash)
>          kernel_path = self.workdir + "kernel"
> --
> 2.21.0
>
>
>

[-- Attachment #2: Type: text/html, Size: 8121 bytes --]

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

* Re: [PATCH 00/26] tests/acceptance: Queue for 4.2
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (25 preceding siblings ...)
  2019-10-28  7:34 ` [PATCH 26/26] tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpu Philippe Mathieu-Daudé
@ 2019-10-28  8:18 ` no-reply
  2019-10-28  9:47 ` no-reply
  27 siblings, 0 replies; 62+ messages in thread
From: no-reply @ 2019-10-28  8:18 UTC (permalink / raw)
  To: philmd
  Cc: fam, kamil, ehabkost, alex.bennee, qemu-devel, chouteau,
	frederic.konrad, wainersm, crosa, aleksandar.rikalo, philmd,
	aurelien

Patchew URL: https://patchew.org/QEMU/20191028073441.6448-1-philmd@redhat.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      block/dmg.o
  CC      block/qcow2.o

Warning, treated as error:
/tmp/qemu-test/src/docs/devel/testing.rst:629:Title underline too short.

The ``avocado_qemu.MachineTest`` base test class
---
  CC      block/snapshot.o
  CC      block/file-win32.o
  CC      block/win32-aio.o
make: *** [Makefile:1001: docs/devel/index.html] Error 2
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 662, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=593cd395ff074aafb34318dfd0384f18', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-md60jpt3/src/docker-src.2019-10-28-04.16.54.10533:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=593cd395ff074aafb34318dfd0384f18
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-md60jpt3/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    1m51.219s
user    0m7.414s


The full log is available at
http://patchew.org/logs/20191028073441.6448-1-philmd@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH 00/26] tests/acceptance: Queue for 4.2
  2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
                   ` (26 preceding siblings ...)
  2019-10-28  8:18 ` [PATCH 00/26] tests/acceptance: Queue for 4.2 no-reply
@ 2019-10-28  9:47 ` no-reply
  27 siblings, 0 replies; 62+ messages in thread
From: no-reply @ 2019-10-28  9:47 UTC (permalink / raw)
  To: philmd
  Cc: fam, kamil, ehabkost, alex.bennee, qemu-devel, chouteau,
	frederic.konrad, wainersm, crosa, aleksandar.rikalo, philmd,
	aurelien

Patchew URL: https://patchew.org/QEMU/20191028073441.6448-1-philmd@redhat.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      qapi/qapi-types-qom.o
  CC      qapi/qapi-types-rdma.o

Warning, treated as error:
/tmp/qemu-test/src/docs/devel/testing.rst:629:Title underline too short.

The ``avocado_qemu.MachineTest`` base test class
-----------------------------------------
  CC      qapi/qapi-types-rocker.o
  CC      qapi/qapi-types-run-state.o
make: *** [Makefile:1001: docs/devel/index.html] Error 2
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 662, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=3d206adaa6b645de8a108a2dcc3ab458', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-b7lu53ds/src/docker-src.2019-10-28-05.45.44.5615:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=3d206adaa6b645de8a108a2dcc3ab458
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-b7lu53ds/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    1m52.008s
user    0m7.962s


The full log is available at
http://patchew.org/logs/20191028073441.6448-1-philmd@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH 01/26] python/qemu/machine: Allow to use other serial consoles than default
  2019-10-28  7:34 ` [PATCH 01/26] python/qemu/machine: Allow to use other serial consoles than default Philippe Mathieu-Daudé
@ 2019-10-28 14:51   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 14:51 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:16AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Currently the QEMU Python module limits the QEMUMachine class to
> use the first serial console.
> 
> Some machines/guest might use another console than the first one as
> the 'boot console'. For example the Raspberry Pi uses the second
> (AUX) console.
> 
> To be able to use the Nth console as default, we simply need to
> connect all the N - 1 consoles to the null chardev.
> 
> Add an index argument, so we can use a specific serial console as
> default.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2:
> - renamed 'console_index', added docstring (Cleber)
> - reworded description (pm215)
> ---
>  python/qemu/machine.py | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/python/qemu/machine.py b/python/qemu/machine.py
> index 128a3d1dc2..6fa68fa35a 100644
> --- a/python/qemu/machine.py
> +++ b/python/qemu/machine.py
> @@ -235,6 +235,8 @@ class QEMUMachine(object):
>                  '-display', 'none', '-vga', 'none']
>          if self._machine is not None:
>              args.extend(['-machine', self._machine])
> +        for i in range(self._console_index):
> +            args.extend(['-serial', 'null'])

This will get executed even when set_console() is never called, so it
will result in an AttributeError because 'self._console_index' does
not exist.

It's also a good practice to define all attributes on __init__(), so
I'd suggest that as a fix.

- Cleber.



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

* Re: [PATCH 02/26] Acceptance tests: refactor wait_for_console_pattern
  2019-10-28  7:58   ` Aleksandar Markovic
@ 2019-10-28 15:09     ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 15:09 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: Fam Zheng, Kamil Rytarowski, Eduardo Habkost, Alex Bennée,
	qemu-devel, Fabien Chouteau, KONRAD Frederic,
	Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Philippe Mathieu-Daudé,
	Aurelien Jarno, David Gibson

On Mon, Oct 28, 2019 at 08:58:01AM +0100, Aleksandar Markovic wrote:
> On Monday, October 28, 2019, Philippe Mathieu-Daudé <philmd@redhat.com>
> wrote:
> 
> > From: Cleber Rosa <crosa@redhat.com>
> >
> > 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>
> > Message-Id: <20190916164011.7653-1-crosa@redhat.com>
> > Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > [PMD: failure_message is optional]
> > Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > ---
> >  tests/acceptance/avocado_qemu/__init__.py | 25 +++++++++++++++++++++
> >  tests/acceptance/boot_linux_console.py    | 27 +++++------------------
> >  tests/acceptance/linux_ssh_mips_malta.py  | 18 +++------------
> >  3 files changed, 33 insertions(+), 37 deletions(-)
> >
> >
> 
> You missed my r-b, that I gave here:
> 
> https://lists.gnu.org/archive/html/qemu-devel/2019-10/msg06378.html
> 
> A.
>

Hi Aleksandar,

I've collected your review, it'll be on my PR.

Thanks!
- Cleber.



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

* Re: [PATCH 02/26] Acceptance tests: refactor wait_for_console_pattern
  2019-10-28  7:34 ` [PATCH 02/26] Acceptance tests: refactor wait_for_console_pattern Philippe Mathieu-Daudé
  2019-10-28  7:58   ` Aleksandar Markovic
@ 2019-10-28 15:18   ` Cleber Rosa
  1 sibling, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 15:18 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Kamil Rytarowski, Wainer dos Santos Moschetta,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno,
	David Gibson

On Mon, Oct 28, 2019 at 08:34:17AM +0100, Philippe Mathieu-Daudé wrote:
> From: Cleber Rosa <crosa@redhat.com>
> 
> 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>
> Message-Id: <20190916164011.7653-1-crosa@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> [PMD: failure_message is optional]
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

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

Thanks,
- Cleber.



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

* Re: [PATCH 03/26] tests/acceptance: Fixe wait_for_console_pattern() hangs
  2019-10-28  7:34 ` [PATCH 03/26] tests/acceptance: Fixe wait_for_console_pattern() hangs Philippe Mathieu-Daudé
  2019-10-28  8:01   ` Aleksandar Markovic
@ 2019-10-28 15:24   ` Cleber Rosa
  1 sibling, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 15:24 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Kamil Rytarowski, Wainer dos Santos Moschetta,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:18AM +0100, Philippe Mathieu-Daudé wrote:
> Because of a possible deadlock (QEMU waiting for the socket to
> become writable) let's close the console socket as soon as we
> stop to use it.
> 
> Suggested-by: Cleber Rosa <crosa@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

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

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

Thanks,
- Cleber.



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

* Re: [PATCH 03/26] tests/acceptance: Fixe wait_for_console_pattern() hangs
  2019-10-28  8:01   ` Aleksandar Markovic
@ 2019-10-28 15:28     ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 15:28 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: Fam Zheng, Kamil Rytarowski, Eduardo Habkost, Alex Bennée,
	qemu-devel, Fabien Chouteau, KONRAD Frederic,
	Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Philippe Mathieu-Daudé,
	Aurelien Jarno

On Mon, Oct 28, 2019 at 09:01:16AM +0100, Aleksandar Markovic wrote:
> On Monday, October 28, 2019, Philippe Mathieu-Daudé <philmd@redhat.com>
> wrote:
> 
> > Because of a possible deadlock (QEMU waiting for the socket to
> > become writable) let's close the console socket as soon as we
> > stop to use it.
> >
> > Suggested-by: Cleber Rosa <crosa@redhat.com>
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > ---
> >  tests/acceptance/avocado_qemu/__init__.py | 1 +
> >  1 file changed, 1 insertion(+)
> >
> >
> Fixe -> Fix
> 
> You missed my r-b again, given in:
> 
> https://lists.gnu.org/archive/html/qemu-devel/2019-10/msg06376.html
> 
> A.
> 

I've collected your review and I'm queuing on my python-next branch
(and sending shortly in a PR).

Thanks,
- Cleber.



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

* Re: [PATCH 04/26] tests/acceptance: Send <carriage return> on serial lines
  2019-10-28  7:34 ` [PATCH 04/26] tests/acceptance: Send <carriage return> on serial lines Philippe Mathieu-Daudé
@ 2019-10-28 15:36   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 15:36 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:19AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Some firmwares don't parse the <Newline> control character and
> expect a <carriage return>.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> since previous: do not send NewLine
> ---
>  tests/acceptance/boot_linux_console.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 8897e0c253..f9b77af359 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -34,7 +34,7 @@ class BootLinuxConsole(Test):
>                                   failure_message='Kernel panic - not syncing')
>  
>      def exec_command_and_wait_for_pattern(self, command, success_message):
> -        command += '\n'
> +        command += '\r'
>          self.vm.console_socket.sendall(command.encode())
>          wait_for_console_pattern(self, success_message)
>  
> -- 
> 2.21.0
> 

Given the discussion on
<d21da354-0c14-5b55-0e87-1a63d246e4ca@amsat.org>, this LGTM.

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

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

Thanks,
- Cleber.



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

* Re: [PATCH 05/26] tests/acceptance: Refactor exec_command_and_wait_for_pattern()
  2019-10-28  7:34 ` [PATCH 05/26] tests/acceptance: Refactor exec_command_and_wait_for_pattern() Philippe Mathieu-Daudé
@ 2019-10-28 15:50   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 15:50 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Kamil Rytarowski, Wainer dos Santos Moschetta,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:20AM +0100, Philippe Mathieu-Daudé wrote:
> Refactor the exec_command_and_wait_for_pattern() utility method
> so we can reuse it in other files.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> v2: fix self -> test, failure_message is optional, added doc
> v3: reword because after rebasing only 1 file has to be modified
> ---
>  tests/acceptance/avocado_qemu/__init__.py | 19 +++++++++++++++++++
>  tests/acceptance/boot_linux_console.py    | 18 +++++++-----------
>  2 files changed, 26 insertions(+), 11 deletions(-)

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

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

Thanks,
- Cleber.



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

* Re: [PATCH 10/26] tests/acceptance: Add test that boots the HelenOS microkernel on Leon3
  2019-10-28  7:34 ` [PATCH 10/26] tests/acceptance: Add test that boots the HelenOS microkernel on Leon3 Philippe Mathieu-Daudé
@ 2019-10-28 16:38   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 16:38 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:25AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Release notes:
> http://www.helenos.org/wiki/Download#HelenOS0.6.0
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  MAINTAINERS                             |  1 +
>  tests/acceptance/machine_sparc_leon3.py | 37 +++++++++++++++++++++++++
>  2 files changed, 38 insertions(+)
>  create mode 100644 tests/acceptance/machine_sparc_leon3.py
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 556ce0bfe3..17ff741c63 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1173,6 +1173,7 @@ S: Maintained
>  F: hw/sparc/leon3.c
>  F: hw/*/grlib*
>  F: include/hw/*/grlib*
> +F: tests/acceptance/machine_sparc_leon3.py
>  
>  S390 Machines
>  -------------
> diff --git a/tests/acceptance/machine_sparc_leon3.py b/tests/acceptance/machine_sparc_leon3.py
> new file mode 100644
> index 0000000000..a1394ba8ad
> --- /dev/null
> +++ b/tests/acceptance/machine_sparc_leon3.py
> @@ -0,0 +1,37 @@
> +# Functional test that boots a Leon3 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
> +

Those imports are not needed.

> +from avocado import skipIf
> +from avocado_qemu import MachineTest
> +
> +
> +class Leon3Machine(MachineTest):

I have some diverging opinions on the test class rename (which I'll
address as responses to the respective patches), so I've tested this
using the original name and implementation (from avocado_qemu import
Test).

> +
> +    timeout = 60
> +
> +    def test_leon3_helenos_uimage(self):
> +        """
> +        :avocado: tags=arch:sparc
> +        :avocado: tags=machine:leon3
> +        :avocado: tags=binfmt:uimage
> +        """
> +        kernel_url = ('http://www.helenos.org/releases/'
> +                      'HelenOS-0.6.0-sparc32-leon3.bin')
> +        kernel_hash = 'a88c9cfdb8430c66650e5290a08765f9bf049a30'
> +        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> +
> +        self.vm.set_machine('leon3_generic')
> +        self.vm.set_console()
> +        self.vm.add_args('-kernel', kernel_path)
> +
> +        self.vm.launch()
> +
> +        wait_for_console_pattern(self,'Copyright (c) 2001-2014 HelenOS project')
> +        wait_for_console_pattern(self,'Booting the kernel ...')

But this needs an import:

from avocado_qemu import wait_for_console_pattern

> -- 
> 2.21.0
> 

The core of the test is good, and I've tested it with the changes
listed above, and it runs reliably.

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

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

Thanks,
- Cleber.



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

* Re: [PATCH 11/26] tests/acceptance: Add test that boots Linux up to BusyBox on Leon3
  2019-10-28  7:34 ` [PATCH 11/26] tests/acceptance: Add test that boots Linux up to BusyBox " Philippe Mathieu-Daudé
@ 2019-10-28 16:47   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 16:47 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:26AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Gaisler provides convenient images:
> https://www.gaisler.com/index.php/downloads/linux
> 
> HOWTO build:
> https://www.gaisler.com/index.php/products/operating-systems/linux
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/acceptance/machine_sparc_leon3.py | 28 +++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/tests/acceptance/machine_sparc_leon3.py b/tests/acceptance/machine_sparc_leon3.py
> index a1394ba8ad..1172fd5da0 100644
> --- a/tests/acceptance/machine_sparc_leon3.py
> +++ b/tests/acceptance/machine_sparc_leon3.py
> @@ -10,6 +10,8 @@ import logging
>  
>  from avocado import skipIf
>  from avocado_qemu import MachineTest
> +from avocado_qemu import wait_for_console_pattern
> +from avocado_qemu import exec_command_and_wait_for_pattern
>  
>  
>  class Leon3Machine(MachineTest):
> @@ -35,3 +37,29 @@ class Leon3Machine(MachineTest):
>  
>          wait_for_console_pattern(self,'Copyright (c) 2001-2014 HelenOS project')
>          wait_for_console_pattern(self,'Booting the kernel ...')
> +
> +    def test_leon3_linux_kernel_4_9_busybox(self):
> +        """
> +        :avocado: tags=arch:sparc
> +        :avocado: tags=machine:leon3
> +        """
> +        kernel_url = ('https://www.gaisler.com/anonftp/linux/linux-4/images/'
> +                     'leon-linux-4.9/leon-linux-4.9-1.0/up/image.ram')
> +        kernel_hash = '289bd1bcca10cda76d0ef2264a8657adc251f5f5'
> +        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> +
> +        self.vm.set_machine('leon3_generic')
> +        self.vm.set_console()
> +        self.vm.add_args('-kernel', kernel_path)
> +
> +        self.vm.launch()
> +
> +        wait_for_console_pattern(self, 'TYPE: Leon3 System-on-a-Chip')
> +
> +        wait_for_console_pattern(self, 'Welcome to Buildroot')
> +
> +        wait_for_console_pattern(self, 'buildroot login:')
> +        exec_command_and_wait_for_pattern(self, 'root', '#')

On my testing, I never got passed this point (the prompt after the
username is never received/acknowledged).

> +        uname = 'Linux buildroot 4.9.54-00018-g62dab2c #2 ' \
> +                'Wed Oct 18 09:45:51 CEST 2017 sparc GNU/Linux'

A matter of style, certainly, but I find this better:

        uname = ('Linux buildroot 4.9.54-00018-g62dab2c #2 '
                 'Wed Oct 18 09:45:51 CEST 2017 sparc GNU/Linux')

- Cleber.

> +        exec_command_and_wait_for_pattern(self, 'uname -a', uname)
> -- 
> 2.21.0
> 



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

* Re: [PATCH 12/26] .travis.yml: Let the avocado job run the Leon3 test
  2019-10-28  7:34 ` [PATCH 12/26] .travis.yml: Let the avocado job run the Leon3 test Philippe Mathieu-Daudé
@ 2019-10-28 16:50   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 16:50 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:27AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

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

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

Thanks,
- Cleber.



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

* Re: [PATCH 13/26] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p
  2019-10-28  7:34 ` [PATCH 13/26] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p Philippe Mathieu-Daudé
@ 2019-10-28 16:56   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 16:56 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Hervé Poussineau,
	Wainer dos Santos Moschetta, Artyom Tarasenko, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno, David Gibson

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

File name in patch is ppc_prep_40p.py.

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

logging module is not used here.

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

With the import and name changes above:

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

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

Thanks,
- Cleber.



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

* Re: [PATCH 14/26] tests/acceptance: Test Open Firmware on the PReP/40p
  2019-10-28  7:34 ` [PATCH 14/26] tests/acceptance: Test Open Firmware on the PReP/40p Philippe Mathieu-Daudé
@ 2019-10-28 17:47   ` Cleber Rosa
  2019-10-28 18:45     ` Cleber Rosa
  0 siblings, 1 reply; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 17:47 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Artyom Tarasenko,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno,
	David Gibson

On Mon, Oct 28, 2019 at 08:34:29AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> User case from:
> https://tyom.blogspot.com/2019/04/aixprep-under-qemu-how-to.html
> 
> Acked-by: David Gibson <david@gibson.dropbear.id.au>
> Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
> Tested-by: Cleber Rosa <crosa@redhat.com>
> Reviewed-by: Cleber Rosa <crosa@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v3: use avocado_qemu.wait_for_console_pattern (Cleber)
> ---
>  tests/acceptance/ppc_prep_40p.py | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 

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

Thanks,
- Cleber.



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

* Re: [PATCH 15/26] tests/acceptance: Test OpenBIOS on the PReP/40p
  2019-10-28  7:34 ` [PATCH 15/26] tests/acceptance: Test OpenBIOS " Philippe Mathieu-Daudé
@ 2019-10-28 18:41   ` Cleber Rosa
  2019-10-28 22:00     ` Cleber Rosa
  0 siblings, 1 reply; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 18:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno, David Gibson

On Mon, Oct 28, 2019 at 08:34:30AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> User case from:
> https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
> 
> Acked-by: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v3:
> - use avocado_qemu.wait_for_console_pattern (Cleber)
> - use MD5 hash
> ---

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

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

Thanks,
- Cleber.



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

* Re: [PATCH 14/26] tests/acceptance: Test Open Firmware on the PReP/40p
  2019-10-28 17:47   ` Cleber Rosa
@ 2019-10-28 18:45     ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 18:45 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Artyom Tarasenko,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno,
	David Gibson

On Mon, Oct 28, 2019 at 01:48:01PM -0400, Cleber Rosa wrote:
> On Mon, Oct 28, 2019 at 08:34:29AM +0100, Philippe Mathieu-Daudé wrote:
> > From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > 
> > User case from:
> > https://tyom.blogspot.com/2019/04/aixprep-under-qemu-how-to.html
> > 
> > Acked-by: David Gibson <david@gibson.dropbear.id.au>
> > Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
> > Tested-by: Cleber Rosa <crosa@redhat.com>
> > Reviewed-by: Cleber Rosa <crosa@redhat.com>
> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > ---
> > v3: use avocado_qemu.wait_for_console_pattern (Cleber)
> > ---
> >  tests/acceptance/ppc_prep_40p.py | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> > 
> 
> Queuing on my python-next branch (and sending shortly in a PR).
> 
> Thanks,
> - Cleber.

Actually, this test is (now?) failing once every 3 times on my system.
I'm pulling this one for now.

Sorry about the noise.
- Cleber.



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

* Re: [PATCH 16/26] tests/acceptance: Test Sandalfoot initrd on the PReP/40p
  2019-10-28  7:34 ` [PATCH 16/26] tests/acceptance: Test Sandalfoot initrd " Philippe Mathieu-Daudé
@ 2019-10-28 19:08   ` Cleber Rosa
  2021-12-03 10:09     ` Cédric Le Goater
  0 siblings, 1 reply; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 19:08 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno, David Gibson

On Mon, Oct 28, 2019 at 08:34:31AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> User case from:
> https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
> 
> Sandalfoot info:
> http://www.juneau-lug.org/sandalfoot.php
> 
> Acked-by: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v3:
> - use avocado_qemu.wait_for_console_pattern (Cleber)
> - use exec_command_and_wait_for_pattern
> - check getenv(AVOCADO_ALLOW_UNTRUSTED_CODE) (pm215)
> ---
>  tests/acceptance/ppc_prep_40p.py | 31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
> index b4109a7af3..c5ecabf52f 100644
> --- a/tests/acceptance/ppc_prep_40p.py
> +++ b/tests/acceptance/ppc_prep_40p.py
> @@ -11,6 +11,7 @@ import logging
>  from avocado import skipIf
>  from avocado import skipUnless
>  from avocado_qemu import MachineTest
> +from avocado_qemu import exec_command_and_wait_for_pattern
>  from avocado_qemu import wait_for_console_pattern
>  
>  
> @@ -101,3 +102,33 @@ class IbmPrep40pMachine(MachineTest):
>  
>          self.vm.launch()
>          wait_for_console_pattern(self, 'NetBSD/prep BOOT, Revision 1.9')
> +
> +    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
> +    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()
> +        wait_for_console_pattern(self, 'Now booting the kernel')

I could never get past this point.  Any ideas?

- Cleber.

> +
> +        msg = 'Please press Enter to activate this console.'
> +        wait_for_console_pattern(self, msg)
> +
> +        version = 'BusyBox v0.60.0 (2001.08.19-09:26+0000) Built-in shell (ash)'
> +        exec_command_and_wait_for_pattern(self, '', version)
> +
> +        uname = 'Linux ppc 2.4.18 #5 Wed May 21 23:50:43 AKDT 2003 ppc unknown'
> +        exec_command_and_wait_for_pattern(self, 'uname -a', uname)
> +
> +        cpu = 'PReP IBM 6015/7020 (Sandalfoot/Sandalbow)'
> +        exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', cpu)
> -- 
> 2.21.0
> 



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

* Re: [PATCH 17/26] .travis.yml: Let the avocado job run the 40p tests
  2019-10-28  7:34 ` [PATCH 17/26] .travis.yml: Let the avocado job run the 40p tests Philippe Mathieu-Daudé
@ 2019-10-28 19:25   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 19:25 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:32AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Acked-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

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



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

* Re: [PATCH 18/26] tests/boot_console: Test booting HP-UX firmware upgrade
  2019-10-28  7:34 ` [PATCH 18/26] tests/boot_console: Test booting HP-UX firmware upgrade Philippe Mathieu-Daudé
@ 2019-10-28 20:09   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 20:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, Sven Schnelle,
	qemu-devel, Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:33AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Add a test which boots a HP-UX firmware upgrade CD-ROM.
> It exercise the PCI LSI53C895A SCSI controller.
> 
> The ISO image comes from:
> https://web.archive.org/web/20101204061612/http://ftp.parisc-linux.org/kernels/712/PF_C7120023
> 
> This test is very quick, less than 3s:
> 
>   $ AVOCADO_ALLOW_UNTRUSTED_CODE=yes \
>     avocado --show=app,console run -t arch:hppa \
>       tests/acceptance/boot_linux_console.py
>   console: Firmware Version 6.1
>   console: Duplex Console IO Dependent Code (IODC) revision 1
>   console: Memory Test/Initialization Completed
>   console: ------------------------------------------------------------------------------
>   console: (c) Copyright 2017-2018 Helge Deller <deller@gmx.de> and SeaBIOS developers.
>   console: ------------------------------------------------------------------------------
>   console: Processor   Speed            State           Coprocessor State  Cache Size
>   console: ---------  --------   ---------------------  -----------------  ----------
>   console: 0      250 MHz    Active                 Functional            0 KB
>   console: Available memory:     512 MB
>   console: Good memory required: 16 MB
>   console: Primary boot path:    FWSCSI.0.0
>   console: Alternate boot path:  FWSCSI.2.0
>   console: Console path:         SERIAL_1.9600.8.none
>   console: Keyboard path:        PS2
>   console: Available boot devices:
>   console: 1. DVD/CD [lsi 00:00.0 2:0 Drive QEMU QEMU CD-ROM 2.5+]
>   console: Booting from DVD/CD [lsi 00:00.0 2:0 Drive QEMU QEMU CD-ROM 2.5+]
>   console: Booting...
>   console: Boot IO Dependent Code (IODC) revision 153
>   console: HARD Booted.
>   console: ISL Revision A.00.25 November 18, 1992
>   console: ISL booting  ODE UPDATE ; stable off ; RUN
>   console: Loading...
>   console: ***************************************************************************
>   console: ******                                                               ******
>   console: ******             Offline Diagnostic Environment                    ******
>   console: ******                                                               ******
>   console: ******      (C) Copyright Hewlett-Packard Co 1993                    ******
>   console: ******                    All Rights Reserved                        ******
>   console: ******                                                               ******
>   console: ******  HP shall not be liable for any damages resulting from the    ******
>   console: ******  use of this program.                                         ******
>   console: ******                                                               ******
>   console: ******                TC  Version A.00.15                            ******
>   console: ******                SysLib Version A.00.44                         ******
>   console: ******                                                               ******
>   console: ***************************************************************************
>   console: Type HELP for command information.
>   console: ISL_CMD> UPDATE ; stable off ; RUN
>   console: ***************************************************************************
>   console: ******                                                               ******
>   console: ******                           PDC UPDATER                         ******
>   console: ******                                                               ******
>   console: ******    Copyright (C) 1993, 1994, 1995 by Hewlett-Packard Company  ******
>   console: ******                         Version A.00.19                       ******
>   console: ******                                                               ******
>   console: ***************************************************************************
>   console: Type HELP for command information.
>   console: Stable Storage will NOT be updated
>   console: STARTING EXECUTION OF UPDATE
>   console: Unrecognized MODEL TYPE = 502
>   console: ERROR 0001
>   console: UPDATE PAUSED> exit
>   console: UPDATE>
>   console: UPDATE> ls
>   console: Modules on this boot media are:
>   console: filename    type    size     created   description
>   console: -----------------------------------------------------------------------------
>   console: DAGGER      DATA    118      96/02/15  ?
>   console: IMAGE1A     DATA    512      96/02/15  ?
>   console: IMAGE1B     DATA    388      96/02/15  ?
>   console: UPDATE> exit
>   console: THIS UTILITY WILL NOW RESET THE SYSTEM.....
>   PASS (2.39 s)
>   JOB TIME   : 2.54 s
> 
> Suggested-by: Sven Schnelle <svens@stackframe.org>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2:
> - check getenv(AVOCADO_ALLOW_UNTRUSTED_CODE) (pm215)
> 
> I know this is not a 'Linux' test, but all our console functions
> reside in this file and I don't want to duplicate again.
> Maybe we could rename this file as 'boot_console_tests.py' or
> extract the console related functions.
> ---
>  tests/acceptance/boot_linux_console.py | 27 ++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index f94dc4bbca..67b396169b 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -13,6 +13,7 @@ import lzma
>  import gzip
>  import shutil
>  
> +from avocado import skipUnless
>  from avocado_qemu import MachineTest
>  from avocado_qemu import exec_command_and_wait_for_pattern
>  from avocado_qemu import wait_for_console_pattern
> @@ -357,3 +358,29 @@ class BootLinuxConsole(MachineTest):
>          self.vm.launch()
>          console_pattern = 'Kernel command line: %s' % kernel_command_line
>          self.wait_for_console_pattern(console_pattern)
> +
> +    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
> +    def test_hppa_fwupdate(self):
> +        """
> +        :avocado: tags=arch:hppa
> +        :avocado: tags=device:lsi53c895a
> +        """
> +        cdrom_url = ('https://github.com/philmd/qemu-testing-blob/raw/ec1b741/'
> +                     'hppa/hp9000/712/C7120023.frm')
> +        cdrom_hash = '17944dee46f768791953009bcda551be5ab9fac9'
> +        cdrom_path = self.fetch_asset(cdrom_url, asset_hash=cdrom_hash)
> +
> +        self.vm.set_console()
> +        self.vm.add_args('-cdrom', cdrom_path,
> +                         '-boot', 'd',
> +                         '-no-reboot')
> +        self.vm.launch()
> +        self.wait_for_console_pattern('Unrecognized MODEL TYPE = 502')
> +
> +        exec_command_and_wait_for_pattern(self, 'exit',
> +                                                'UPDATE>')

OK, so this also gets stuck (like the previous tests I mentioned that
wouldn't get passed a given "prompt" point).  Adding a newline to the
command (in addition to the carriage return) does the trick, that is:

---

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index bdece76723..6fdb308a6e 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -93,7 +93,7 @@ def exec_command_and_wait_for_pattern(test, command,
     :param success_message: if this message appears, test succeeds
     :param failure_message: if this message appears, test fails
     """
-    command += '\r'
+    command += '\n\r'
     test.vm.console_socket.sendall(command.encode())
     wait_for_console_pattern(test, success_message, failure_message)
 

---

I'm guessing that different systems will interpret the end of
line differently.  Any other ideas?

- Cleber.

> +        exec_command_and_wait_for_pattern(self, 'ls',
> +                                                'IMAGE1B')
> +        exec_command_and_wait_for_pattern(self, 'exit',
> +                                                'THIS UTILITY WILL NOW '
> +                                                'RESET THE SYSTEM.....')
> -- 
> 2.21.0
> 



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

* Re: [PATCH 19/26] tests/boot_linux_console: Use Avocado archive::gzip_uncompress()
  2019-10-28  7:34 ` [PATCH 19/26] tests/boot_linux_console: Use Avocado archive::gzip_uncompress() Philippe Mathieu-Daudé
@ 2019-10-28 20:13   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 20:13 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:34AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Avocado 67.0 [*] introduced the avocado.utils.archive module which
> provides handling of gzip files. Use the gzip_uncompress() method.
> 
> [*] https://avocado-framework.readthedocs.io/en/67.0/api/utils/avocado.utils.html#avocado.utils.archive.gzip_uncompress
> 
> Suggested-by: Cleber Rosa <crosa@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

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

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

Thanks,
- Cleber.



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

* Re: [PATCH 20/26] tests/boot_linux_console: Add a test for the Raspberry Pi 2
  2019-10-28  7:34 ` [PATCH 20/26] tests/boot_linux_console: Add a test for the Raspberry Pi 2 Philippe Mathieu-Daudé
@ 2019-10-28 20:24   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 20:24 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:35AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Similar to the x86_64/pc test, it boots a Linux kernel on a raspi2
> board and verify the serial is working.
> 
> The kernel image and DeviceTree blob are built by the Raspbian
> project (based on Debian):
> https://www.raspbian.org/RaspbianImages
> as recommended by the Raspberry Pi project:
> https://www.raspberrypi.org/downloads/raspbian/
> 
> If ARM is a target being built, "make check-acceptance" will
> automatically include this test by the use of the "arch:arm" tags.
> 
> Alternatively, this test can be run using:
> 
>     $ avocado run -t arch:arm tests/acceptance
>     $ avocado run -t machine:raspi2 tests/acceptance
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Cleber Rosa <crosa@redhat.com>
> Tested-by: Cleber Rosa <crosa@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

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

Thanks,
- Cleber.



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

* Re: [PATCH 21/26] tests/boot_linux_console: Test the raspi2 UART1 (16550 based)
  2019-10-28  7:34 ` [PATCH 21/26] tests/boot_linux_console: Test the raspi2 UART1 (16550 based) Philippe Mathieu-Daudé
@ 2019-10-28 20:30   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 20:30 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:36AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> The current do_test_arm_raspi2() case tests the PL011 UART0.
> Our model also supports the AUX UART (16550 based).
> We can very simply test the UART1 with Linux, modifying the
> kernel command line.
> 
> Add few lines to expand our previous test and cover the AUX
> UART.
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Cleber Rosa <crosa@redhat.com>
> Tested-by: Cleber Rosa <crosa@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/acceptance/boot_linux_console.py | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index cc0c73b9c1..1c9ff2bda3 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -301,6 +301,7 @@ class BootLinuxConsole(MachineTest):
>          """
>          serial_kernel_cmdline = {
>              0: 'earlycon=pl011,0x3f201000 console=ttyAMA0',
> +            1: 'earlycon=uart8250,mmio32,0x3f215040 console=ttyS1,115200'
>          }
>          deb_url = ('http://archive.raspberrypi.org/debian/'
>                     'pool/main/r/raspberrypi-firmware/'
> @@ -311,7 +312,7 @@ class BootLinuxConsole(MachineTest):
>          dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb')
>  
>          self.vm.set_machine('raspi2')
> -        self.vm.set_console()
> +        self.vm.set_console(console_index=uart_id)

While this was tested and looks good by itself, it depends on a
solution to the problem responded on
<20191028073441.6448-2-philmd@redhat.com>.

- Cleber.



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

* Re: [PATCH 22/26] tests/boot_linux_console: Boot Linux and run few commands on raspi3
  2019-10-28  7:34 ` [PATCH 22/26] tests/boot_linux_console: Boot Linux and run few commands on raspi3 Philippe Mathieu-Daudé
@ 2019-10-28 20:47   ` Cleber Rosa
  2019-10-28 20:48   ` Cleber Rosa
  1 sibling, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 20:47 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:37AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Add a test which boots Linux and run basic commands using the serial
> port console.
> 
> The kernel image is built by the Debian project:
> https://wiki.debian.org/RaspberryPi
> 
> The DeviceTree blob comes from the official Raspberry Pi project:
> https://www.raspberrypi.org/
> 
> The cpio image used comes from the linux-build-test project:
> https://github.com/groeck/linux-build-test
> 
> This test can be run using:
> 
>   $ avocado run --show=console,app run -t machine:raspi3 tests/acceptance
>   console: [    0.000000] Linux version 4.14.0-3-arm64 (debian-kernel@lists.debian.org) (gcc version 7.2.0 (Debian 7.2.0-18)) #1 SMP Debian 4.14.12-2 (2018-01-06)
>   console: [    0.000000] Boot CPU: AArch64 Processor [410fd034]
>   console: [    0.000000] Machine model: Raspberry Pi 3 Model B
>   console: [    0.000000] earlycon: pl11 at MMIO 0x000000003f201000 (options '')
>   console: [    0.000000] bootconsole [pl11] enabled
>   [...]
>   console: Starting network: OK
>   console: Found console ttyAMA0
>   console: Boot successful.
>   console: / # cat /proc/cpuinfo
>   console: processor      : 0
>   console: BogoMIPS       : 125.00
>   console: r      : 0x41
>   console: CPU architecture: 8
>   console: CPU variant
>   console: : 0x0
>   console: CPU part       : 0xd03
>   console: CPU revision   : 4
>   console: / # uname -a
>   console: Linux buildroot 4.14.0-3-arm64 #1 SMP Debian 4.14.12-2 (2018-01-06) aarch64 GNU/Linux
>   console: reboot
>   console: / # reboot
>   console: / # Found console ttyAMA0
>   console: Stopping network: OK
>   console: Saving random seed... done.
>   console: Stopping logging: OK
>   console: umount: devtmpfs busy - remounted read-only
>   console: umount: can't unmount /: Invalid argument
>   console: The system is going down NOW!
>   console: Sent SIGTERM to all processes
>   console: Sent SIGKILL to all processes
>   console: Requesting system reboot
>   console: kvm: exiting hardware virtualization
>   console: reboot: Restarting system
>   PASS (11.08 s)
> 
> Reviewed-by: Cleber Rosa <crosa@redhat.com>
> Tested-by: Cleber Rosa <crosa@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2: Use archive.gzip_uncompress (Cleber)
> 
> some chars are scrambled on the console?
> Cleber ran this 100 times and doesn't have issue.
> ---

Now, I'm not getting good vibes from this test.  It spawns QEMU and
then gets stuck on every single execution.

VM launch command: 'aarch64-softmmu/qemu-system-aarch64 -chardev socket,id=mon,path=/var/tmp/tmpgpee0g1h/qemu-23397-monitor.sock -mon chardev=mon,mode=control -display none -vga none -machine raspi3 -chardev socket,id=console,path=/var/tmp/tmpgpee0g1h/qemu-23397-console.sock,server,nowait -serial chardev:console -kernel /var/tmp/avocado_7ks9sppd/avocado_job_wsp2727i/1-tests_acceptance_boot_linux_console.py_BootLinuxConsole.test_arm_raspi3_initrd_uart0/boot/vmlinuz-4.14.0-3-arm64 -dtb /home/cleber/avocado/data/cache/by_location/cd5c65e442f2375a87c174b91963be739bcdae77/bcm2710-rpi-3-b.dtb -initrd /var/tmp/avocado_7ks9sppd/avocado_job_wsp2727i/1-tests_acceptance_boot_linux_console.py_BootLinuxConsole.test_arm_raspi3_initrd_uart0rootfs.cpio -append printk.time=0 earlycon=pl011,0x3f201000 console=ttyAMA0 panic=-1 noreboot -no-reboot'
>>> {'execute': 'qmp_capabilities'}
<<< {'return': {}}

Given that I've tested this before, and I see some changes to raspi3
since then, I'll try to bisect the possible culprit.  If you have any
clues, they would be much appreciated.

- Cleber.



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

* Re: [PATCH 22/26] tests/boot_linux_console: Boot Linux and run few commands on raspi3
  2019-10-28  7:34 ` [PATCH 22/26] tests/boot_linux_console: Boot Linux and run few commands on raspi3 Philippe Mathieu-Daudé
  2019-10-28 20:47   ` Cleber Rosa
@ 2019-10-28 20:48   ` Cleber Rosa
  1 sibling, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 20:48 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:37AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Add a test which boots Linux and run basic commands using the serial
> port console.
> 
> The kernel image is built by the Debian project:
> https://wiki.debian.org/RaspberryPi
> 
> The DeviceTree blob comes from the official Raspberry Pi project:
> https://www.raspberrypi.org/
> 
> The cpio image used comes from the linux-build-test project:
> https://github.com/groeck/linux-build-test
> 
> This test can be run using:
> 
>   $ avocado run --show=console,app run -t machine:raspi3 tests/acceptance
>   console: [    0.000000] Linux version 4.14.0-3-arm64 (debian-kernel@lists.debian.org) (gcc version 7.2.0 (Debian 7.2.0-18)) #1 SMP Debian 4.14.12-2 (2018-01-06)
>   console: [    0.000000] Boot CPU: AArch64 Processor [410fd034]
>   console: [    0.000000] Machine model: Raspberry Pi 3 Model B
>   console: [    0.000000] earlycon: pl11 at MMIO 0x000000003f201000 (options '')
>   console: [    0.000000] bootconsole [pl11] enabled
>   [...]
>   console: Starting network: OK
>   console: Found console ttyAMA0
>   console: Boot successful.
>   console: / # cat /proc/cpuinfo
>   console: processor      : 0
>   console: BogoMIPS       : 125.00
>   console: r      : 0x41
>   console: CPU architecture: 8
>   console: CPU variant
>   console: : 0x0
>   console: CPU part       : 0xd03
>   console: CPU revision   : 4
>   console: / # uname -a
>   console: Linux buildroot 4.14.0-3-arm64 #1 SMP Debian 4.14.12-2 (2018-01-06) aarch64 GNU/Linux
>   console: reboot
>   console: / # reboot
>   console: / # Found console ttyAMA0
>   console: Stopping network: OK
>   console: Saving random seed... done.
>   console: Stopping logging: OK
>   console: umount: devtmpfs busy - remounted read-only
>   console: umount: can't unmount /: Invalid argument
>   console: The system is going down NOW!
>   console: Sent SIGTERM to all processes
>   console: Sent SIGKILL to all processes
>   console: Requesting system reboot
>   console: kvm: exiting hardware virtualization
>   console: reboot: Restarting system
>   PASS (11.08 s)
> 
> Reviewed-by: Cleber Rosa <crosa@redhat.com>
> Tested-by: Cleber Rosa <crosa@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2: Use archive.gzip_uncompress (Cleber)
> 
> some chars are scrambled on the console?
> Cleber ran this 100 times and doesn't have issue.
> ---
>  tests/acceptance/boot_linux_console.py | 48 ++++++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
> 
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 1c9ff2bda3..dc27d79199 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -338,6 +338,54 @@ class BootLinuxConsole(MachineTest):
>          """
>          self.do_test_arm_raspi2(1)
>  
> +    def test_arm_raspi3_initrd_uart0(self):
> +        """
> +        :avocado: tags=arch:aarch64
> +        :avocado: tags=machine:raspi3
> +        """
> +        deb_url = ('https://snapshot.debian.org/archive/debian/'
> +                   '20180106T174014Z/pool/main/l/linux/'
> +                   'linux-image-4.14.0-3-arm64_4.14.12-2_arm64.deb')
> +        deb_hash = 'e71c995de57921921895c1162baea5df527d1c6b'
> +        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> +        kernel_path = self.extract_from_deb(deb_path,
> +                                            '/boot/vmlinuz-4.14.0-3-arm64')
> +
> +        dtb_url = ('https://github.com/raspberrypi/firmware/raw/'
> +                   '1.20180313/boot/bcm2710-rpi-3-b.dtb')
> +        dtb_hash = 'eb14d67133401ef2f93523be7341456d38bfc077'
> +        dtb_path = self.fetch_asset(dtb_url, asset_hash=dtb_hash)
> +
> +        initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> +                      '9b6b392ea7bc15f0d6632328d429d31c9c6273da/rootfs/'
> +                      'arm64/rootfs.cpio.gz')
> +        initrd_hash = '6fd05324f17bb950196b5ad9d3a0fa996339f4cd'
> +        initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
> +        initrd_path = self.workdir + "rootfs.cpio"
> +        archive.gzip_uncompress(initrd_path_gz, initrd_path)
> +
> +        self.vm.set_machine('raspi3')
> +        self.vm.set_console()
> +        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
> +                               'earlycon=pl011,0x3f201000 console=ttyAMA0 ' +
> +                               'panic=-1 noreboot')
> +        self.vm.add_args('-kernel', kernel_path,
> +                         '-dtb', dtb_path,
> +                         '-initrd', initrd_path,
> +                         '-append', kernel_command_line,
> +                         '-no-reboot')
> +        self.vm.launch()
> +
> +        self.wait_for_console_pattern('Boot successful.',
> +                                      failure_message='-----[ cut here ]-----')
> +

With the previous refactors to wait_for_console_pattern(), this should become:

        wait_for_console_pattern(self,
                                 'Boot successful.',
                                 failure_message='-----[ cut here ]-----')

- Cleber.



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

* Re: [PATCH 23/26] tests/boot_linux_console: Test SDHCI and termal sensor on raspi3
  2019-10-28  7:34 ` [PATCH 23/26] tests/boot_linux_console: Test SDHCI and termal sensor " Philippe Mathieu-Daudé
@ 2019-10-28 20:54   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 20:54 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:38AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Add a test which loads the root filesystem on a SD card.
> Use a kernel recent enough to also test the thermal sensor.
> 
> The kernel image comes from:
> https://github.com/sakaki-/bcmrpi3-kernel#description
> 
> The cpio image used comes from the linux-build-test project:
> https://github.com/groeck/linux-build-test
> 
> Reviewed-by: Cleber Rosa <crosa@redhat.com>
> Tested-by: Cleber Rosa <crosa@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2: Use archive.gzip_uncompress (Cleber)
> ---
>  tests/acceptance/boot_linux_console.py | 46 ++++++++++++++++++++++++++
>  1 file changed, 46 insertions(+)
> 
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index dc27d79199..44a046bd64 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -386,6 +386,52 @@ class BootLinuxConsole(MachineTest):
>          exec_command_and_wait_for_pattern(self, 'reboot',
>                                                  'reboot: Restarting system')
>  
> +    def test_arm_raspi3_initrd_sd_temp(self):
> +        """
> +        :avocado: tags=arch:aarch64
> +        :avocado: tags=machine:raspi3
> +        """
> +        tarball_url = ('https://github.com/sakaki-/bcmrpi3-kernel/releases/'
> +                       'download/4.19.71.20190910/'
> +                       'bcmrpi3-kernel-4.19.71.20190910.tar.xz')
> +        tarball_hash = '844f117a1a6de0532ba92d2a7bceb5b2acfbb298'
> +        tarball_path = self.fetch_asset(tarball_url, asset_hash=tarball_hash)
> +        archive.extract(tarball_path, self.workdir)
> +        dtb_path    = self.workdir + "/boot/bcm2837-rpi-3-b.dtb"
> +        kernel_path = self.workdir + "/boot/kernel8.img"
> +
> +        rootfs_url = ('https://github.com/groeck/linux-build-test/raw/'
> +                      '9b6b392ea7bc15f0d6632328d429d31c9c6273da/rootfs/'
> +                      'arm64/rootfs.ext2.gz')
> +        rootfs_hash = 'dbe4136f0b4a0d2180b93fd2a3b9a784f9951d10'
> +        rootfs_path_gz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
> +        rootfs_path = self.workdir + "rootfs.ext2"
> +        archive.gzip_uncompress(rootfs_path_gz, rootfs_path)
> +
> +        self.vm.set_machine('raspi3')
> +        self.vm.set_console()
> +        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
> +                               'earlycon=pl011,0x3f201000 console=ttyAMA0 ' +
> +                               'root=/dev/mmcblk0 rootwait rw ' +
> +                               'panic=-1 noreboot')
> +        self.vm.add_args('-kernel', kernel_path,
> +                         '-dtb', dtb_path,
> +                         '-append', kernel_command_line,
> +                         '-drive', 'file=' + rootfs_path + ',if=sd,format=raw',
> +                         '-no-reboot')
> +        self.vm.launch()
> +
> +        self.wait_for_console_pattern('Boot successful.',
> +                                      failure_message='-----[ cut here ]-----')
> +

Same here as in previous patch, that is:

        wait_for_console_pattern(self,
                                 'Boot successful.',
                                 failure_message='-----[ cut here ]-----')

Also, I'm getting the same experience, that is it gets stuck...

VM launch command: 'aarch64-softmmu/qemu-system-aarch64 -chardev socket,id=mon,path=/var/tmp/tmpi8x47vvd/qemu-25605-monitor.sock -mon chardev=mon,mode=control -display none -vga none -machine raspi3 -chardev socket,id=console,path=/var/tmp/tmpi8x47vvd/qemu-25605-console.sock,server,nowait -serial chardev:console -kernel /var/tmp/avocado_lfnakl9r/avocado_job_t5whwper/1-tests_acceptance_boot_linux_console.py_BootLinuxConsole.test_arm_raspi3_initrd_sd_temp/boot/kernel8.img -dtb /var/tmp/avocado_lfnakl9r/avocado_job_t5whwper/1-tests_acceptance_boot_linux_console.py_BootLinuxConsole.test_arm_raspi3_initrd_sd_temp/boot/bcm2837-rpi-3-b.dtb -append printk.time=0 earlycon=pl011,0x3f201000 console=ttyAMA0 root=/dev/mmcblk0 rootwait rw panic=-1 noreboot -drive file=/var/tmp/avocado_lfnakl9r/avocado_job_t5whwper/1-tests_acceptance_boot_linux_console.py_BootLinuxConsole.test_arm_raspi3_initrd_sd_temprootfs.ext2,if=sd,format=raw -no-reboot'
 >>> {'execute': 'qmp_capabilities'}
 <<< {'return': {}}

... right here.

- Cleber.



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

* Re: [PATCH 24/26] tests/boot_linux_console: Add initrd test for the Exynos4210
  2019-10-28  7:34 ` [PATCH 24/26] tests/boot_linux_console: Add initrd test for the Exynos4210 Philippe Mathieu-Daudé
@ 2019-10-28 21:40   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 21:40 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:39AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> This test boots a Linux kernel on a smdkc210 board and verify
> the serial output is working.
> 
> The cpio image used comes from the linux-build-test project:
> https://github.com/groeck/linux-build-test
> 
> If ARM is a target being built, "make check-acceptance" will
> automatically include this test by the use of the "arch:arm" tags.
> 
> This test can be run using:
> 
>   $ IGNORE_AVOCADO_CONSOLE_BUG=yes \
>     avocado --show=app,console run -t machine:smdkc210 \
>       tests/acceptance/boot_linux_console.py
>   console: Booting Linux on physical CPU 0x900
>   console: Linux version 4.19.0-6-armmp (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20)
>   console: CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c5387d
>   console: CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
>   console: OF: fdt: Machine model: Samsung smdkv310 evaluation board based on Exynos4210
>   [...]
>   console: Samsung CPU ID: 0x43210211
>   console: random: get_random_bytes called from start_kernel+0xa0/0x504 with crng_init=0
>   console: percpu: Embedded 17 pages/cpu s39756 r8192 d21684 u69632
>   console: Built 1 zonelists, mobility grouping on.  Total pages: 249152
>   console: Kernel command line: printk.time=0 console=ttySAC0,115200n8 earlyprintk random.trust_cpu=off cryptomgr.notests cpuidle.off=1 panic=-1 noreboot
>   [...]
>   console: L2C: platform modifies aux control register: 0x02020000 -> 0x3e420001
>   console: L2C: platform provided aux values permit register corruption.
>   console: L2C: DT/platform modifies aux control register: 0x02020000 -> 0x3e420001
>   console: L2C-310 erratum 769419 enabled
>   console: L2C-310 enabling early BRESP for Cortex-A9
>   console: L2C-310: enabling full line of zeros but not enabled in Cortex-A9
>   console: L2C-310 ID prefetch enabled, offset 1 lines
>   console: L2C-310 dynamic clock gating disabled, standby mode disabled
>   console: L2C-310 cache controller enabled, 8 ways, 128 kB
>   console: L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x7e420001
>   console: Exynos4210 clocks: sclk_apll = 12000000, sclk_mpll = 12000000
>   console: sclk_epll = 12000000, sclk_vpll = 12000000, arm_clk = 12000000
>   [...]
>   console: s3c-i2c 13860000.i2c: slave address 0x00
>   console: s3c-i2c 13860000.i2c: bus frequency set to 93 KHz
>   console: s3c-i2c 13860000.i2c: i2c-0: S3C I2C adapter
>   [...]
>   console: dma-pl330 12680000.pdma: Loaded driver for PL330 DMAC-241330
>   console: dma-pl330 12680000.pdma:       DBUFF-256x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
>   console: dma-pl330 12690000.pdma: Loaded driver for PL330 DMAC-241330
>   console: dma-pl330 12690000.pdma:       DBUFF-256x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
>   console: dma-pl330 12850000.mdma: Loaded driver for PL330 DMAC-241330
>   console: dma-pl330 12850000.mdma:       DBUFF-256x8bytes Num_Chans-8 Num_Peri-1 Num_Events-16
>   console: dma-pl330 12850000.mdma: PM domain LCD0 will not be powered off
>   console: Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
>   console: Serial: AMBA driver
>   console: 13800000.serial: ttySAC0 at MMIO 0x13800000 (irq = 40, base_baud = 0) is a S3C6400/10
>   console: console [ttySAC0] enabled
>   console: 13810000.serial: ttySAC1 at MMIO 0x13810000 (irq = 41, base_baud = 0) is a S3C6400/10
>   console: 13820000.serial: ttySAC2 at MMIO 0x13820000 (irq = 42, base_baud = 0) is a S3C6400/10
>   console: 13830000.serial: ttySAC3 at MMIO 0x13830000 (irq = 43, base_baud = 0) is a S3C6400/10
>   [...]
>   console: Freeing unused kernel memory: 2048K
>   console: Run /init as init process
>   console: mount: mounting devtmpfs on /dev failed: Device or resource busy
>   console: Starting logging: OK
>   console: Initializing random number generator... random: dd: uninitialized urandom read (512 bytes read)
>   console: done.
>   console: Starting network: OK
>   console: Found console ttySAC0
>   console: Linux version 4.19.0-6-armmp (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20)
>   console: Boot successful.
>   PASS (37.98 s)
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2: use archive.gzip_uncompress (Cleber)
> 
> serial input is not working :(
> 
> I sometime get (not always):
> 
> Starting network: OK
> [   70.403690] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
> [   70.423212] rcu:     0-...!: (36 GPs behind) idle=c7a/1/0x40000000 softirq=287/288 fqs=1
> [   70.428209] rcu:     (detected by 1, t=2602 jiffies, g=-443, q=2209)
> [   70.432826] Sending NMI from CPU 1 to CPUs 0:
> [   70.473866] NMI backtrace for cpu 0
> [   70.476621] CPU: 0 PID: 112 Comm: cat Not tainted 4.19.0 #1
> [   70.476711] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
> [   70.476916] PC is at mntput_no_expire+0x88/0x464
> [   70.476996] LR is at rcu_is_watching+0x24/0x78
> [   70.477074] pc : [<c02b256c>]    lr : [<c01a2fb4>]    psr: a0000013
> [   70.477150] sp : ee2afdb0  ip : 9dff9a2f  fp : ee2aff70
> [   70.477225] r10: 00000142  r9 : ee219dc0  r8 : ee2afec0
> [   70.477302] r7 : ee2afec0  r6 : c0298d6c  r5 : ef02c400  r4 : ef018200
> [   70.477385] r3 : c0f99274  r2 : 00000031  r1 : 2e87c000  r0 : a0000013
> [   70.477461] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
> [   70.477537] Control: 10c5387d  Table: 6e30806a  DAC: 00000051
> [   70.477613] CPU: 0 PID: 112 Comm: cat Not tainted 4.19.0 #1
> [   70.477688] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
> [   70.477765] [<c01128f4>] (unwind_backtrace) from [<c010e5b4>] (show_stack+0x10/0x14)
> [   70.477847] [<c010e5b4>] (show_stack) from [<c0a36160>] (dump_stack+0x98/0xc4)
> [   70.477925] [<c0a36160>] (dump_stack) from [<c0a3cc90>] (nmi_cpu_backtrace+0x6c/0xb4)
> [   70.478000] [<c0a3cc90>] (nmi_cpu_backtrace) from [<c0111530>] (handle_IPI+0x108/0x420)
> [   70.478076] [<c0111530>] (handle_IPI) from [<c04950a8>] (gic_handle_irq+0x98/0x9c)
> [   70.478151] [<c04950a8>] (gic_handle_irq) from [<c01019f0>] (__irq_svc+0x70/0xb0)
> [   70.478226] Exception stack(0xee2afd60 to 0xee2afda8)
> [   70.478303] fd60: a0000013 2e87c000 00000031 c0f99274 ef018200 ef02c400 c0298d6c ee2afec0
> [   70.478378] fd80: ee2afec0 ee219dc0 00000142 ee2aff70 9dff9a2f ee2afdb0 c01a2fb4 c02b256c
> [   70.478453] fda0: a0000013 ffffffff
> [   70.478529] [<c01019f0>] (__irq_svc) from [<c02b256c>] (mntput_no_expire+0x88/0x464)
> [   70.478605] [<c02b256c>] (mntput_no_expire) from [<c0298d6c>] (terminate_walk+0x154/0x160)
> [   70.478681] [<c0298d6c>] (terminate_walk) from [<c029ce3c>] (path_openat+0x324/0xfe4)
> [   70.478759] [<c029ce3c>] (path_openat) from [<c029ea9c>] (do_filp_open+0x70/0xdc)
> [   70.478835] [<c029ea9c>] (do_filp_open) from [<c028b36c>] (do_sys_open+0x134/0x1e4)
> [   70.478911] [<c028b36c>] (do_sys_open) from [<c0101000>] (ret_fast_syscall+0x0/0x28)
> [   70.478989] Exception stack(0xee2affa8 to 0xee2afff0)
> [   70.479064] ffa0:                   b6fc7d6c 0000000a ffffff9c bebbf268 000a0000 00000000
> [   70.479139] ffc0: b6fc7d6c 0000000a 00000050 00000142 bebbf268 b6fc6970 b6fc6b28 bebbf254
> [   70.479214] ffe0: b6fc6970 bebbf1e0 b6f9dd94 b6fb0c0c
> [   70.484892] rcu: rcu_preempt kthread starved for 2600 jiffies! g-443 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->cpu=0
> [   70.514943] rcu: RCU grace-period kthread stack dump:
> [   70.516687] rcu_preempt     I    0    10      2 0x00000000
> [   70.523711] [<c0a4caac>] (__schedule) from [<c0a4d28c>] (schedule+0x4c/0xac)
> [   70.525103] [<c0a4d28c>] (schedule) from [<c0a52c34>] (schedule_timeout+0x230/0x564)
> [   70.526472] [<c0a52c34>] (schedule_timeout) from [<c01a7818>] (rcu_gp_kthread+0x6e4/0xbf0)
> [   70.527784] [<c01a7818>] (rcu_gp_kthread) from [<c014d7f0>] (kthread+0x138/0x168)
> [   70.528989] [<c014d7f0>] (kthread) from [<c01010b4>] (ret_from_fork+0x14/0x20)
> [   70.530387] Exception stack(0xef111fb0 to 0xef111ff8)
> [   70.532556] 1fa0:                                     00000000 00000000 00000000 00000000
> [   70.534904] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> [   70.536920] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
> Found console ttySAC0
> 
> Linux version 4.19.0 (root@591d0a36fd03) (gcc version 6.3.0 20170516 (Debian 6.3.0-18)) #1 SMP PREEMPT Fri Oct 4 19:53:43 UTC 2019
> Boot successful.
> / #
> 
> Also:
> 
> [   73.000405] [<c01128f4>] (unwind_backtrace) from [<c010e5b4>] (show_stack+0x10/0x14)
> [   73.000537] [<c010e5b4>] (show_stack) from [<c0a36160>] (dump_stack+0x98/0xc4)
> [   73.000631] [<c0a36160>] (dump_stack) from [<c0a3cc90>] (nmi_cpu_backtrace+0x6c/0xb4)
> [   73.000701] [<c0a3cc90>] (nmi_cpu_backtrace) from [<c0111530>] (handle_IPI+0x108/0x420)
> [   73.000823] [<c0111530>] (handle_IPI) from [<c04950a8>] (gic_handle_irq+0x98/0x9c)
> [   73.000924] [<c04950a8>] (gic_handle_irq) from [<c01019f0>] (__irq_svc+0x70/0xb0)
> [   73.000990] Exception stack(0xef123f80 to 0xef123fc8)
> [   73.001064] 3f80: 00000001 00000001 00000000 ef11b300 ef122000 c1007470 c10074b4 00000002
> [   73.001131] 3fa0: 4000406a 410fc090 00000000 00000000 00000000 ef123fd0 c018759c c010a4c8
> [   73.001196] 3fc0: 20000013 ffffffff
> [   73.001262] [<c01019f0>] (__irq_svc) from [<c010a4c8>] (arch_cpu_idle+0x24/0x3c)
> [   73.001328] [<c010a4c8>] (arch_cpu_idle) from [<c015f1f0>] (do_idle+0xcc/0x168)
> [   73.001394] [<c015f1f0>] (do_idle) from [<c015f60c>] (cpu_startup_entry+0x18/0x1c)
> [   73.001462] [<c015f60c>] (cpu_startup_entry) from [<4010276c>] (0x4010276c)
> 
> Based-on: 20190926173428.10713-16-f4bug@amsat.org
> "tests/boot_linux_console: Extract the gunzip() helper"
> ---
>  tests/acceptance/boot_linux_console.py | 42 ++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
> 
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 44a046bd64..cbb8cddf47 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -432,6 +432,48 @@ class BootLinuxConsole(MachineTest):
>          exec_command_and_wait_for_pattern(self, 'reboot',
>                                                  'reboot: Restarting system')
>  
> +    @skipUnless(os.getenv('IGNORE_AVOCADO_CONSOLE_BUG'), 'Console buggy')

Given that the problems seem related to console input, I think it's
safe to remove this conditional.  I've tested this extensively
(hundreds of executions with as many as 15 running simultaneously)
and had no issues.

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

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

Thanks,
- Cleber.



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

* Re: [PATCH 25/26] tests/boot_linux_console: Add sdcard test for the Exynos4210
  2019-10-28  7:34 ` [PATCH 25/26] tests/boot_linux_console: Add sdcard " Philippe Mathieu-Daudé
@ 2019-10-28 21:48   ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 21:48 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

On Mon, Oct 28, 2019 at 08:34:40AM +0100, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> This test boots a Linux kernel on a smdkc210 board and verify
> the serial output is working.
> 
> The cpio image used comes from the linux-build-test project:
> https://github.com/groeck/linux-build-test
> 
> Since this test is not reliable due to clock timing issues,
> it is disabled with the 'skip' property.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2:
> - use archive.gzip_uncompress (Cleber)
> - check getenv(AVOCADO_ALLOW_UNTRUSTED_CODE) (pm215)
> ---
>  tests/acceptance/boot_linux_console.py | 47 ++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index cbb8cddf47..489df4862c 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -13,6 +13,7 @@ import lzma
>  import gzip
>  import shutil
>  
> +from avocado import skip
>  from avocado import skipUnless
>  from avocado_qemu import MachineTest
>  from avocado_qemu import exec_command_and_wait_for_pattern
> @@ -474,6 +475,52 @@ class BootLinuxConsole(MachineTest):
>          self.wait_for_console_pattern('Boot successful.')
>          # TODO user command, for now the uart is stuck
>  
> +    @skip("unstable clock timings")
> +    def test_arm_exynos4210_sdcard(self):
> +        """
> +        :avocado: tags=arch:arm
> +        :avocado: tags=machine:smdkc210
> +        """
> +        deb_url = ('https://snapshot.debian.org/archive/debian/'
> +                   '20190928T224601Z/pool/main/l/linux/'
> +                   'linux-image-4.19.0-6-armmp_4.19.67-2+deb10u1_armhf.deb')
> +        deb_hash = 'fa9df4a0d38936cb50084838f2cb933f570d7d82'
> +        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> +        kernel_path = self.extract_from_deb(deb_path,
> +                                            '/boot/vmlinuz-4.19.0-6-armmp')
> +        dtb_path = '/usr/lib/linux-image-4.19.0-6-armmp/exynos4210-smdkv310.dtb'
> +        dtb_path = self.extract_from_deb(deb_path, dtb_path)
> +
> +        rootfs_url = ('https://github.com/groeck/linux-build-test/raw/'
> +                      '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
> +                      'arm/rootfs-armv5.ext2.gz')
> +        rootfs_hash = '093e89d2b4d982234bf528bc9fb2f2f17a9d1f93'
> +        rootfs_path_gz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
> +        rootfs_path = os.path.join(self.workdir, 'rootfs.ext2')
> +        archive.gzip_uncompress(rootfs_path_gz, rootfs_path)
> +
> +        self.vm.set_machine('smdkc210')
> +        self.vm.set_console(console_index=1)

This also depends on the resolution of the
'QEMUMachine._console_index' question.

- Cleber.



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

* Re: [PATCH 15/26] tests/acceptance: Test OpenBIOS on the PReP/40p
  2019-10-28 18:41   ` Cleber Rosa
@ 2019-10-28 22:00     ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 22:00 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, qemu-devel,
	Fabien Chouteau, Philippe Mathieu-Daudé,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno, David Gibson

On Mon, Oct 28, 2019 at 02:41:51PM -0400, Cleber Rosa wrote:
> On Mon, Oct 28, 2019 at 08:34:30AM +0100, Philippe Mathieu-Daudé wrote:
> > From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > 
> > User case from:
> > https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
> > 
> > Acked-by: David Gibson <david@gibson.dropbear.id.au>
> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > ---
> > v3:
> > - use avocado_qemu.wait_for_console_pattern (Cleber)
> > - use MD5 hash
> > ---
> 
> Reviewed-by: Cleber Rosa <crosa@redhat.com>
> Tested-by: Cleber Rosa <crosa@redhat.com>
> 
> Queuing on my python-next branch (and sending shortly in a PR).

Even though this test runs fine on my local machine, it times out
under Travis because the image is too large to be downloaded within
the test timeout.  For now, I'm adding:

   @skipIf(os.getenv('CONTINUOUS_INTEGRATION'), 'Running on Travis-CI')

The definitive solution is coming.  Avocado master already allows one to
run:

   $ avocado assets fetch tests/acceptance/boot_linux_console.py

And have the assets downloaded *before* the test is executed.  We're now
adding a "pre_tests"[1] plugin, so that the download will be done
automatically (and only for the tests in the current job).

- Cleber.

[1] - https://avocado-framework.readthedocs.io/en/72.0/api/core/avocado.core.html#avocado.core.plugin_interfaces.JobPreTests

> 
> Thanks,
> - Cleber.



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

* Re: [PATCH 26/26] tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpu
  2019-10-28  8:17   ` Aleksandar Markovic
@ 2019-10-28 22:05     ` Cleber Rosa
  0 siblings, 0 replies; 62+ messages in thread
From: Cleber Rosa @ 2019-10-28 22:05 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: Fam Zheng, Kamil Rytarowski, Eduardo Habkost, Alex Bennée,
	qemu-devel, Fabien Chouteau, Philippe Mathieu-Daudé,
	KONRAD Frederic, Wainer dos Santos Moschetta, Aleksandar Rikalo,
	Philippe Mathieu-Daudé,
	Aurelien Jarno

On Mon, Oct 28, 2019 at 09:17:24AM +0100, Aleksandar Markovic wrote:
> On Monday, October 28, 2019, Philippe Mathieu-Daudé <philmd@redhat.com>
> wrote:
> 
> > From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> >
> > This tests boots a Linux kernel on a Malta machine up to a
> > busybox shell on the serial console. Few commands are executed
> > before halting the machine (via reboot).
> >
> >
> 
> A very nice test.
> 
> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
>

Thanks for the review Aleksandar.

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

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

Thanks,
- Cleber.



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

* Re: [PATCH 08/26] tests/acceptance: Introduce LinuxUserTest base class
  2019-10-28  7:34 ` [PATCH 08/26] tests/acceptance: Introduce LinuxUserTest base class Philippe Mathieu-Daudé
@ 2019-11-18 12:16   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 62+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-11-18 12:16 UTC (permalink / raw)
  To: qemu-devel, Laurent Vivier
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, Fabien Chouteau,
	Kamil Rytarowski, Wainer dos Santos Moschetta, Cleber Rosa,
	Aleksandar Rikalo, Alex Bennée, Aurelien Jarno

Laurent, you weren't Cc'ed on this series, you might find it helpful to 
test linux-user code. The next patch (09/26 Add bFLT loader linux-user 
test) is provided as an example, and tests a STM32 BusyBox.

On 10/28/19 8:34 AM, Philippe Mathieu-Daudé wrote:
> Similarly to the MachineTest base class, this class contains
> methods common to linux-user tests.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   tests/acceptance/avocado_qemu/__init__.py | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> index d23681818d..2611a5146c 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -14,6 +14,7 @@ import sys
>   import uuid
>   
>   import avocado
> +from avocado.utils import process
>   
>   SRC_ROOT_DIR = os.path.join(os.path.dirname(__file__), '..', '..', '..')
>   sys.path.append(os.path.join(SRC_ROOT_DIR, 'python'))
> @@ -138,3 +139,11 @@ class MachineTest(Test):
>       def tearDown(self):
>           for vm in self._vms.values():
>               vm.shutdown()
> +
> +
> +class LinuxUserTest(Test):
> +    def setUp(self):
> +        self.base_setUp("%s-linux-user", "qemu-%s")
> +
> +    def run(self, cmd):
> +        return process.run("%s %s" % (self.qemu_bin, cmd))
> 



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

* Re: [PATCH 06/26] tests/acceptance: Rename avocado_qemu.Test as MachineTest
  2019-10-28  7:34 ` [PATCH 06/26] tests/acceptance: Rename avocado_qemu.Test as MachineTest Philippe Mathieu-Daudé
@ 2019-11-19 13:52   ` Wainer dos Santos Moschetta
  0 siblings, 0 replies; 62+ messages in thread
From: Wainer dos Santos Moschetta @ 2019-11-19 13:52 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Fam Zheng, Eduardo Habkost, KONRAD Frederic, Fabien Chouteau,
	Kamil Rytarowski, Cleber Rosa, Aleksandar Rikalo,
	Alex Bennée, Aurelien Jarno

Hi Philippe,

On 10/28/19 4:34 AM, Philippe Mathieu-Daudé wrote:
> This class is used to test QEMU machines, rename it as MachineTest.
> This will allow us to add a UserTest class for qemu-user tests.


My concern with this rename is that usually "Machine" refers to machine 
type implementation. What if we follow QEMU's terminology of User vs 
System? So it would be renamed to something like SystemTest (vs 
LinuxUserTest as you propose on Patch 08).

Thanks,

Wainer

>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   docs/devel/testing.rst                    | 8 ++++----
>   tests/acceptance/avocado_qemu/__init__.py | 7 ++++++-
>   tests/acceptance/boot_linux_console.py    | 4 ++--
>   tests/acceptance/cpu_queries.py           | 4 ++--
>   tests/acceptance/empty_cpu_model.py       | 4 ++--
>   tests/acceptance/linux_initrd.py          | 4 ++--
>   tests/acceptance/linux_ssh_mips_malta.py  | 4 ++--
>   tests/acceptance/migration.py             | 4 ++--
>   tests/acceptance/version.py               | 4 ++--
>   tests/acceptance/virtio_version.py        | 4 ++--
>   tests/acceptance/vnc.py                   | 4 ++--
>   11 files changed, 28 insertions(+), 23 deletions(-)
>
> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
> index 8e981e062d..d9fab83458 100644
> --- a/docs/devel/testing.rst
> +++ b/docs/devel/testing.rst
> @@ -601,7 +601,7 @@ class.  Here's a simple usage example:
>     from avocado_qemu import Test
>   
>   
> -  class Version(Test):
> +  class Version(MachineTest):
>         """
>         :avocado: tags=quick
>         """
> @@ -625,7 +625,7 @@ in the current directory, tagged as "quick", run:
>   
>     avocado run -t quick .
>   
> -The ``avocado_qemu.Test`` base test class
> +The ``avocado_qemu.MachineTest`` base test class
>   -----------------------------------------
>   
>   The ``avocado_qemu.Test`` class has a number of characteristics that
> @@ -646,10 +646,10 @@ and hypothetical example follows:
>   
>   .. code::
>   
> -  from avocado_qemu import Test
> +  from avocado_qemu import MachineTest
>   
>   
> -  class MultipleMachines(Test):
> +  class MultipleMachines(MachineTest):
>         """
>         :avocado: enable
>         """
> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> index bdece76723..a2cc3d689b 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -100,7 +100,6 @@ def exec_command_and_wait_for_pattern(test, command,
>   
>   class Test(avocado.Test):
>       def setUp(self):
> -        self._vms = {}
>           arches = self.tags.get('arch', [])
>           if len(arches) == 1:
>               arch = arches.pop()
> @@ -113,6 +112,12 @@ class Test(avocado.Test):
>           if self.qemu_bin is None:
>               self.cancel("No QEMU binary defined or found in the source tree")
>   
> +
> +class MachineTest(Test):
> +    def setUp(self):
> +        self._vms = {}
> +        super().setUp()
> +
>       def _new_vm(self, *args):
>           vm = QEMUMachine(self.qemu_bin)
>           if args:
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 4b419b0559..f94dc4bbca 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -13,14 +13,14 @@ import lzma
>   import gzip
>   import shutil
>   
> -from avocado_qemu import Test
> +from avocado_qemu import MachineTest
>   from avocado_qemu import exec_command_and_wait_for_pattern
>   from avocado_qemu import wait_for_console_pattern
>   from avocado.utils import process
>   from avocado.utils import archive
>   
>   
> -class BootLinuxConsole(Test):
> +class BootLinuxConsole(MachineTest):
>       """
>       Boots a Linux kernel and checks that the console is operational and the
>       kernel command line is properly passed from QEMU to the kernel
> diff --git a/tests/acceptance/cpu_queries.py b/tests/acceptance/cpu_queries.py
> index af47d2795a..40df8264cf 100644
> --- a/tests/acceptance/cpu_queries.py
> +++ b/tests/acceptance/cpu_queries.py
> @@ -10,9 +10,9 @@
>   
>   import logging
>   
> -from avocado_qemu import Test
> +from avocado_qemu import MachineTest
>   
> -class QueryCPUModelExpansion(Test):
> +class QueryCPUModelExpansion(MachineTest):
>       """
>       Run query-cpu-model-expansion for each CPU model, and validate results
>       """
> diff --git a/tests/acceptance/empty_cpu_model.py b/tests/acceptance/empty_cpu_model.py
> index 3f4f663582..a4e9cc62f8 100644
> --- a/tests/acceptance/empty_cpu_model.py
> +++ b/tests/acceptance/empty_cpu_model.py
> @@ -8,9 +8,9 @@
>   # 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 subprocess
> -from avocado_qemu import Test
> +from avocado_qemu import MachineTest
>   
> -class EmptyCPUModel(Test):
> +class EmptyCPUModel(MachineTest):
>       def test(self):
>           cmd = [self.qemu_bin, '-S', '-display', 'none', '-machine', 'none', '-cpu', '']
>           r = subprocess.run(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
> diff --git a/tests/acceptance/linux_initrd.py b/tests/acceptance/linux_initrd.py
> index c61d9826a4..e8afb007d0 100644
> --- a/tests/acceptance/linux_initrd.py
> +++ b/tests/acceptance/linux_initrd.py
> @@ -12,10 +12,10 @@ import logging
>   import tempfile
>   from avocado.utils.process import run
>   
> -from avocado_qemu import Test
> +from avocado_qemu import MachineTest
>   
>   
> -class LinuxInitrd(Test):
> +class LinuxInitrd(MachineTest):
>       """
>       Checks QEMU evaluates correctly the initrd file passed as -initrd option.
>   
> diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/linux_ssh_mips_malta.py
> index fc13f9e4d4..5db64affda 100644
> --- a/tests/acceptance/linux_ssh_mips_malta.py
> +++ b/tests/acceptance/linux_ssh_mips_malta.py
> @@ -12,14 +12,14 @@ import logging
>   import time
>   
>   from avocado import skipUnless
> -from avocado_qemu import Test
> +from avocado_qemu import MachineTest
>   from avocado_qemu import wait_for_console_pattern
>   from avocado.utils import process
>   from avocado.utils import archive
>   from avocado.utils import ssh
>   
>   
> -class LinuxSSH(Test):
> +class LinuxSSH(MachineTest):
>   
>       timeout = 150 # Not for 'configure --enable-debug --enable-debug-tcg'
>   
> diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> index a44c1ae58f..3a823c9cc7 100644
> --- a/tests/acceptance/migration.py
> +++ b/tests/acceptance/migration.py
> @@ -10,13 +10,13 @@
>   # later.  See the COPYING file in the top-level directory.
>   
>   
> -from avocado_qemu import Test
> +from avocado_qemu import MachineTest
>   
>   from avocado.utils import network
>   from avocado.utils import wait
>   
>   
> -class Migration(Test):
> +class Migration(MachineTest):
>   
>       timeout = 10
>   
> diff --git a/tests/acceptance/version.py b/tests/acceptance/version.py
> index 67c2192c93..e11661f780 100644
> --- a/tests/acceptance/version.py
> +++ b/tests/acceptance/version.py
> @@ -9,10 +9,10 @@
>   # later.  See the COPYING file in the top-level directory.
>   
>   
> -from avocado_qemu import Test
> +from avocado_qemu import MachineTest
>   
>   
> -class Version(Test):
> +class Version(MachineTest):
>       """
>       :avocado: tags=quick
>       """
> diff --git a/tests/acceptance/virtio_version.py b/tests/acceptance/virtio_version.py
> index 33593c29dd..ea33363b0f 100644
> --- a/tests/acceptance/virtio_version.py
> +++ b/tests/acceptance/virtio_version.py
> @@ -13,7 +13,7 @@ import os
>   
>   sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
>   from qemu.machine import QEMUMachine
> -from avocado_qemu import Test
> +from avocado_qemu import MachineTest
>   
>   # Virtio Device IDs:
>   VIRTIO_NET = 1
> @@ -55,7 +55,7 @@ def get_pci_interfaces(vm, devtype):
>       interfaces = ('pci-express-device', 'conventional-pci-device')
>       return [i for i in interfaces if devtype_implements(vm, devtype, i)]
>   
> -class VirtioVersionCheck(Test):
> +class VirtioVersionCheck(MachineTest):
>       """
>       Check if virtio-version-specific device types result in the
>       same device tree created by `disable-modern` and
> diff --git a/tests/acceptance/vnc.py b/tests/acceptance/vnc.py
> index 3f40bc2be1..c2a364d23e 100644
> --- a/tests/acceptance/vnc.py
> +++ b/tests/acceptance/vnc.py
> @@ -8,10 +8,10 @@
>   # This work is licensed under the terms of the GNU GPL, version 2 or
>   # later.  See the COPYING file in the top-level directory.
>   
> -from avocado_qemu import Test
> +from avocado_qemu import MachineTest
>   
>   
> -class Vnc(Test):
> +class Vnc(MachineTest):
>       """
>       :avocado: tags=vnc,quick
>       """



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

* Re: [PATCH 16/26] tests/acceptance: Test Sandalfoot initrd on the PReP/40p
  2019-10-28 19:08   ` Cleber Rosa
@ 2021-12-03 10:09     ` Cédric Le Goater
  0 siblings, 0 replies; 62+ messages in thread
From: Cédric Le Goater @ 2021-12-03 10:09 UTC (permalink / raw)
  To: Cleber Rosa, Philippe Mathieu-Daudé, Wainer dos Santos Moschetta
  Cc: Fam Zheng, Kamil Rytarowski, Eduardo Habkost,
	Philippe Mathieu-Daudé,
	Fabien Chouteau, qemu-devel, KONRAD Frederic, QEMU PowerPC,
	Wainer dos Santos Moschetta, Aleksandar Rikalo, Alex Bennée,
	Aurelien Jarno, David Gibson

On 10/28/19 20:08, Cleber Rosa wrote:
> On Mon, Oct 28, 2019 at 08:34:31AM +0100, Philippe Mathieu-Daudé wrote:
>> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>
>> User case from:
>> https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html
>>
>> Sandalfoot info:
>> http://www.juneau-lug.org/sandalfoot.php
>>
>> Acked-by: David Gibson <david@gibson.dropbear.id.au>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> v3:
>> - use avocado_qemu.wait_for_console_pattern (Cleber)
>> - use exec_command_and_wait_for_pattern
>> - check getenv(AVOCADO_ALLOW_UNTRUSTED_CODE) (pm215)
>> ---
>>   tests/acceptance/ppc_prep_40p.py | 31 +++++++++++++++++++++++++++++++
>>   1 file changed, 31 insertions(+)
>>
>> diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py
>> index b4109a7af3..c5ecabf52f 100644
>> --- a/tests/acceptance/ppc_prep_40p.py
>> +++ b/tests/acceptance/ppc_prep_40p.py
>> @@ -11,6 +11,7 @@ import logging
>>   from avocado import skipIf
>>   from avocado import skipUnless
>>   from avocado_qemu import MachineTest
>> +from avocado_qemu import exec_command_and_wait_for_pattern
>>   from avocado_qemu import wait_for_console_pattern
>>   
>>   
>> @@ -101,3 +102,33 @@ class IbmPrep40pMachine(MachineTest):
>>   
>>           self.vm.launch()
>>           wait_for_console_pattern(self, 'NetBSD/prep BOOT, Revision 1.9')
>> +
>> +    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
>> +    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()
>> +        wait_for_console_pattern(self, 'Now booting the kernel')
> 
> I could never get past this point.  Any ideas?

I think this is because the message below :

>> +
>> +        msg = 'Please press Enter to activate this console.'

waits for a Line Feed and the console interaction does a readline.

It would be interesting to include this acceptance/avocado test for
the 40p machine because QEMU still supports the 604 CPUs quite well.

Thanks,

C.


>> +        wait_for_console_pattern(self, msg)
>> +
>> +        version = 'BusyBox v0.60.0 (2001.08.19-09:26+0000) Built-in shell (ash)'
>> +        exec_command_and_wait_for_pattern(self, '', version)
>> +
>> +        uname = 'Linux ppc 2.4.18 #5 Wed May 21 23:50:43 AKDT 2003 ppc unknown'
>> +        exec_command_and_wait_for_pattern(self, 'uname -a', uname)
>> +
>> +        cpu = 'PReP IBM 6015/7020 (Sandalfoot/Sandalbow)'
>> +        exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', cpu)
>> -- 
>> 2.21.0
>>
> 
> 
> 



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

end of thread, other threads:[~2021-12-03 10:11 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28  7:34 [PATCH 00/26] tests/acceptance: Queue for 4.2 Philippe Mathieu-Daudé
2019-10-28  7:34 ` [PATCH 01/26] python/qemu/machine: Allow to use other serial consoles than default Philippe Mathieu-Daudé
2019-10-28 14:51   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 02/26] Acceptance tests: refactor wait_for_console_pattern Philippe Mathieu-Daudé
2019-10-28  7:58   ` Aleksandar Markovic
2019-10-28 15:09     ` Cleber Rosa
2019-10-28 15:18   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 03/26] tests/acceptance: Fixe wait_for_console_pattern() hangs Philippe Mathieu-Daudé
2019-10-28  8:01   ` Aleksandar Markovic
2019-10-28 15:28     ` Cleber Rosa
2019-10-28 15:24   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 04/26] tests/acceptance: Send <carriage return> on serial lines Philippe Mathieu-Daudé
2019-10-28 15:36   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 05/26] tests/acceptance: Refactor exec_command_and_wait_for_pattern() Philippe Mathieu-Daudé
2019-10-28 15:50   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 06/26] tests/acceptance: Rename avocado_qemu.Test as MachineTest Philippe Mathieu-Daudé
2019-11-19 13:52   ` Wainer dos Santos Moschetta
2019-10-28  7:34 ` [PATCH 07/26] tests/acceptance: Make pick_default_qemu_bin() more generic Philippe Mathieu-Daudé
2019-10-28  7:34 ` [PATCH 08/26] tests/acceptance: Introduce LinuxUserTest base class Philippe Mathieu-Daudé
2019-11-18 12:16   ` Philippe Mathieu-Daudé
2019-10-28  7:34 ` [PATCH 09/26] tests/acceptance: Add bFLT loader linux-user test Philippe Mathieu-Daudé
2019-10-28  7:34 ` [PATCH 10/26] tests/acceptance: Add test that boots the HelenOS microkernel on Leon3 Philippe Mathieu-Daudé
2019-10-28 16:38   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 11/26] tests/acceptance: Add test that boots Linux up to BusyBox " Philippe Mathieu-Daudé
2019-10-28 16:47   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 12/26] .travis.yml: Let the avocado job run the Leon3 test Philippe Mathieu-Daudé
2019-10-28 16:50   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 13/26] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p Philippe Mathieu-Daudé
2019-10-28 16:56   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 14/26] tests/acceptance: Test Open Firmware on the PReP/40p Philippe Mathieu-Daudé
2019-10-28 17:47   ` Cleber Rosa
2019-10-28 18:45     ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 15/26] tests/acceptance: Test OpenBIOS " Philippe Mathieu-Daudé
2019-10-28 18:41   ` Cleber Rosa
2019-10-28 22:00     ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 16/26] tests/acceptance: Test Sandalfoot initrd " Philippe Mathieu-Daudé
2019-10-28 19:08   ` Cleber Rosa
2021-12-03 10:09     ` Cédric Le Goater
2019-10-28  7:34 ` [PATCH 17/26] .travis.yml: Let the avocado job run the 40p tests Philippe Mathieu-Daudé
2019-10-28 19:25   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 18/26] tests/boot_console: Test booting HP-UX firmware upgrade Philippe Mathieu-Daudé
2019-10-28 20:09   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 19/26] tests/boot_linux_console: Use Avocado archive::gzip_uncompress() Philippe Mathieu-Daudé
2019-10-28 20:13   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 20/26] tests/boot_linux_console: Add a test for the Raspberry Pi 2 Philippe Mathieu-Daudé
2019-10-28 20:24   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 21/26] tests/boot_linux_console: Test the raspi2 UART1 (16550 based) Philippe Mathieu-Daudé
2019-10-28 20:30   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 22/26] tests/boot_linux_console: Boot Linux and run few commands on raspi3 Philippe Mathieu-Daudé
2019-10-28 20:47   ` Cleber Rosa
2019-10-28 20:48   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 23/26] tests/boot_linux_console: Test SDHCI and termal sensor " Philippe Mathieu-Daudé
2019-10-28 20:54   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 24/26] tests/boot_linux_console: Add initrd test for the Exynos4210 Philippe Mathieu-Daudé
2019-10-28 21:40   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 25/26] tests/boot_linux_console: Add sdcard " Philippe Mathieu-Daudé
2019-10-28 21:48   ` Cleber Rosa
2019-10-28  7:34 ` [PATCH 26/26] tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpu Philippe Mathieu-Daudé
2019-10-28  8:17   ` Aleksandar Markovic
2019-10-28 22:05     ` Cleber Rosa
2019-10-28  8:18 ` [PATCH 00/26] tests/acceptance: Queue for 4.2 no-reply
2019-10-28  9:47 ` no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.