From nobody Sun May 5 09:32:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590405628; cv=none; d=zohomail.com; s=zohoarc; b=ZhxnxzQODV/JHJVw+5wRY16y7NgJM4mBdxQhENtE0jMXwubCM73KXp1ZGxqEwQ0+NQGZUeekEIGYvU9eMoYZTd7YJrGw09fNnQGthhNmgMjTF4t6nZ5wi6N1wk1xlo/QjS/n2fBFmr3uxVvmupw0UB6UP0buJB9JVFOeAfUX6yA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590405628; 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; bh=C2GUJwP9M4jhgX/oBFLhbj9juLJOQSPR38pIMERzFkM=; b=A+FRU5pgmPgmUpBIU92KSi7pfJ14Vak+zPO7vUHB6Ho1K1gwXf3zHxBMuteb8GJyYm206hQGOuudKZ7AVTVrs2VtMNwQ0Q0Wmczbixe8Z1eSNef0qRqQ3PUNwvmhEGQiEQkPkP/R0Xe+BwqCONsEBSosc9mROTFaN0Wu6PrpZ94= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590405628779521.5839199576297; Mon, 25 May 2020 04:20:28 -0700 (PDT) Received: from localhost ([::1]:34360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdB9e-0001ye-HL for importer@patchew.org; Mon, 25 May 2020 07:20:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdB8R-0000W1-00 for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:12 -0400 Received: from mail.ispras.ru ([83.149.199.45]:54692) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdB8Q-0008M3-9w for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:10 -0400 Received: from [127.0.1.1] (unknown [62.118.151.149]) by mail.ispras.ru (Postfix) with ESMTPSA id A91EBCD466; Mon, 25 May 2020 14:19:08 +0300 (MSK) Subject: [PATCH 1/9] tests/acceptance: allow console interaction with specific VMs From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Mon, 25 May 2020 14:19:08 +0300 Message-ID: <159040554841.2615.9176706179382687894.stgit@pasha-ThinkPad-X280> In-Reply-To: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> References: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: softfail client-ip=83.149.199.45; envelope-from=Pavel.Dovgaluk@gmail.com; helo=mail.ispras.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 07:19:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: philmd@redhat.com, dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru, crosa@redhat.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Console interaction in avocado scripts was possible only with single default VM. This patch modifies the function parameters to allow passing a specific VM as a parameter to interact with it. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 59e7b4f763..0bbaa8d2a6 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -69,13 +69,15 @@ def pick_default_qemu_bin(arch=3DNone): =20 =20 def _console_interaction(test, success_message, failure_message, - send_string, keep_sending=3DFalse): + send_string, keep_sending=3DFalse, vm=3DNone): assert not keep_sending or send_string - console =3D test.vm.console_socket.makefile() + if vm is None: + vm =3D test.vm + console =3D vm.console_socket.makefile() console_logger =3D logging.getLogger('console') while True: if send_string: - test.vm.console_socket.sendall(send_string.encode()) + vm.console_socket.sendall(send_string.encode()) if not keep_sending: send_string =3D None # send only once msg =3D console.readline().strip() @@ -115,7 +117,7 @@ def interrupt_interactive_console_until_pattern(test, s= uccess_message, _console_interaction(test, success_message, failure_message, interrupt_string, True) =20 -def wait_for_console_pattern(test, success_message, failure_message=3DNone= ): +def wait_for_console_pattern(test, success_message, failure_message=3DNone= , vm=3DNone): """ Waits for messages to appear on the console, while logging the content =20 @@ -125,7 +127,7 @@ def wait_for_console_pattern(test, success_message, fai= lure_message=3DNone): :param success_message: if this message appears, test succeeds :param failure_message: if this message appears, test fails """ - _console_interaction(test, success_message, failure_message, None) + _console_interaction(test, success_message, failure_message, None, vm= =3Dvm) =20 def exec_command_and_wait_for_pattern(test, command, success_message, failure_message=3DN= one): From nobody Sun May 5 09:32:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590405717; cv=none; d=zohomail.com; s=zohoarc; b=EBBkRkZu/t6gdrkP8u2Qaaucz5f41sxykigOSNrbd7SlYl3mFbqvs4cU/jFgNYY8hB73lWphCUNgn8WdP/whKKP5HxAPHdxP5o2OJGrXhO800OpnapyyP2MNfD5YlKXu90gazq2f67O7/q7kvsfRtc7yfABcc5fyFdxBhI9rO7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590405717; 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; bh=zqOQtXmRuKD62eID2q11+e9Okdfm0UQXeBHYruxTKuc=; b=GFJNik6FSupklRZsI+zYRxJrkGDZMH8gppemmAilXEasJdyoXFBbvs3YZc/bSURGrGm0ezyK+TlotRHVD1hXb9bG6HCFmDHcMjZ7owFROwWwUHxMR3B7gc8mbQxPureFs4qLb5tlsYHVyDR6ElTiqQEYBluwbyvwkCE/0FRkp80= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159040571711224.141607426415703; Mon, 25 May 2020 04:21:57 -0700 (PDT) Received: from localhost ([::1]:42344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdBB5-0005gT-PF for importer@patchew.org; Mon, 25 May 2020 07:21:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdB8W-0000ZZ-3c for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:16 -0400 Received: from mail.ispras.ru ([83.149.199.45]:54720) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdB8V-0008MQ-3f for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:15 -0400 Received: from [127.0.1.1] (unknown [62.118.151.149]) by mail.ispras.ru (Postfix) with ESMTPSA id 27FEDCD466; Mon, 25 May 2020 14:19:14 +0300 (MSK) Subject: [PATCH 2/9] tests/acceptance: add base class record/replay kernel tests From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Mon, 25 May 2020 14:19:13 +0300 Message-ID: <159040555391.2615.4700513751491354604.stgit@pasha-ThinkPad-X280> In-Reply-To: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> References: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: softfail client-ip=83.149.199.45; envelope-from=Pavel.Dovgaluk@gmail.com; helo=mail.ispras.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 07:19:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: philmd@redhat.com, dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru, crosa@redhat.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This patch adds a base for testing kernel boot recording and replaying. Each test has the phase of recording and phase of replaying. Virtual machines just boot the kernel and do not interact with the network. Structure and image links for the tests are borrowed from boot_linux_consol= e.py Testing controls the message pattern at the end of the kernel boot for both record and replay modes. In replay mode QEMU is also intended to finish the execution automatically. Signed-off-by: Pavel Dovgalyuk --- MAINTAINERS | 1=20 tests/acceptance/replay_kernel.py | 80 +++++++++++++++++++++++++++++++++= ++++ 2 files changed, 81 insertions(+) create mode 100644 tests/acceptance/replay_kernel.py diff --git a/MAINTAINERS b/MAINTAINERS index 47ef3139e6..e9a9ce4f66 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2497,6 +2497,7 @@ F: net/filter-replay.c F: include/sysemu/replay.h F: docs/replay.txt F: stubs/replay.c +F: tests/acceptance/replay_kernel.py =20 IOVA Tree M: Peter Xu diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_ke= rnel.py new file mode 100644 index 0000000000..3208179789 --- /dev/null +++ b/tests/acceptance/replay_kernel.py @@ -0,0 +1,80 @@ +# Record/replay test that boots a Linux kernel +# +# Copyright (c) 2020 ISP RAS +# +# Author: +# Pavel Dovgalyuk +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +import os +import gzip + +from avocado_qemu import Test +from avocado_qemu import wait_for_console_pattern +from avocado.utils import process +from avocado.utils import archive + +class ReplayKernel(Test): + """ + Boots a Linux kernel in record mode and checks that the console + is operational and the kernel command line is properly passed + from QEMU to the kernel. + Then replays the same scenario and verifies, that QEMU correctly + terminates. + """ + + timeout =3D 90 + + KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' + + def wait_for_console_pattern(self, success_message, vm): + wait_for_console_pattern(self, success_message, + failure_message=3D'Kernel panic - not syn= cing', + vm=3Dvm) + + def extract_from_deb(self, deb, path): + """ + Extracts a file from a deb package into the test workdir + + :param deb: path to the deb archive + :param path: path within the deb archive of the file to be extract= ed + :returns: path of the extracted file + """ + cwd =3D os.getcwd() + os.chdir(self.workdir) + file_path =3D process.run("ar t %s" % deb).stdout_text.split()[2] + process.run("ar x %s %s" % (deb, file_path)) + archive.extract(file_path, self.workdir) + os.chdir(cwd) + # Return complete path to extracted file. Because callers to + # extract_from_deb() specify 'path' with a leading slash, it is + # necessary to use os.path.relpath() as otherwise os.path.join() + # interprets it as an absolute path and drops the self.workdir par= t. + return os.path.normpath(os.path.join(self.workdir, + os.path.relpath(path, '/'))) + + def run_vm(self, kernel_path, kernel_command_line, console_pattern, re= cord, shift, args): + vm =3D self.get_vm() + vm.set_console() + if record: + mode =3D 'record' + else: + mode =3D 'replay' + vm.add_args('-icount', 'shift=3D%s,rr=3D%s,rrfile=3D%s' % + (shift, mode, os.path.join(self.workdir, 'replay.bin')= ), + '-kernel', kernel_path, + '-append', kernel_command_line, + '-net', 'none', + *args) + vm.launch() + self.wait_for_console_pattern(console_pattern, vm) + if record: + vm.shutdown() + else: + vm.wait() + + def run_rr(self, kernel_path, kernel_command_line, console_pattern, sh= ift=3D7, args=3D()): + self.run_vm(kernel_path, kernel_command_line, console_pattern, Tru= e, shift, args) + self.run_vm(kernel_path, kernel_command_line, console_pattern, Fal= se, shift, args) From nobody Sun May 5 09:32:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590405636; cv=none; d=zohomail.com; s=zohoarc; b=JZsnEutz4pIgGsjyl8c7Cw1b4Z2PqR5+WRK7kuexpdGdbGNN9Ht5QBlqoFBNtcwg02HYPCsAntWfAFBA71KtJglCk159ntIvsQraGaqkJflhBzHtE0dgrRBjG+4KYQIwzpSUDcioJgxa26tZDQTzENjG2usg1UJUDX1TVVn2DhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590405636; 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; bh=aRbRQTz/CAfc5Yxg0mNBC60hboR0y+bla4YxtrTNMTQ=; b=oE0enCo52dayM1vOIKdddmMlrxtIxn7CORUyRw83D4YLHCZ1E5u6FyZ1Vh9+qSERmLw8L8f66Am7h+7SLK0E/P5gKGB0drSI5Xywm7G0jT9MEJdg/7zAfGG/6AK27TVr+9qhynT/xtXxQnki6VmBHEtgDD/H4KegFm1xtNm8EKM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590405636939330.41275723646856; Mon, 25 May 2020 04:20:36 -0700 (PDT) Received: from localhost ([::1]:35452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdB9n-0002Sn-OC for importer@patchew.org; Mon, 25 May 2020 07:20:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdB8c-0000qu-H5 for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:22 -0400 Received: from mail.ispras.ru ([83.149.199.45]:54742) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdB8b-0008Mh-M9 for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:22 -0400 Received: from [127.0.1.1] (unknown [62.118.151.149]) by mail.ispras.ru (Postfix) with ESMTPSA id DEA7ECD466; Mon, 25 May 2020 14:19:19 +0300 (MSK) Subject: [PATCH 3/9] tests/acceptance: add kernel record/replay test for x86_64 From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Mon, 25 May 2020 14:19:19 +0300 Message-ID: <159040555939.2615.15017741446489098332.stgit@pasha-ThinkPad-X280> In-Reply-To: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> References: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: softfail client-ip=83.149.199.45; envelope-from=Pavel.Dovgaluk@gmail.com; helo=mail.ispras.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 07:19:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: philmd@redhat.com, dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru, crosa@redhat.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This patch adds a test for record/replay an execution of x86_64 machine. Execution scenario includes simple kernel boot, which allows testing basic hardware interaction in RR mode. Signed-off-by: Pavel Dovgalyuk --- tests/acceptance/replay_kernel.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_ke= rnel.py index 3208179789..00abe1e872 100644 --- a/tests/acceptance/replay_kernel.py +++ b/tests/acceptance/replay_kernel.py @@ -78,3 +78,19 @@ class ReplayKernel(Test): def run_rr(self, kernel_path, kernel_command_line, console_pattern, sh= ift=3D7, args=3D()): self.run_vm(kernel_path, kernel_command_line, console_pattern, Tru= e, shift, args) self.run_vm(kernel_path, kernel_command_line, console_pattern, Fal= se, shift, args) + + def test_x86_64_pc(self): + """ + :avocado: tags=3Darch:x86_64 + :avocado: tags=3Dmachine:pc + """ + kernel_url =3D ('https://archives.fedoraproject.org/pub/archive/fe= dora' + '/linux/releases/29/Everything/x86_64/os/images/pxeb= oot' + '/vmlinuz') + kernel_hash =3D '23bebd2680757891cf7adedb033532163a792495' + kernel_path =3D self.fetch_asset(kernel_url, asset_hash=3Dkernel_h= ash) + + kernel_command_line =3D self.KERNEL_COMMON_COMMAND_LINE + 'console= =3DttyS0' + console_pattern =3D 'Kernel command line: %s' % kernel_command_line + + self.run_rr(kernel_path, kernel_command_line, console_pattern) From nobody Sun May 5 09:32:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590405713; cv=none; d=zohomail.com; s=zohoarc; b=DdH79AmKdOEaXGcdmZOgfWomGFNfFMLzPyoYYEkjHJgHLhXX7BfkPTVE6VzLctE3nhDFP2PM7GTEPNZ5ankGFmBM70OmI+76XMziCkjH5ur4aGnYpEexgNZxW/5wy9N10nEeUZ8Bqv+fHigrEH/tuu/IlRDXLYHtpTruBxNouYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590405713; 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; bh=+e9bgDbuwU03xU53cMzIGM51wMzUa0o4RSKsyoDLvUQ=; b=DlUGXmao31HNqdrzi3KRLad86opNinhvgWhgIzdmDF41sXJxg5nKggPRWG5GYXV+fhmz/C+0nMsIfncnhd9vsa451o35j19hG12XiAEgf40nvzFHaSk8xUcOqkqX0udnHuG3w645vqSKSdiY/wVXk3+pzdegVebE974DBPy3qiU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590405713058255.3825922168088; Mon, 25 May 2020 04:21:53 -0700 (PDT) Received: from localhost ([::1]:41948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdBB1-0005Vr-Pl for importer@patchew.org; Mon, 25 May 2020 07:21:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdB8h-00011a-3L for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:27 -0400 Received: from mail.ispras.ru ([83.149.199.45]:54756) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdB8g-0008N0-B0 for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:26 -0400 Received: from [127.0.1.1] (unknown [62.118.151.149]) by mail.ispras.ru (Postfix) with ESMTPSA id 6001DCD460; Mon, 25 May 2020 14:19:25 +0300 (MSK) Subject: [PATCH 4/9] tests/acceptance: add record/replay test for aarch64 From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Mon, 25 May 2020 14:19:25 +0300 Message-ID: <159040556513.2615.16719113739608959515.stgit@pasha-ThinkPad-X280> In-Reply-To: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> References: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: softfail client-ip=83.149.199.45; envelope-from=Pavel.Dovgaluk@gmail.com; helo=mail.ispras.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 07:19:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: philmd@redhat.com, dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru, crosa@redhat.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This patch adds a test for record/replay of the kernel image boot for aarch64 platform. Signed-off-by: Pavel Dovgalyuk --- tests/acceptance/replay_kernel.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_ke= rnel.py index 00abe1e872..1d2cfebc85 100644 --- a/tests/acceptance/replay_kernel.py +++ b/tests/acceptance/replay_kernel.py @@ -94,3 +94,21 @@ class ReplayKernel(Test): console_pattern =3D 'Kernel command line: %s' % kernel_command_line =20 self.run_rr(kernel_path, kernel_command_line, console_pattern) + + def test_aarch64_virt(self): + """ + :avocado: tags=3Darch:aarch64 + :avocado: tags=3Dmachine:virt + """ + kernel_url =3D ('https://archives.fedoraproject.org/pub/archive/fe= dora' + '/linux/releases/29/Everything/aarch64/os/images/pxe= boot' + '/vmlinuz') + kernel_hash =3D '8c73e469fc6ea06a58dc83a628fc695b693b8493' + kernel_path =3D self.fetch_asset(kernel_url, asset_hash=3Dkernel_h= ash) + + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyAMA0') + console_pattern =3D 'Kernel command line: %s' % kernel_command_line + + self.run_rr(kernel_path, kernel_command_line, console_pattern, + args=3D('-cpu', 'cortex-a53')) From nobody Sun May 5 09:32:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590405896; cv=none; d=zohomail.com; s=zohoarc; b=KYkxYi1YSApeF9zcuBAGyD6xxV/sA9C7OigajZVQqszCcEoCdlcXgfqmLqwU5YZ/KxBonF/RoGzbMEfp7VS7ui0YMBb9GCfm1yzOWznnmvEIzHxDoV6dD8kESSlctwUu2QTlu1nBChElLb4iG2mWK0yU+BUppUUVQ6/HLjfVCek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590405896; 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; bh=19wfoSoSvKiZ2FNmA9Cwt4y3EZMD8GKotdVPO3a83kA=; b=C+2id7esWlWWUQ2niXg6k+iWu1iyRgDxEweKkTS2MoqQ4nXynQt9cLClBYclFRcx5iVzlTimKJeQII8aZXR8A3DU7t7u687zAr+CGHnkxOg078Z5h4IGlOnQ382hgLDCfDVnSuvtsU3tM1pPZsMTyT2CWMDvwfzjpnhRi5UygO0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590405896946591.4392973155847; Mon, 25 May 2020 04:24:56 -0700 (PDT) Received: from localhost ([::1]:54128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdBDx-00023L-Pj for importer@patchew.org; Mon, 25 May 2020 07:24:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57450) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdB8n-0001H1-2X for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:33 -0400 Received: from mail.ispras.ru ([83.149.199.45]:54782) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdB8l-0008NP-Pm for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:32 -0400 Received: from [127.0.1.1] (unknown [62.118.151.149]) by mail.ispras.ru (Postfix) with ESMTPSA id D19C2CD460; Mon, 25 May 2020 14:19:30 +0300 (MSK) Subject: [PATCH 5/9] tests/acceptance: add record/replay test for arm From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Mon, 25 May 2020 14:19:30 +0300 Message-ID: <159040557060.2615.13773529559912952341.stgit@pasha-ThinkPad-X280> In-Reply-To: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> References: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: softfail client-ip=83.149.199.45; envelope-from=Pavel.Dovgaluk@gmail.com; helo=mail.ispras.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 07:19:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: philmd@redhat.com, dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru, crosa@redhat.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This patch adds a test for record/replay of the kernel image boot for two different arm platforms. Signed-off-by: Pavel Dovgalyuk --- tests/acceptance/replay_kernel.py | 46 +++++++++++++++++++++++++++++++++= ++++ 1 file changed, 46 insertions(+) diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_ke= rnel.py index 1d2cfebc85..41c8ca3c99 100644 --- a/tests/acceptance/replay_kernel.py +++ b/tests/acceptance/replay_kernel.py @@ -112,3 +112,49 @@ class ReplayKernel(Test): =20 self.run_rr(kernel_path, kernel_command_line, console_pattern, args=3D('-cpu', 'cortex-a53')) + + def test_arm_virt(self): + """ + :avocado: tags=3Darch:arm + :avocado: tags=3Dmachine:virt + """ + kernel_url =3D ('https://archives.fedoraproject.org/pub/archive/fe= dora' + '/linux/releases/29/Everything/armhfp/os/images/pxeb= oot' + '/vmlinuz') + kernel_hash =3D 'e9826d741b4fb04cadba8d4824d1ed3b7fb8b4d4' + kernel_path =3D self.fetch_asset(kernel_url, asset_hash=3Dkernel_h= ash) + + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyAMA0') + console_pattern =3D 'Kernel command line: %s' % kernel_command_line + + self.run_rr(kernel_path, kernel_command_line, console_pattern) + + def test_arm_cubieboard_initrd(self): + """ + :avocado: tags=3Darch:arm + :avocado: tags=3Dmachine:cubieboard + """ + deb_url =3D ('https://apt.armbian.com/pool/main/l/' + 'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.de= b') + deb_hash =3D '1334c29c44d984ffa05ed10de8c3361f33d78315' + deb_path =3D self.fetch_asset(deb_url, asset_hash=3Ddeb_hash) + kernel_path =3D self.extract_from_deb(deb_path, + '/boot/vmlinuz-4.20.7-sunxi') + dtb_path =3D '/usr/lib/linux-image-dev-sunxi/sun4i-a10-cubieboard.= dtb' + dtb_path =3D self.extract_from_deb(deb_path, dtb_path) + initrd_url =3D ('https://github.com/groeck/linux-build-test/raw/' + '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/' + 'arm/rootfs-armv5.cpio.gz') + initrd_hash =3D '2b50f1873e113523967806f4da2afe385462ff9b' + initrd_path_gz =3D self.fetch_asset(initrd_url, asset_hash=3Dinitr= d_hash) + initrd_path =3D os.path.join(self.workdir, 'rootfs.cpio') + archive.gzip_uncompress(initrd_path_gz, initrd_path) + + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0,115200 ' + 'usbcore.nousb ' + 'panic=3D-1 noreboot') + console_pattern =3D 'Boot successful.' + self.run_rr(kernel_path, kernel_command_line, console_pattern, + args=3D('-dtb', dtb_path, '-initrd', initrd_path, '-no-reboot'= )) From nobody Sun May 5 09:32:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590406008; cv=none; d=zohomail.com; s=zohoarc; b=N0T4BljLzs4gjLpp3uxFnX6Apv41wsVNBet9BwqOJhNAfALIReYnchqJfOMxOmVb8vRcwUp7PmV/nbcmh1iVyclOuiDnsp6TBl/Xx64t7MSn1ehhJxYBsmeRTLPHfuD0BtzS/6VXM1FlXnE7cBhETeXc5Cb30TWu7QubrFcH138= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590406008; 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; bh=29xWdTulzzSdFjsGOze5miGE8d76aGcOlTLeU5BUawY=; b=lz86ft2hAFoKy/eUKNAPmU9cMCZs8hV8CuydW5St5PMO6tlilZ1usjVk+QDdEr5u3jdRiQYiIcz8X5uZtk69bJxIkk1NHMZll6JUK4n6gPstEYOJfw39pYIpMBYAC84Rk5SkU0bHZqNCz4Mm28IUFkK3aeR9ByDWyl4H5V0aqdY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590406008367100.7723091950478; Mon, 25 May 2020 04:26:48 -0700 (PDT) Received: from localhost ([::1]:60210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdBFm-0004tJ-Ur for importer@patchew.org; Mon, 25 May 2020 07:26:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdB8s-0001WO-AZ for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:38 -0400 Received: from mail.ispras.ru ([83.149.199.45]:54810) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdB8r-0008O2-IY for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:38 -0400 Received: from [127.0.1.1] (unknown [62.118.151.149]) by mail.ispras.ru (Postfix) with ESMTPSA id 5E57ECD466; Mon, 25 May 2020 14:19:36 +0300 (MSK) Subject: [PATCH 6/9] tests/acceptance: add record/replay test for ppc64 From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Mon, 25 May 2020 14:19:36 +0300 Message-ID: <159040557608.2615.17453534013867754631.stgit@pasha-ThinkPad-X280> In-Reply-To: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> References: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: softfail client-ip=83.149.199.45; envelope-from=Pavel.Dovgaluk@gmail.com; helo=mail.ispras.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 07:19:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: philmd@redhat.com, dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru, crosa@redhat.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This patch adds a test for record/replay of the kernel image boot for ppc64 platform. Signed-off-by: Pavel Dovgalyuk --- tests/acceptance/replay_kernel.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_ke= rnel.py index 41c8ca3c99..9931f87bd5 100644 --- a/tests/acceptance/replay_kernel.py +++ b/tests/acceptance/replay_kernel.py @@ -158,3 +158,18 @@ class ReplayKernel(Test): console_pattern =3D 'Boot successful.' self.run_rr(kernel_path, kernel_command_line, console_pattern, args=3D('-dtb', dtb_path, '-initrd', initrd_path, '-no-reboot'= )) + + def test_ppc64_pseries(self): + """ + :avocado: tags=3Darch:ppc64 + :avocado: tags=3Dmachine:pseries + """ + kernel_url =3D ('https://archives.fedoraproject.org/pub/archive' + '/fedora-secondary/releases/29/Everything/ppc64le/os' + '/ppc/ppc64/vmlinuz') + kernel_hash =3D '3fe04abfc852b66653b8c3c897a59a689270bc77' + kernel_path =3D self.fetch_asset(kernel_url, asset_hash=3Dkernel_h= ash) + + kernel_command_line =3D self.KERNEL_COMMON_COMMAND_LINE + 'console= =3Dhvc0' + console_pattern =3D 'Kernel command line: %s' % kernel_command_line + self.run_rr(kernel_path, kernel_command_line, console_pattern) From nobody Sun May 5 09:32:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590405813; cv=none; d=zohomail.com; s=zohoarc; b=i47aA56M1LwT+PwOoWJoeyqF9iv/NLGf4GoqvkMowsQt3QLSLfZq1wUzhuPQT96HdY2Nbb2GThqEcy7qVEmyHDIrHyO4rmCKdOFxEUC4Je0pFwC2OhMSA9AulhWHvUnL9FniRt5wYl529OjQluXyjfrD50l+61caPp1SLFII+YQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590405813; 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; bh=hOotqGhth8Gf4iXO3q9DVsxYnEvu35gqSkNWoKroG8Y=; b=DOPsh/4UMigDlSbdSgDCif0Q0bz4lfxUnqos1P0jKT6ZTqC2aDb5ebnzkopcmXRXPBzgaKmNDqtYWd0Wb6EvnE3f8h7Ss14i+FS9/ycDH97tNUQblFr0Gi7bp1cIlECAn7OxH6NtGm6esLSAoey55cOq5Zogy/JOoSFZOWvTy7c= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590405813666663.973771295185; Mon, 25 May 2020 04:23:33 -0700 (PDT) Received: from localhost ([::1]:48098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdBCe-00080F-FH for importer@patchew.org; Mon, 25 May 2020 07:23:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdB8y-0001ek-4z for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:44 -0400 Received: from mail.ispras.ru ([83.149.199.45]:54866) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdB8x-0008Pb-B4 for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:43 -0400 Received: from [127.0.1.1] (unknown [62.118.151.149]) by mail.ispras.ru (Postfix) with ESMTPSA id 1BA89CD460; Mon, 25 May 2020 14:19:42 +0300 (MSK) Subject: [PATCH 7/9] tests/acceptance: add record/replay test for m68k From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Mon, 25 May 2020 14:19:41 +0300 Message-ID: <159040558183.2615.5681444460877087880.stgit@pasha-ThinkPad-X280> In-Reply-To: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> References: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: softfail client-ip=83.149.199.45; envelope-from=Pavel.Dovgaluk@gmail.com; helo=mail.ispras.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 07:19:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: philmd@redhat.com, dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru, crosa@redhat.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This patch adds a test for record/replay of the kernel image boot for m68k platform. Signed-off-by: Pavel Dovgalyuk --- tests/acceptance/replay_kernel.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_ke= rnel.py index 9931f87bd5..4c786b1565 100644 --- a/tests/acceptance/replay_kernel.py +++ b/tests/acceptance/replay_kernel.py @@ -173,3 +173,21 @@ class ReplayKernel(Test): kernel_command_line =3D self.KERNEL_COMMON_COMMAND_LINE + 'console= =3Dhvc0' console_pattern =3D 'Kernel command line: %s' % kernel_command_line self.run_rr(kernel_path, kernel_command_line, console_pattern) + + def test_m68k_q800(self): + """ + :avocado: tags=3Darch:m68k + :avocado: tags=3Dmachine:q800 + """ + deb_url =3D ('https://snapshot.debian.org/archive/debian-ports' + '/20191021T083923Z/pool-m68k/main' + '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.ude= b') + deb_hash =3D '044954bb9be4160a3ce81f8bc1b5e856b75cccd1' + deb_path =3D self.fetch_asset(deb_url, asset_hash=3Ddeb_hash) + kernel_path =3D self.extract_from_deb(deb_path, + '/boot/vmlinux-5.3.0-1-m68k') + + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0 vga=3Doff') + console_pattern =3D 'No filesystem could mount root' + self.run_rr(kernel_path, kernel_command_line, console_pattern) From nobody Sun May 5 09:32:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590406076; cv=none; d=zohomail.com; s=zohoarc; b=k9Bvjm+cr2MHD1ZhRjyTM7fxJV3T/yx51nwLBGR5ezH4jYvAtqRARzNfsmZc1c/hyHA+Ve/fXPtcCSz9Le3lJ6I7huFsGBv77l6iCGIiygChBcSCCmES0x1UJZaYCCf6i4DBx5p5nH5pzN3sAz1BlMmebuV50ikFP5SN0la29JM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590406076; 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; bh=tXV/9JqIXI5UWgZXVUTUnLjR4lKfjMXQsVm5NdOLVQc=; b=DT0Hc/uAaVo1w7HxZI3fNqvjqiYrwnf0f16wPH39DgbcJFduLoK5gFP3tB6rnPm1a4pgh0FO8f8yP3mpZkFcu3Y4XN9xn83kNxS+7jUXZCufM7slntp6qDTABi8gAfzkTkHeT1wfdni3T52ip8d7hlC75gbCgj5fn+eVWpxqtTU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590406076835438.28785934097857; Mon, 25 May 2020 04:27:56 -0700 (PDT) Received: from localhost ([::1]:36132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdBGs-0006Zh-M6 for importer@patchew.org; Mon, 25 May 2020 07:27:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdB93-0001mS-Ni for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:49 -0400 Received: from mail.ispras.ru ([83.149.199.45]:54882) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdB92-0008QJ-Ns for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:49 -0400 Received: from [127.0.1.1] (unknown [62.118.151.149]) by mail.ispras.ru (Postfix) with ESMTPSA id C68BCCD466; Mon, 25 May 2020 14:19:47 +0300 (MSK) Subject: [PATCH 8/9] tests/acceptance: record/replay tests with advcal images From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Mon, 25 May 2020 14:19:47 +0300 Message-ID: <159040558755.2615.4869959098521372877.stgit@pasha-ThinkPad-X280> In-Reply-To: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> References: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: softfail client-ip=83.149.199.45; envelope-from=Pavel.Dovgaluk@gmail.com; helo=mail.ispras.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 07:19:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: philmd@redhat.com, dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru, crosa@redhat.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This patch adds more record/replay tests with kernel images. Signed-off-by: Pavel Dovgalyuk --- tests/acceptance/replay_kernel.py | 80 +++++++++++++++++++++++++++++++++= ++++ 1 file changed, 80 insertions(+) diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_ke= rnel.py index 4c786b1565..3849db7f3a 100644 --- a/tests/acceptance/replay_kernel.py +++ b/tests/acceptance/replay_kernel.py @@ -191,3 +191,83 @@ class ReplayKernel(Test): 'console=3DttyS0 vga=3Doff') console_pattern =3D 'No filesystem could mount root' self.run_rr(kernel_path, kernel_command_line, console_pattern) + + def do_test_advcal_2018(self, day, tar_hash, kernel_name, args=3D()): + tar_url =3D ('https://www.qemu-advent-calendar.org' + '/2018/download/day' + day + '.tar.xz') + file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) + archive.extract(file_path, self.workdir) + + kernel_path =3D self.workdir + '/day' + day + '/' + kernel_name + kernel_command_line =3D '' + console_pattern =3D 'QEMU advent calendar' + self.run_rr(kernel_path, kernel_command_line, console_pattern, + args=3Dargs) + + def test_arm_vexpressa9(self): + """ + :avocado: tags=3Darch:arm + :avocado: tags=3Dmachine:vexpress-a9 + """ + tar_hash =3D '32b7677ce8b6f1471fb0059865f451169934245b' + self.do_test_advcal_2018('16', tar_hash, 'winter.zImage', + ('-dtb', self.workdir + '/day16/vexpress-v2p-ca9.dtb')) + + def test_m68k_mcf5208evb(self): + """ + :avocado: tags=3Darch:m68k + :avocado: tags=3Dmachine:mcf5208evb + """ + tar_hash =3D 'ac688fd00561a2b6ce1359f9ff6aa2b98c9a570c' + self.do_test_advcal_2018('07', tar_hash, 'sanity-clause.elf') + + def test_microblaze_s3adsp1800(self): + """ + :avocado: tags=3Darch:microblaze + :avocado: tags=3Dmachine:petalogix-s3adsp1800 + """ + tar_hash =3D '08bf3e3bfb6b6c7ce1e54ab65d54e189f2caf13f' + self.do_test_advcal_2018('17', tar_hash, 'ballerina.bin') + + def test_ppc64_e500(self): + """ + :avocado: tags=3Darch:ppc64 + :avocado: tags=3Dmachine:ppce500 + """ + tar_hash =3D '6951d86d644b302898da2fd701739c9406527fe1' + self.do_test_advcal_2018('19', tar_hash, 'uImage', ('-cpu', 'e5500= ')) + + def test_ppc_g3beige(self): + """ + :avocado: tags=3Darch:ppc + :avocado: tags=3Dmachine:g3beige + """ + tar_hash =3D 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc' + self.do_test_advcal_2018('15', tar_hash, 'invaders.elf', + ('-M', 'graphics=3Doff')) + + def test_ppc_mac99(self): + """ + :avocado: tags=3Darch:ppc + :avocado: tags=3Dmachine:mac99 + """ + tar_hash =3D 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc' + self.do_test_advcal_2018('15', tar_hash, 'invaders.elf', + ('-M', 'graphics=3Doff')) + + def test_sparc_ss20(self): + """ + :avocado: tags=3Darch:sparc + :avocado: tags=3Dmachine:SS-20 + """ + tar_hash =3D 'b18550d5d61c7615d989a06edace051017726a9f' + self.do_test_advcal_2018('11', tar_hash, 'zImage.elf') + + def test_xtensa_lx60(self): + """ + :avocado: tags=3Darch:xtensa + :avocado: tags=3Dmachine:lx60 + """ + tar_hash =3D '49e88d9933742f0164b60839886c9739cb7a0d34' + self.do_test_advcal_2018('02', tar_hash, 'santas-sleigh-ride.elf', + ('-cpu', 'dc233c')) From nobody Sun May 5 09:32:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590406191; cv=none; d=zohomail.com; s=zohoarc; b=Kun5dfyeuQqcyli+yHbGcoHFZcGyif4GLnvUEsk7OLdEAiNkKVxSL0QInm+61JpPqJYE8vutD+B7pldEHBNNkeiDDMiBLk5b5uoF+1ibNzg5ojRxWB4fSvsc5H3P/gnTQ/w9b3keZ5PntY7VLXbJtk86vPAH5VpuTSyRvJ2Tv7g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590406191; 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; bh=sDFQvaTtydQkA1vruOwvmB1UukN2Stcon/JE4mUQ2X0=; b=dJdIL8p7eWGrla1Vzy78ROBaalfE/JzGGFRC8NVUUE7RuUertszoI7Y4htW4v1oOOxiGLlL2Ag+e+9dGvPt3/I6RK0P1RQTP4Y7LuJjZ5pSJIEeOonGGHW4c6x5Wv4ME5zjWd2EheirGSHagx/OeOw+jo8qgTIbRLWSUmyvDY08= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590406191468785.7377230754943; Mon, 25 May 2020 04:29:51 -0700 (PDT) Received: from localhost ([::1]:43576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdBIk-0001AK-A0 for importer@patchew.org; Mon, 25 May 2020 07:29:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdB99-00021M-8S for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:56 -0400 Received: from mail.ispras.ru ([83.149.199.45]:54930) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdB98-0008Qp-7g for qemu-devel@nongnu.org; Mon, 25 May 2020 07:19:55 -0400 Received: from [127.0.1.1] (unknown [62.118.151.149]) by mail.ispras.ru (Postfix) with ESMTPSA id 40915CD466; Mon, 25 May 2020 14:19:53 +0300 (MSK) Subject: [PATCH 9/9] tests/acceptance: Linux boot test for record/replay From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Mon, 25 May 2020 14:19:53 +0300 Message-ID: <159040559302.2615.18392869399102145442.stgit@pasha-ThinkPad-X280> In-Reply-To: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> References: <159040554265.2615.8993443700754452381.stgit@pasha-ThinkPad-X280> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: softfail client-ip=83.149.199.45; envelope-from=Pavel.Dovgaluk@gmail.com; helo=mail.ispras.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 07:19:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: 17 X-Spam_score: 1.7 X-Spam_bar: + X-Spam_report: (1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, FROM_WORDY=1, NML_ADSP_CUSTOM_MED=0.9, SPF_SOFTFAIL=0.665, T_FILL_THIS_FORM_SHORT=0.01, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: philmd@redhat.com, dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru, crosa@redhat.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This patch adds a test for record/replay, which boots Linux image from the disk and interacts with the network. The idea and code of this test is borrowed from boot_linux.py However, currently record/replay works only for x86_64, therefore other tests were excluded. Each test consists of the following phases: - downloading the disk image - recording the execution - replaying the execution Replay does not validates the output, but waits until QEMU finishes the execution. This is reasonable, because QEMU usually hangs when replay goes wrong. Signed-off-by: Pavel Dovgalyuk --- MAINTAINERS | 1=20 tests/acceptance/replay_linux.py | 140 ++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 141 insertions(+) create mode 100644 tests/acceptance/replay_linux.py diff --git a/MAINTAINERS b/MAINTAINERS index e9a9ce4f66..97f066a9b2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2498,6 +2498,7 @@ F: include/sysemu/replay.h F: docs/replay.txt F: stubs/replay.c F: tests/acceptance/replay_kernel.py +F: tests/acceptance/replay_linux.py =20 IOVA Tree M: Peter Xu diff --git a/tests/acceptance/replay_linux.py b/tests/acceptance/replay_lin= ux.py new file mode 100644 index 0000000000..08eedb23ef --- /dev/null +++ b/tests/acceptance/replay_linux.py @@ -0,0 +1,140 @@ +# Record/replay test that boots a complete Linux system via a cloud image +# +# Copyright (c) 2020 ISP RAS +# +# Author: +# Pavel Dovgalyuk +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +import os + +from avocado_qemu import Test, BUILD_DIR + +from avocado.utils import cloudinit +from avocado.utils import network +from avocado.utils import vmimage +from avocado.utils import datadrainer +from avocado.utils.path import find_command + +class ReplayLinux(Test): + """ + Boots a Linux system, checking for a successful initialization + """ + + timeout =3D 1800 + chksum =3D None + hdd =3D 'ide-hd' + cd =3D 'ide-cd' + bus =3D '' + + def setUp(self): + super(ReplayLinux, self).setUp() + self.prepare_boot() + self.prepare_cloudinit() + + def vm_add_disk(self, vm, path, id, device): + bus_string =3D '' + if self.bus !=3D '': + bus_string =3D ',bus=3D%s.%d' % (self.bus, id,) + vm.add_args('-drive', 'file=3D%s,snapshot,id=3Ddisk%s,if=3Dnone' %= (path, id)) + vm.add_args('-drive', 'driver=3Dblkreplay,id=3Ddisk%s-rr,if=3Dnone= ,image=3Ddisk%s' % (id, id)) + vm.add_args('-device', '%s,drive=3Ddisk%s-rr%s' % (device, id, bus= _string)) + + def prepare_boot(self): + self.log.debug('Looking for and selecting a qemu-img binary to be ' + 'used to create the bootable snapshot image') + # If qemu-img has been built, use it, otherwise the system wide one + # will be used. If none is available, the test will cancel. + qemu_img =3D os.path.join(BUILD_DIR, 'qemu-img') + if not os.path.exists(qemu_img): + qemu_img =3D find_command('qemu-img', False) + if qemu_img is False: + self.cancel('Could not find "qemu-img", which is required to ' + 'create the bootable image') + vmimage.QEMU_IMG =3D qemu_img + + self.log.info('Downloading/preparing boot image') + # Fedora 31 only provides ppc64le images + image_arch =3D self.arch + if image_arch =3D=3D 'ppc64': + image_arch =3D 'ppc64le' + try: + self.boot =3D vmimage.get( + 'fedora', arch=3Dimage_arch, version=3D'31', + checksum=3Dself.chksum, + algorithm=3D'sha256', + cache_dir=3Dself.cache_dirs[0], + snapshot_dir=3Dself.workdir) + except: + self.cancel('Failed to download/prepare boot image') + + def prepare_cloudinit(self): + self.log.info('Preparing cloudinit image') + try: + self.cloudinit_iso =3D os.path.join(self.workdir, 'cloudinit.i= so') + self.phone_home_port =3D network.find_free_port() + cloudinit.iso(self.cloudinit_iso, self.name, + username=3D'root', + password=3D'password', + # QEMU's hard coded usermode router address + phone_home_host=3D'10.0.2.2', + phone_home_port=3Dself.phone_home_port) + except Exception: + self.cancel('Failed to prepared cloudinit image') + + def launch_and_wait(self, record, args, shift): + vm =3D self.get_vm() + vm.add_args('-smp', '1') + vm.add_args('-m', '1024') + vm.add_args('-object', 'filter-replay,id=3Dreplay,netdev=3Dhub0por= t0') + vm.add_args(*args) + self.vm_add_disk(vm, self.boot.path, 0, self.hdd) + self.vm_add_disk(vm, self.cloudinit_iso, 1, self.cd) + if record: + mode =3D 'record' + else: + mode =3D 'replay' + vm.add_args('-icount', 'shift=3D%s,rr=3D%s,rrfile=3D%s' % + (shift, mode, os.path.join(self.workdir, 'replay.bin')= )) + + vm.set_console() + vm.launch() + console_drainer =3D datadrainer.LineLogger(vm.console_socket.filen= o(), + logger=3Dself.log.getChil= d('console'), + stop_check=3D(lambda : no= t vm.is_running())) + console_drainer.start() + if record: + self.log.info('VM launched, waiting for boot confirmation from= guest') + cloudinit.wait_for_phone_home(('0.0.0.0', self.phone_home_port= ), self.name) + vm.shutdown() + else: + self.log.info('VM launched, waiting the recorded execution to = be replayed') + vm.wait() + + def run_rr(self, args=3D(), shift=3D7): + self.launch_and_wait(True, args, shift) + self.launch_and_wait(False, args, shift) + +class ReplayLinuxX8664(ReplayLinux): + """ + :avocado: tags=3Darch:x86_64 + """ + bus =3D 'ide' + + chksum =3D 'e3c1b309d9203604922d6e255c2c5d098a309c2d46215d8fc026954f3c= 5c27a0' + + def test_pc_i440fx(self): + """ + :avocado: tags=3Dmachine:pc + :avocado: tags=3Daccel:tcg + """ + self.run_rr(shift=3D1) + + def test_pc_q35(self): + """ + :avocado: tags=3Dmachine:q35 + :avocado: tags=3Daccel:tcg + """ + self.run_rr(shift=3D3)