From patchwork Sun May 31 16:38:45 2020 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: 11580775 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87F8F90 for ; Sun, 31 May 2020 16:40:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7025B207C4 for ; Sun, 31 May 2020 16:40:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eAQDFuu4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728415AbgEaQk4 (ORCPT ); Sun, 31 May 2020 12:40:56 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:26139 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728408AbgEaQk4 (ORCPT ); Sun, 31 May 2020 12:40:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943255; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5kh3KwB/jxedDy9sx3WKrEz/2+qdiWFHqjY6mnOtPis=; b=eAQDFuu4DWxSdrg21aWyOUFMK+8xdM+GLYQGPtczUVJQFuZbrVKOlyUfkEs5/H8LsVDVu8 LLnyjVLVC0144TI15+AcrQLeQjpKkp15P+KlNwEcNQlc3eTUDqULxn49nA280nYo0ebqpE qjg87L+Ohr9CjQf7J+dt2IVqnQDN5o0= 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-410-CTDLEOYfOw2YWxz8dpXi9Q-1; Sun, 31 May 2020 12:40:53 -0400 X-MC-Unique: CTDLEOYfOw2YWxz8dpXi9Q-1 Received: by mail-wr1-f72.google.com with SMTP id e1so3635565wrm.3 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=oix1IRUy4KkiRsl7/mBd72k9+7oFdkyYtrGJv2lHOXoB1Y+PaA7NIDllz4iZNHeHYg b2jhbDgdL5bGF9yujLzudXIPLbuVvHOTewn9t2oS3uZ48RFZhlRG47Jdd9x/7nbHQJVt MjtqwD6Bat6U6YViF9O/EqzQ0WrVWvxfxupjFbPVEd4MFc/dURUnH5ZO8WE5VW8+ZOSv L4VYsLV6hmX8BqCFzGDpMHBvlNztpEKAMv2ngWs+zZi1A140GXSMyHOOLDMiBSWlIKls HdyeT/TT4NnINVewNNirz/Dj8A9HCjIVRROGe8S0KgN6hctsPwdEwutv77/6UMLS0FKb iYsA== X-Gm-Message-State: AOAM532YDnN7HkvK1lVzKOyS7QV9C13ZpNWZ5iouAX1C6qtdmPadZUmI PfUG4NkQd7HRLI1Vt3rUsaknIhEp5zh7d5dsNH5yx+dBPDhhB0ni9RzQ6JuU64Cx5howcjvH8W4 WU+8Kf8vho+rg X-Received: by 2002:a1c:7517:: with SMTP id o23mr3694859wmc.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_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Cleber Rosa , Kevin Wolf , kvm@vger.kernel.org, Richard Henderson , Fam Zheng , Eduardo Habkost , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Max Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Markus Armbruster , Marcelo Tosatti , qemu-block@nongnu.org, Pavel Dovgalyuk , Pavel Dovgalyuk 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 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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