qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: "Alex Bennée" <alex.bennee@linaro.org>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"BALATON Zoltan" <balaton@eik.bme.hu>,
	"Magnus Damm" <magnus.damm@gmail.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org, "Lukáš Doktor" <ldoktor@redhat.com>,
	"Fam Zheng" <famz@redhat.com>
Subject: [Qemu-devel] [PATCH v3 5/6] tests/acceptance: Add test_sh4_r2d in BootLinuxConsole
Date: Sat, 13 Oct 2018 17:15:44 +0200	[thread overview]
Message-ID: <20181013151545.3731-6-f4bug@amsat.org> (raw)
In-Reply-To: <20181013151545.3731-1-f4bug@amsat.org>

Similar to the test_x86_64_pc test, this boots a Linux kernel on a
R2D board (SH4 little-endian) and verify the serial is working.

This test requires the dpkg-deb tool (apt/dnf install dpkg) to
extract the kernel from the Debian package.

Note, due to a problem with the serial on this machine, this test
is currently disabled.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 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 e4a60297bf..8f99cc0d7c 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -11,6 +11,7 @@
 import logging
 import subprocess
 
+from avocado import skip
 from avocado_qemu import Test
 
 
@@ -137,3 +138,50 @@ class BootLinuxConsole(Test):
                 break
             if 'Kernel panic - not syncing' in msg:
                 self.fail("Kernel panic reached")
+
+    @skip("console not working on r2d machine")
+    def test_sh4_r2d(self):
+        """
+        This test requires the dpkg-deb tool (apt/dnf install dpkg) to extract
+        the kernel from the Debian package.
+        This test also requires the QEMU binary to be compiled with:
+
+          $ configure ... --enable-trace-backends=log
+
+        The kernel can be rebuilt using this Debian kernel source [1] and
+        following the instructions on [2].
+
+        [1] https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-official
+        [2] http://snapshot.debian.org/package/linux-2.6/2.6.32-30/#linux-source-2.6.32_2.6.32-30
+
+        :avocado: tags=arch:sh4
+        """
+        if self.arch != 'sh4':
+            self.cancel('Currently specific to the %s target arch' % self.arch)
+
+        deb_url = ('http://snapshot.debian.org/archive/'
+                   'debian-ports/20110116T065852Z/pool-sh4/main/l/'
+                   'linux-2.6/linux-image-2.6.32-5-sh7751r_2.6.32-30_sh4.deb')
+        deb_hash = '8025e503319dc8ad786756e3afaa8eb868e9ef59'
+        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
+        subprocess.check_call(['dpkg-deb', '--extract', deb_path, self.workdir])
+        kernel_path = self.workdir + '/boot/vmlinuz-2.6.32-5-sh7751r'
+
+        self.vm.set_arch(self.arch)
+        self.vm.set_machine('r2d')
+        self.vm.set_console("") # XXX
+        kernel_command_line = 'console=ttyS0 printk.time=0 noiotrap'
+        self.vm.add_args('-serial', "chardev:console",
+                         '-kernel', kernel_path,
+                         '-append', kernel_command_line)
+
+        self.vm.launch()
+        console = self.vm.console_socket.makefile()
+        console_logger = logging.getLogger('console')
+        while True:
+            msg = console.readline()
+            console_logger.debug(msg.strip())
+            if 'Kernel command line: %s' % kernel_command_line in msg:
+                break
+            if 'Kernel panic - not syncing' in msg:
+                self.fail("Kernel panic reached")
-- 
2.19.1

  parent reply	other threads:[~2018-10-13 15:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-13 15:15 [Qemu-devel] [PATCH v3 0/6] Avocado: more multi-arch tests Philippe Mathieu-Daudé
2018-10-13 15:15 ` [Qemu-devel] [PATCH v3 1/6] tests/acceptance: Rename the generic BootLinuxConsole test as test_x86_64_pc Philippe Mathieu-Daudé
2018-10-19 18:15   ` Cleber Rosa
2018-10-13 15:15 ` [Qemu-devel] [RFC PATCH v3 2/6] tests/acceptance: Add a kludge to not use the default console Philippe Mathieu-Daudé
2018-10-19 17:37   ` Cleber Rosa
2018-10-19 17:45     ` Philippe Mathieu-Daudé
2018-10-13 15:15 ` [Qemu-devel] [PATCH v3 3/6] tests/acceptance: Add test_mips_4kc_malta in BootLinuxConsole Philippe Mathieu-Daudé
2018-10-19 17:42   ` Cleber Rosa
2018-10-19 18:41     ` Philippe Mathieu-Daudé
2018-10-19 21:17       ` Cleber Rosa
2018-10-19 22:51         ` Cleber Rosa
2018-10-20  9:57           ` Philippe Mathieu-Daudé
2018-10-13 15:15 ` [Qemu-devel] [PATCH v3 4/6] tests/acceptance: Add test_mipsel_5kc_malta " Philippe Mathieu-Daudé
2018-10-13 15:15 ` Philippe Mathieu-Daudé [this message]
2018-10-13 15:56   ` [Qemu-devel] [PATCH v3 5/6] tests/acceptance: Add test_sh4_r2d " Philippe Mathieu-Daudé
2018-10-13 15:15 ` [Qemu-devel] [RFC PATCH v3 6/6] tests/acceptance: Add test_sh4_r2d in BootLinuxTracing Philippe Mathieu-Daudé
2018-10-20  0:02   ` Cleber Rosa
2018-10-15  6:41 ` [Qemu-devel] [PATCH v3 0/6] Avocado: more multi-arch tests Thomas Huth
2018-10-19  5:13 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181013151545.3731-6-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=alex.bennee@linaro.org \
    --cc=balaton@eik.bme.hu \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=famz@redhat.com \
    --cc=ldoktor@redhat.com \
    --cc=magnus.damm@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).