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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 3E3A0C433E0 for ; Sun, 31 May 2020 16:52:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 07EA62074A for ; Sun, 31 May 2020 16:52:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JexXJwL/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07EA62074A 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]:36046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfRCB-00046X-9B for qemu-devel@archiver.kernel.org; Sun, 31 May 2020 12:52:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfR18-0004HT-Af for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:58 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:44170 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfR17-0007I1-Eh for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5kh3KwB/jxedDy9sx3WKrEz/2+qdiWFHqjY6mnOtPis=; b=JexXJwL/NB+846bX/LB3d/b8dkJKwRIe10aS+7uSYK6MjZaj74Ui4mLI7HQ46pfWTOCjy/ ZnMFgYBOUOEkdsVANrG7IS4X4VX/yZeNfMrsptxyc37OVQUqFAtfJssYNoldVJ+wOHum3F qPIIjrOBUtylNHRzUxkP77Na77pOsl0= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-391-Ctx1l_zKOdSb29KMKY2glw-1; Sun, 31 May 2020 12:40:53 -0400 X-MC-Unique: Ctx1l_zKOdSb29KMKY2glw-1 Received: by mail-wr1-f72.google.com with SMTP id a4so3616028wrp.5 for ; Sun, 31 May 2020 09:40:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5kh3KwB/jxedDy9sx3WKrEz/2+qdiWFHqjY6mnOtPis=; b=E1InrIvJ9QB9e+LvomqyHmsneMuZPuby0zflXNpeS+b+aN2V2vUzn53m1NdK6SM6fB tp0iPu1pZRbPL35qwC+irz69sPZhyd0pSKug7f3Tfi7WEGNa1OOgWPSXvMwzhMXkSRFB dYnC6nII0caNQx9NDr99GLu5amKdvYTBde14Qz6QyPAbqiywHqC4X0nM7UZ+ngPkach9 2am8VMr4g2gmXV6T0C5A4CWVWD6wzoEMYi/z8Uy8lYgLpVAMvrnbpRqKC4bPSmnrxTY+ 1EtbveZl0K8d5zAV6oqzT69sNQQ4kz+eWoR2Mj2RG6LO9iCcUTBEVnC/l/wTFSmVM/EI v10Q== X-Gm-Message-State: AOAM531dh7+RAk6DBSR0fJPC0r8rYR4L0CbUvRn8EttuEejfkOD72c2w tWhoX+Hu8xZCE6XSA1gJfJvb/O/PxQ+NPR4h09IdVKkmbsKUMH0B++8Jz08uxjkEkmQQRf7DNOI Mz+tJS+GjkpHrSQ0= X-Received: by 2002:a1c:7517:: with SMTP id o23mr3694862wmc.7.1590943251918; Sun, 31 May 2020 09:40:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgg7fWuhgUuVeOwz5AFukgiuotsYWI2AIs/F0Y1zcZ15fa/CgxkrebrEP3uzeGGoMSBlmEew== X-Received: by 2002:a1c:7517:: with SMTP id o23mr3694845wmc.7.1590943251774; Sun, 31 May 2020 09:40:51 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id e15sm9223356wme.9.2020.05.31.09.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:40:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 24/25] tests/acceptance: refactor boot_linux_console test to allow code reuse Date: Sun, 31 May 2020 18:38:45 +0200 Message-Id: <20200531163846.25363-25-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8; text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 12:38:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, 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: Kevin Wolf , Fam Zheng , Eduardo Habkost , kvm@vger.kernel.org, Pavel Dovgalyuk , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , Pavel Dovgalyuk , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Pavel Dovgalyuk This patch splits code in BootLinuxConsole class into two different classes to allow reusing it by record/replay tests. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Alex Bennée Tested-by: Philippe Mathieu-Daudé Message-Id: <159073588490.20809.13942096070255577558.stgit@pasha-ThinkPad-X280> Signed-off-by: Philippe Mathieu-Daudé --- tests/acceptance/boot_linux_console.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index c6b06a1a13..12725d4529 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -28,19 +28,13 @@ except CmdNotFoundError: P7ZIP_AVAILABLE = False -class BootLinuxConsole(Test): - """ - Boots a Linux kernel and checks that the console is operational and the - kernel command line is properly passed from QEMU to the kernel - """ - - timeout = 90 - +class LinuxKernelTest(Test): KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' - def wait_for_console_pattern(self, success_message): + def wait_for_console_pattern(self, success_message, vm=None): wait_for_console_pattern(self, success_message, - failure_message='Kernel panic - not syncing') + failure_message='Kernel panic - not syncing', + vm=vm) def extract_from_deb(self, deb, path): """ @@ -79,6 +73,13 @@ def extract_from_rpm(self, rpm, path): os.chdir(cwd) return os.path.normpath(os.path.join(self.workdir, path)) +class BootLinuxConsole(LinuxKernelTest): + """ + Boots a Linux kernel and checks that the console is operational and the + kernel command line is properly passed from QEMU to the kernel + """ + timeout = 90 + def test_x86_64_pc(self): """ :avocado: tags=arch:x86_64 -- 2.21.3