From nobody Thu Nov 6 06:17:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539443874181172.43920204721906; Sat, 13 Oct 2018 08:17:54 -0700 (PDT) Received: from localhost ([::1]:45311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBLfs-0007N3-Mj for importer@patchew.org; Sat, 13 Oct 2018 11:17:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBLe3-0006T1-BS for qemu-devel@nongnu.org; Sat, 13 Oct 2018 11:16:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBLe2-0004RC-9M for qemu-devel@nongnu.org; Sat, 13 Oct 2018 11:15:59 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:55877) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gBLe2-0004QB-0y for qemu-devel@nongnu.org; Sat, 13 Oct 2018 11:15:58 -0400 Received: by mail-wm1-x343.google.com with SMTP id 206-v6so14887143wmb.5 for ; Sat, 13 Oct 2018 08:15:57 -0700 (PDT) Received: from x1.local (62.red-88-24-165.staticip.rima-tde.net. [88.24.165.62]) by smtp.gmail.com with ESMTPSA id g3-v6sm2470446wrw.81.2018.10.13.08.15.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Oct 2018 08:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gzSJBTPc9yjGwMq73xy8wJZLQv8t7efa86ZEfod9bAw=; b=JUrz4NOjyxJT5TYzQjiBtRXeESmjefK74u9T/AA176I81xxJZgrFF9ZcP60pOjJkCw AWaufu4vKsZvryaBMARDXk9mH94R+gRypMrxR7ernIB2YyIG0zcdE72PkXyHpk8qYJhB MPG8cfrgcmGAPWYwSVhyz0Ejrg0jjNSX8NWUTihBGWwg9eKd0jyeUTdvhrjRKp+0+pJC B6dflDPYrannOISOtYYkRRUAVt4/rtmOUdUhF2KqcsmpzviUwQ6E7CFbtOqh7VyotQ5Z wP5nHWLvSJocm3T780Jnjunq9LLmGVwtaHNUFGtR3Dnlkla+EusJ2bc44FgppAVu3o7k OoLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gzSJBTPc9yjGwMq73xy8wJZLQv8t7efa86ZEfod9bAw=; b=gFYZhyc4/vrqO0s4b1wvSp27Mn5VT+PDhLTckQj9Q5IqlwYuDllvHGfWAjWuZTmuzF dZ9v8WqVXoH+x9p03n0qg2PCyqU6yY9DuYEBI8QAMuWoAP8eYTKxAhL372qwydnpeTP0 UGmsS1GwmWj8LGyW0F3prRUKXKGXgApmRYpikMbgnXqs3LOJitxLnzR1wXvmkKQgOFOL uP/5EpxgiTNC5n/ad2kHFtOpaBa39pwdjQMW1Xh3woDhS9hMC+GWoOtNAFRhYyf0mk7E Nn6S23XFVljvBqTSDV3KxYFxr6WZlwD6ldKA+5TKvhezJteJxD1nXcaRNbpRRIzLAKdL SW9g== X-Gm-Message-State: ABuFfojco0fxGYQMQe/Dh6iIiF3PXZD4FBxhRGZnynmPZk7R5SAIsJTN HoMT71I33d4KIp92wpYeSxs= X-Google-Smtp-Source: ACcGV63uxYnkIStq0a9u2x0dvoj7YpwaOV4rTy8ep3QsnNlTMIdxl2+y00HzLqX5JoO5HIf5kC3rxg== X-Received: by 2002:a1c:1c13:: with SMTP id c19-v6mr7720127wmc.85.1539443756924; Sat, 13 Oct 2018 08:15:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Cleber Rosa , Eduardo Habkost Date: Sat, 13 Oct 2018 17:15:42 +0200 Message-Id: <20181013151545.3731-4-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181013151545.3731-1-f4bug@amsat.org> References: <20181013151545.3731-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PATCH v3 3/6] tests/acceptance: Add test_mips_4kc_malta in BootLinuxConsole X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Similar to the test_x86_64_pc test, this boots a Linux kernel on a Malta board (MIPS 4Kc big-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. $ avocado --show=3Dconsole run -p arch=3Dmips tests/acceptance/boot_linux= _console.py console: [ 0.000000] Initializing cgroup subsys cpuset console: [ 0.000000] Initializing cgroup subsys cpu console: [ 0.000000] Linux version 2.6.32-5-4kc-malta (Debian 2.6.32-4= 8) (ben@decadent.org.uk) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 Sat Feb 1= 6 12:43:42 UTC 2013 console: [ 0.000000] console: [ 0.000000] LINUX started... console: [ 0.000000] bootconsole [early0] enabled console: [ 0.000000] CPU revision is: 00019300 (MIPS 24Kc) console: [ 0.000000] FPU revision is: 00739300 console: [ 0.000000] Determined physical RAM map: console: [ 0.000000] memory: 00001000 @ 00000000 (reserved) console: [ 0.000000] memory: 000ef000 @ 00001000 (ROM data) console: [ 0.000000] memory: 005b7000 @ 000f0000 (reserved) console: [ 0.000000] memory: 03958000 @ 006a7000 (usable) console: [ 0.000000] Wasting 54496 bytes for tracking 1703 unused pages console: [ 0.000000] Initrd not found or empty - disabling initrd console: [ 0.000000] Zone PFN ranges: console: [ 0.000000] DMA 0x00000000 -> 0x00001000 console: [ 0.000000] Normal 0x00001000 -> 0x00003fff console: [ 0.000000] Movable zone start PFN for each node console: [ 0.000000] early_node_map[1] active PFN ranges console: [ 0.000000] 0: 0x00000000 -> 0x00003fff console: [ 0.000000] Built 1 zonelists in Zone order, mobility groupin= g on. Total pages: 16255 console: [ 0.000000] Kernel command line: console=3DttyS0 printk.time= =3D0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 3aa4dbe5f9..81c96fc338 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -9,6 +9,7 @@ # later. See the COPYING file in the top-level directory. =20 import logging +import subprocess =20 from avocado_qemu import Test =20 @@ -47,3 +48,48 @@ class BootLinuxConsole(Test): break if 'Kernel panic - not syncing' in msg: self.fail("Kernel panic reached") + + def test_mips_4kc_malta(self): + """ + This test requires the dpkg-deb tool (apt/dnf install dpkg) to ext= ract + the kernel from the Debian package. + + 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-48/#linux-= source-2.6.32_2.6.32-48 + + :avocado: tags=3Darch:mips + """ + if self.arch !=3D 'mips': # FIXME use 'arch' tag in parent class? + self.cancel('Currently specific to the %s target arch' % self.= arch) + + deb_url =3D ('http://snapshot.debian.org/archive/debian/20130217T0= 32700Z/' + 'pool/main/l/linux-2.6/' + 'linux-image-2.6.32-5-4kc-malta_2.6.32-48_mips.deb') + deb_hash =3D 'a8cfc28ad8f45f54811fc6cf74fc43ffcfe0ba04' + deb_path =3D self.fetch_asset(deb_url, asset_hash=3Ddeb_hash) + subprocess.check_call(['dpkg-deb', '--extract', deb_path, self.wor= kdir]) # FIXME move to avocado ... + kernel_path =3D self.workdir + '/boot/vmlinux-2.6.32-5-4kc-malta' = # FIXME ... and use from assets? + + self.vm.set_arch(self.arch) + self.vm.set_machine('malta') + self.vm.set_console("") # XXX this disable isa-serial to use -seri= al ... + kernel_command_line =3D 'console=3DttyS0 printk.time=3D0' + self.vm.add_args('-m', "64", + '-serial', "chardev:console", # XXX ... here. + '-kernel', kernel_path, + '-append', kernel_command_line) + + # FIXME below to parent class? + self.vm.launch() + console =3D self.vm.console_socket.makefile() + console_logger =3D logging.getLogger('console') + while True: + msg =3D 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") --=20 2.19.1