From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD433C04AB5 for ; Thu, 6 Jun 2019 23:07:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ADE6820684 for ; Thu, 6 Jun 2019 23:07:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADE6820684 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZ1U4-0000Zz-Ri for qemu-devel@archiver.kernel.org; Thu, 06 Jun 2019 19:07:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40040) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZ1RX-0007Mw-K3 for qemu-devel@nongnu.org; Thu, 06 Jun 2019 19:05:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZ1PP-0001FO-4R for qemu-devel@nongnu.org; Thu, 06 Jun 2019 19:03:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33336) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZ1PO-0001ED-Se for qemu-devel@nongnu.org; Thu, 06 Jun 2019 19:02:59 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CFF7F8552A; Thu, 6 Jun 2019 23:02:54 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-32.brq.redhat.com [10.40.204.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 533308B165; Thu, 6 Jun 2019 23:02:49 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Habkost , qemu-devel@nongnu.org Date: Fri, 7 Jun 2019 01:02:32 +0200 Message-Id: <20190606230232.9888-3-philmd@redhat.com> In-Reply-To: <20190606230232.9888-1-philmd@redhat.com> References: <20190606230232.9888-1-philmd@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 06 Jun 2019 23:02:58 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 2/2] BootLinuxConsoleTest: Run kerneltests BusyBox on Malta X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Cleber Rosa , Aleksandar Markovic , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 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= _console.py [...] console: Boot successful. [...] console: / # uname -a console: Linux buildroot 4.5.0-2-4kc-malta #1 Debian 4.5.5-1 (2016-05-2= 9) 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 --- v3: Use archive.extract() instead of shutil+gzip (Cleber) --- tests/acceptance/boot_linux_console.py | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/bo= ot_linux_console.py index a7a735c90d..751e3bff86 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -49,6 +49,11 @@ class BootLinuxConsole(Test): fail =3D 'Failure message found in console: %s' % failur= e_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 @@ -140,6 +145,45 @@ class BootLinuxConsole(Test): console_pattern =3D 'Kernel command line: %s' % kernel_command_l= ine 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-m= alta') + 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=3Dini= trd_hash) + initrd_path =3D archive.extract(initrd_path_gz, + os.path.join(self.workdir, 'rootfs= .cpio')) + 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 syste= m') + def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash): kernel_path_xz =3D self.fetch_asset(kernel_url, asset_hash=3Dker= nel_hash) kernel_path =3D self.workdir + "kernel" --=20 2.20.1