From nobody Mon Feb 9 12:43:21 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620083069; cv=none; d=zohomail.com; s=zohoarc; b=TZLaOIZK+rYPhB/zU9I4etNjPBERpUiVZ/NcwemMs/tdtnbjKu9kXW6cdFk99qnH7JsM2EkkRU8Z091vQv2ZnYl83+AghMIEKz7XCEM/HBxH8vY912tm8VqyAhht3zoHBNJMq8IULYSQdcVIx2wM0RlINekWtHUfaOEz7/rnifo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620083069; 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=+C14LeSAWSNkxm/A+5bC2ZEsXaXapDFhzDpcd9j4pfw=; b=TRdlFA8Ukwy5ld6kI4DgB9Zox5cxL6XpgqYv1EYMzOP/6JJ0SdBSfP5GVR7B58jNBOqQoGHQaYjiz2/ptClYMtTgShbBmnEuHk0XXE4F5jYRov12V4GGDx/xSZ1RK3UpbWPrD6rd7LLIqbhfE/tFF3shp4zKEEi4I5YjTKn2sU4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 162008306948283.28631846616929; Mon, 3 May 2021 16:04:29 -0700 (PDT) Received: from localhost ([::1]:33738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldhc4-0007av-A0 for importer@patchew.org; Mon, 03 May 2021 19:04:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldhI8-0002HF-BF for qemu-devel@nongnu.org; Mon, 03 May 2021 18:43:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldhI6-0007EK-HB for qemu-devel@nongnu.org; Mon, 03 May 2021 18:43:52 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-387-ARz_xlIpNjyeRVnb5Xmm-w-1; Mon, 03 May 2021 18:43:47 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0E2D51922035 for ; Mon, 3 May 2021 22:43:46 +0000 (UTC) Received: from wainer-laptop.localdomain.com (ovpn-116-131.gru2.redhat.com [10.97.116.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 680D460C5C; Mon, 3 May 2021 22:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620081829; 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=+C14LeSAWSNkxm/A+5bC2ZEsXaXapDFhzDpcd9j4pfw=; b=HsW1tL1VmwVHS0k8/4cOaKu4REjhZY2oJDjAw3/aVJ3Cm6DAE2BxEg9drklBcsKpc4g2z/ jciRjqPR7QrOLckPb/wHui2qiqdKn6ToP3X7EbhTJchM8wUCtVnK2ZHQdYO7QnO9kZtH1q K4RnWaNp1aWMBGRt/5RQvcYmBFm6fP8= X-MC-Unique: ARz_xlIpNjyeRVnb5Xmm-w-1 From: Wainer dos Santos Moschetta To: qemu-devel@nongnu.org Subject: [PATCH 2/7] tests/acceptance: Move exec_command to ConsoleMixIn Date: Mon, 3 May 2021 19:43:21 -0300 Message-Id: <20210503224326.206208-3-wainersm@redhat.com> In-Reply-To: <20210503224326.206208-1-wainersm@redhat.com> References: <20210503224326.206208-1-wainersm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=wainersm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: pass client-ip=216.205.24.124; envelope-from=wainersm@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.698, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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: willianr@redhat.com, philmd@redhat.com, crosa@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This moved exec_command() to ConsoleMixIn class. Only the multiprocess.py file were touched by that change, so its tests were adapted. Signed-off-by: Wainer dos Santos Moschetta --- tests/acceptance/avocado_qemu/__init__.py | 22 ++++++++++------------ tests/acceptance/multiprocess.py | 6 +++--- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 6f4e0edfa3..4d3b869765 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -114,18 +114,6 @@ def wait_for_console_pattern(test, success_message, fa= ilure_message=3DNone, """ _console_interaction(test, success_message, failure_message, None, vm= =3Dvm) =20 -def exec_command(test, command): - """ - Send a command to a console (appending CRLF characters), while logging - the content. - - :param test: an Avocado test containing a VM. - :type test: :class:`avocado_qemu.Test` - :param command: the command to send - :type command: str - """ - _console_interaction(test, None, None, command + '\r') - def exec_command_and_wait_for_pattern(test, command, success_message, failure_message=3DN= one): """ @@ -145,6 +133,16 @@ def exec_command_and_wait_for_pattern(test, command, class ConsoleMixIn(): """Contains utilities for interacting with a guest via Console.""" =20 + def exec_command(self, command): + """ + Send a command to a console (appending CRLF characters), while log= ging + the content. + + :param command: the command to send + :type command: str + """ + _console_interaction(self, None, None, command + '\r') + def interrupt_interactive_console_until_pattern(self, success_message, failure_message=3DNone, interrupt_string=3D'\r= '): diff --git a/tests/acceptance/multiprocess.py b/tests/acceptance/multiproce= ss.py index 96627f022a..41d3e51164 100644 --- a/tests/acceptance/multiprocess.py +++ b/tests/acceptance/multiprocess.py @@ -9,10 +9,10 @@ =20 from avocado_qemu import Test from avocado_qemu import wait_for_console_pattern -from avocado_qemu import exec_command +from avocado_qemu import ConsoleMixIn from avocado_qemu import exec_command_and_wait_for_pattern =20 -class Multiprocess(Test): +class Multiprocess(Test, ConsoleMixIn): """ :avocado: tags=3Dmultiprocess """ @@ -59,7 +59,7 @@ def do_test(self, kernel_url, initrd_url, kernel_command_= line, self.vm.launch() wait_for_console_pattern(self, 'as init process', 'Kernel panic - not syncing') - exec_command(self, 'mount -t sysfs sysfs /sys') + self.exec_command('mount -t sysfs sysfs /sys') exec_command_and_wait_for_pattern(self, 'cat /sys/bus/pci/devices/*/ueve= nt', 'PCI_ID=3D1000:0012') --=20 2.29.2