From patchwork Thu Apr 19 16:46:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 10351393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 913736023A for ; Thu, 19 Apr 2018 17:11:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8183E22A2A for ; Thu, 19 Apr 2018 17:11:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7555822BF1; Thu, 19 Apr 2018 17:11:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DAAC322A2A for ; Thu, 19 Apr 2018 17:11:13 +0000 (UTC) Received: from localhost ([::1]:32912 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9D5U-000641-MC for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Apr 2018 13:11:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9CiR-0003Wj-0e for qemu-devel@nongnu.org; Thu, 19 Apr 2018 12:47:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9CiP-0007Y4-Ij for qemu-devel@nongnu.org; Thu, 19 Apr 2018 12:47:23 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:45483) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9CiP-0007Y0-Cp for qemu-devel@nongnu.org; Thu, 19 Apr 2018 12:47:21 -0400 Received: by mail-qt0-x241.google.com with SMTP id b13-v6so6486280qtp.12 for ; Thu, 19 Apr 2018 09:47:21 -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=PU0K8WfxeChXdFdEAKTDVTT6855GiMFYJU/V1us4HHc=; b=i90h7Ap+eQdh8HmoKjQdZO+dsKq/HgKHgN61GAdKSR5kruU7Bcz0EoWM72sq5zD4e4 EbmHDE1WWw1nRpvBRMTWKakx8e1lgs42c8oVgbBQMjl7oxPj7BdCWMpMrAQssS8+ozjs QdCgTAPsYop8EhfEACPFriqMgD5+FKba/3x3HLi7Y+Ca7pxm2EYmdyZdTR2VkP7QKFBr KkbGKgRi0TCRAr/mUh/aqyEvxq2V0BCuV7BJRfjXCCC008eSq4pTjORRYiePG0ZjLJTQ xwjGBkGLwC0ZfzV7SX4WQnapN0286WX3j/MaPVyuXVoh+Kq08y6miz2UQ3UJCmvJS0lB KMYA== 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=PU0K8WfxeChXdFdEAKTDVTT6855GiMFYJU/V1us4HHc=; b=fJTJYXAwekP5JBg6oMCzRkSb46AkYwAOlc2pXXuSYDL0iNqAyizZa3EMYgS7Fky2oF S2AXfxWJyyWlE4Ddbmp4u+8Yr+Nx3+BC4aXivfEqEYEgKVDP6IjfeBIqISgYwxfkDExX hnxLB0ryKeCODWyQxE5flPrF2GcmW7pSb3FqimT/BksJfC3k+unp1McXJhD9jhxOHa91 S7Z+rfWvTIrbfiaRAJvWwTgpVLRNy/EGUD8SfrIo8Gtpgdue/zQEMfpZvGMS4UbVeHxq ZGoamTrsqlPs4K8gJeyiT7RS8YxLHjSRy9bfCwAapsi10wVfJrKV+2Wh+QFoRg7VpsRI 0MgQ== X-Gm-Message-State: ALQs6tDMPMcUd+vtENYuHXeqNSF1jnacvDgefrBh0Td6XmDBbEifZwp1 72UjZYzUWyhBD/Do6JTAIqU= X-Google-Smtp-Source: AB8JxZoh7LrCfKzu6nMojwaC1WzG5dLo+yFmqrheR45VJNBvNr3VbWmX8JtxbQTDNjHfdadg/KhVNg== X-Received: by 2002:ac8:b0e:: with SMTP id e14-v6mr6742888qti.365.1524156440846; Thu, 19 Apr 2018 09:47:20 -0700 (PDT) Received: from x1.local ([138.117.48.212]) by smtp.gmail.com with ESMTPSA id k126sm3040039qkd.34.2018.04.19.09.47.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 09:47:20 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , Cleber Rosa , Amador Pahim , Stefan Hajnoczi , Zheng Xiang Date: Thu, 19 Apr 2018 13:46:42 -0300 Message-Id: <20180419164642.9536-8-f4bug@amsat.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419164642.9536-1-f4bug@amsat.org> References: <20180419164642.9536-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [RFC PATCH 7/7] avocado: Add tests booting the Malta machine 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: Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Philippe Mathieu-Daudé --- tests/avocado/test_linux-boot-console.py | 92 +++++++++++++++++++ .../parameters.yaml | 2 + 2 files changed, 94 insertions(+) diff --git a/tests/avocado/test_linux-boot-console.py b/tests/avocado/test_linux-boot-console.py index f54d10dd79..4ae1e3bf37 100644 --- a/tests/avocado/test_linux-boot-console.py +++ b/tests/avocado/test_linux-boot-console.py @@ -86,3 +86,95 @@ class TestAlphaClipperBoot2_6(test.QemuTest): def tearDown(self): os.remove(self.console_path) + + +class TestMips4kcMaltaBoot2_6(test.QemuTest): + """ + :avocado: enable + :avocado: tags=arch_mips + """ + ARCH = "mips" + + def kernel_url(self): + return 'http://people.debian.org/~aurel32/qemu/mips/vmlinux-2.6.32-5-4kc-malta' + + def setUp(self): + self.console_path = tempfile.mkstemp()[1] + kernel_path = cachedfile(self.kernel_url()) + self.vm._args.extend(['-machine', 'malta']) + self.vm._args.extend(['-m', '64']) + self.vm._args.extend(['-kernel', kernel_path]) + self.vm._args.extend(['-append', '"console=ttyS0 printk.time=0"']) + self.vm._args.extend(['-chardev', 'socket,id=uart0,server,nowait,path=' + self.console_path]) + self.vm._args.extend(['-serial', 'chardev:uart0']) + self.vm._args.extend(['-nographic']) + + def test_boot_console(self): + """ + :avocado: tags=uart,printk + """ + if self.params.get('arch') != self.ARCH: + return + + self.vm.launch(self.console_path) + console = self.vm.get_console(console_address=self.console_path, login=False) + # no filesystem provided on purpose, wait for the Kernel panic + bootlog = console.read_until_any_line_matches(["Kernel panic - not syncing: VFS: Unable to mount root fs"], timeout=6.0)[1] + console.close() + # check Super I/O + self.assertIn(u'ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A', bootlog) + self.assertIn(u'ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A', bootlog) + self.assertIn(u'i8042 KBD port at 0x60,0x64 irq 1', bootlog) + self.assertIn(u'i8042 AUX port at 0x60,0x64 irq 12', bootlog) + # check PCI (network interface) + self.assertIn(u'registered as PCnet/PCI II 79C970A', bootlog) + self.vm.shutdown() + + def tearDown(self): + os.remove(self.console_path) + +# FIXME this is a copy of TestMips4kcMaltaBoot2_6 with a different the kernel url +class TestMips4kcMaltaBoot3_2(test.QemuTest): + """ + :avocado: enable + :avocado: tags=arch_mips + """ + ARCH = "mips" + + def kernel_url(self): + return 'http://people.debian.org/~aurel32/qemu/mips/vmlinux-3.2.0-4-4kc-malta' + + def setUp(self): + self.console_path = tempfile.mkstemp()[1] + kernel_path = cachedfile(self.kernel_url()) + self.vm._args.extend(['-machine', 'malta']) + self.vm._args.extend(['-m', '64']) + self.vm._args.extend(['-kernel', kernel_path]) + self.vm._args.extend(['-append', '"console=ttyS0 printk.time=0"']) + self.vm._args.extend(['-chardev', 'socket,id=uart0,server,nowait,path=' + self.console_path]) + self.vm._args.extend(['-serial', 'chardev:uart0']) + self.vm._args.extend(['-nographic']) + + def test_boot_console(self): + """ + :avocado: tags=uart,printk + """ + if self.params.get('arch') != self.ARCH: + return + + self.vm.launch(self.console_path) + console = self.vm.get_console(console_address=self.console_path, login=False) + # no filesystem provided on purpose, wait for the Kernel panic + bootlog = console.read_until_any_line_matches(["Kernel panic - not syncing: VFS: Unable to mount root fs"], timeout=6.0)[1] + console.close() + # check Super I/O + self.assertIn(u'ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A', bootlog) + self.assertIn(u'ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A', bootlog) + self.assertIn(u'i8042 KBD port at 0x60,0x64 irq 1', bootlog) + self.assertIn(u'i8042 AUX port at 0x60,0x64 irq 12', bootlog) + # check PCI (network interface) + self.assertIn(u'registered as PCnet/PCI II 79C970A', bootlog) + self.vm.shutdown() + + def tearDown(self): + os.remove(self.console_path) diff --git a/tests/avocado/test_linux-boot-console.py.data/parameters.yaml b/tests/avocado/test_linux-boot-console.py.data/parameters.yaml index ed8c08058c..156f271a73 100644 --- a/tests/avocado/test_linux-boot-console.py.data/parameters.yaml +++ b/tests/avocado/test_linux-boot-console.py.data/parameters.yaml @@ -1,3 +1,5 @@ architecture: !mux alpha: arch: alpha + mips: + arch: mips