From nobody Mon Nov 10 19:45:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1558395594; cv=none; d=zoho.com; s=zohoarc; b=YrgCwvRQMwpL+n1cawOEmRwZWlTgODRIA+gk3vijVLuhdULsp611YTetwBb8cg7KZs1Jr/TLe7B/7DH8F2rwe9jMfpxBL12pUF8v5ttr5qOgHh5259KVz2Zu+fgtYUNk/hBMtnucc06h270DWFq+aBb3VFRvkgiUiCDIqN3XvgA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558395594; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=AQeFho+GAF0XNyv3/66Q7+XaAILCa23wijwHXatigto=; b=iyoHpR84L1bcYtVp3qVk6RLmxxbqbR/8D00GD8mTEXiMFebSrISiji25jBNmgF6AMgCAIAaFh+uI45bhMvQu61zw92HqkPB7EWd3aEwl38GlG3JXZ2RcgRkKu0P6cUW6zlV65aMjlc9XULFe15rXdjgB5MzylgSHQmJG75gYTWc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558395594670209.72015678573644; Mon, 20 May 2019 16:39:54 -0700 (PDT) Received: from localhost ([127.0.0.1]:43735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSrsi-00068h-Lu for importer@patchew.org; Mon, 20 May 2019 19:39:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSrYv-0005pM-Tq for qemu-devel@nongnu.org; Mon, 20 May 2019 19:19:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSrYu-0004we-CW for qemu-devel@nongnu.org; Mon, 20 May 2019 19:19:21 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:42801) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSrYs-0004sq-Cw for qemu-devel@nongnu.org; Mon, 20 May 2019 19:19:18 -0400 Received: by mail-wr1-x442.google.com with SMTP id l2so16381291wrb.9 for ; Mon, 20 May 2019 16:19:17 -0700 (PDT) Received: from x1.local (228.red-83-52-173.dynamicip.rima-tde.net. [83.52.173.228]) by smtp.gmail.com with ESMTPSA id b10sm44261849wrh.59.2019.05.20.16.19.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 16:19:15 -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=AQeFho+GAF0XNyv3/66Q7+XaAILCa23wijwHXatigto=; b=GealTQ1/MAq8B1XUh0r4MAFDG57cwOkNLgMg1rzn0Jb/J+zasngSn/fLYngnKtRddg 09yxNv5MZ0Hjvd1GnSVzsz9kixgoNaS1oN/WnfVZ69v8TxYAt7Tt86rCVPAXDYA+g2cx HcR5BBB6lUxnVWIipjL6jiiOBrUS+zqOIGJb70OE1YppYrajNqgaoL2PF+f35a/E4iYd seyachZ0LRRzjM/rQKhL5BJjS4tySJYbRdJjHYU6cnNOj2Dj5bTLsTYjNW1DrY7i9isS eBlo0dxsgSuEpNNs1s/584iL8LUb2JzPFlm7pnEnTttg1r64tcapxnZmJ/P3D/zoi+Jo 2Sbg== 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=AQeFho+GAF0XNyv3/66Q7+XaAILCa23wijwHXatigto=; b=fhyxlMHTJirsCvyr2KD7QRp1b1+lBk3gpZ7SIm0LXf+As8+YiF7R2tLBsUKi1qH+RV NBkuiRZVK7nDw/HWCjo5HIb83O3q8ejN8DlqSKTPEbEkSpWuccBox/pK8OV034fu/0t7 YUwdClOzl8FZdO2IzSPNRaxwc+nAOWu76ea+VPNk+HLQy+/3QuyqOjUoDeQ3EYsb+rgu Ru+f2AympKZZxiJ3CvDeKZXp7t2/zs35JI1bLhgRY61L5JECg2hOVZjLq993+8y5U7jx Ydp76DSaTiGwgTX9k+B7jFXnTiOjbqUecHX3SE41+B0XlUsxz+Ol9lbzpwYzRx7aFVaK ogdQ== X-Gm-Message-State: APjAAAVfVzl915V5NTGlsFjjM38zwGzqs3X2lx45VjkyvcCKQY6D1iAk iF9YkpnrBsSUaw0srPvb9+LB7smuf6A= X-Google-Smtp-Source: APXvYqzfFPII2wd1qhWENl6tWnfA14B24Vq1U98pPBCfw5iOFb52KXHsIkRnwQK3MAF7l4GhobGTcg== X-Received: by 2002:adf:fe49:: with SMTP id m9mr45979193wrs.73.1558394356042; Mon, 20 May 2019 16:19:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 21 May 2019 01:19:09 +0200 Message-Id: <20190520231910.12184-4-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190520231910.12184-1-f4bug@amsat.org> References: <20190520231910.12184-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::442 Subject: [Qemu-devel] [PATCH 3/4] BootLinuxConsoleTest: Run kerneltests BusyBox on Malta 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: Eduardo Habkost , Aleksandar Rikalo , Caio Carrara , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Aleksandar Markovic , Cleber Rosa , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 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 --show=3Dconsole run -t arch:mips tests/acceptance/boot_linux_c= onsole.py [...] console: Boot successful. [...] console: / # uname -a console: Linux buildroot 4.5.0-2-4kc-malta #1 Debian 4.5.5-1 (2016-05-29)= mips GNU/Linux console: / # reboot console: / # reboot: Restarting system Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Aleksandar Markovic Tested-by: Cleber Rosa --- tests/acceptance/boot_linux_console.py | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot= _linux_console.py index 1c330871c0..60ea240ab6 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -11,6 +11,7 @@ import os import logging import lzma +import gzip import shutil =20 from avocado_qemu import Test @@ -47,6 +48,11 @@ class BootLinuxConsole(Test): fail =3D 'Failure message found in console: %s' % failure_= message self.fail(fail) =20 + def exec_command_and_wait_for_pattern(self, command, success_message): + command +=3D '\n' + self.vm.console_socket.sendall(command.encode()) + self.wait_for_console_pattern(success_message) + def extract_from_deb(self, deb, path): """ Extracts a file from a deb package into the test workdir @@ -138,6 +144,49 @@ class BootLinuxConsole(Test): console_pattern =3D 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) =20 + def test_mips_malta_cpio(self): + """ + :avocado: tags=3Darch:mips + :avocado: tags=3Dmachine:malta + :avocado: tags=3Dendian:big + """ + deb_url =3D ('http://snapshot.debian.org/archive/debian/' + '20160601T041800Z/pool/main/l/linux/' + 'linux-image-4.5.0-2-4kc-malta_4.5.5-1_mips.deb') + deb_hash =3D 'a3c84f3e88b54e06107d65a410d1d1e8e0f340f8' + deb_path =3D self.fetch_asset(deb_url, asset_hash=3Ddeb_hash) + kernel_path =3D self.extract_from_deb(deb_path, + '/boot/vmlinux-4.5.0-2-4kc-mal= ta') + initrd_url =3D ('https://github.com/groeck/linux-build-test/raw/' + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/' + 'mips/rootfs.cpio.gz') + initrd_hash =3D 'bf806e17009360a866bf537f6de66590de349a99' + initrd_path_gz =3D self.fetch_asset(initrd_url, asset_hash=3Dinitr= d_hash) + initrd_path =3D 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) + + self.vm.set_machine('malta') + self.vm.set_console() + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0 console=3Dtty ' + + 'rdinit=3D/sbin/init noreboot') + self.vm.add_args('-kernel', kernel_path, + '-initrd', initrd_path, + '-append', kernel_command_line, + '-no-reboot') + 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') + def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash): kernel_path_xz =3D self.fetch_asset(kernel_url, asset_hash=3Dkerne= l_hash) kernel_path =3D self.workdir + "kernel" --=20 2.19.1