From nobody Mon Feb 9 22:38:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1636388294; cv=none; d=zohomail.com; s=zohoarc; b=KKq0K04iEhVR1eq2Ai07zVmPsyNQlY3nSJL3FOAIQDZe56jCovhmQjKLTZYbj68c/0nadahhyn1pxGqHr7B83yvK3ZxeyAdl2y+C01AJ9a3W4HqIxwidKmYhpmCLkW3UIwr/HdGW27nHZbB5IAofhQaiOai1TQ+7pVOZcbfd9u0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636388294; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Q83GXnv4mn5q9vEHpCdzjj3QzMBEEx65F0uNcqXi278=; b=SsA71y/FU+cJHT/C484smgU/SbsqiGMNN7Qy8yDdrkW9y/+OpbHaaAi/c0BtN6ebZoYpmRy+ZDuC1/Szx7eGzPLB2kLUjHjPewBa8uTK2xHfJOmYhskffoVnCRL7/+Fs3xBq6jSchyEOFQuQzTil1By/WoqLcBNnIbtd2BS9QZQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 163638829406921.811431568222588; Mon, 8 Nov 2021 08:18:14 -0800 (PST) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-535-fa_u9CMiN7OYHU-kHvsIOQ-1; Mon, 08 Nov 2021 11:18:10 -0500 Received: by mail-wr1-f71.google.com with SMTP id p3-20020a056000018300b00186b195d4ddso4186465wrx.15 for ; Mon, 08 Nov 2021 08:18:10 -0800 (PST) Return-Path: Return-Path: Received: from x1w.. (46.red-193-152-127.dynamicip.rima-tde.net. [193.152.127.46]) by smtp.gmail.com with ESMTPSA id h27sm22494640wmc.43.2021.11.08.08.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 08:18:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636388293; 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=Q83GXnv4mn5q9vEHpCdzjj3QzMBEEx65F0uNcqXi278=; b=h3ofPf4u5pt9MR12DF36nQ2te4WFUzyQwoGglujLTLcJwIa8niZ2n0T3seM1RI61BFfHDT hGiIgPr60l/Ixx6v6GBbcmJFmQLECoATFQTZ/EiR+hOpWWwB7dPl/dtJLEoq9w69Ae5xsd WSHnocK3115+yyulVRywQvxTyyiQBB8= X-MC-Unique: fa_u9CMiN7OYHU-kHvsIOQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q83GXnv4mn5q9vEHpCdzjj3QzMBEEx65F0uNcqXi278=; b=Jf7ElXEZfGtdL375eNBbkziAnkyRvtHPiIcHjayO+NumC2oJWiWrv0PQpEglZMXC3N lwkNQN1XNQ7Ll67IizZMYE46DmwgC7s8r3PgWxrOChOiovAVndpS1aVfHU89QYz6BbAp 4tcGrH2JgWQGfdqfDxR2FduQyz8RirshNLI2bjpwKXQuda1R+3OWGhMd2QmwLavg2Uw+ XvIudnsVnSh8E0OVwaI8YNffjK07FMu4t8/Sh1KUIWyFnHk0b9GORJvBQVU6ywtqb3mW xkbCsXqx1a7y7N1/ob8R6NMXSydtz/0GtGZCByJbzra0swcYvTdaaMix7IqQ8P+vTSs5 HOFw== X-Gm-Message-State: AOAM533yW83DlQDYJJNaLPrj1rhePBOZ4WXPQJdImS5lsacRrbEiDoda 5OmJxXsbNVSvEExBgXqM0yhJ/O2AJlfT4W96pUYjuA/1FjNMEoDckpuKeQILbHh8rM9Mts9w/5z B+GDEmS85PrsZSw== X-Received: by 2002:a5d:6151:: with SMTP id y17mr346472wrt.275.1636388289045; Mon, 08 Nov 2021 08:18:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyt67BYfeZJkBTHGMG4syN+U5t3txfagA/LjXH5Oz+mw1/5ioQsPLVptYK7wX7bFrJmmlEOEg== X-Received: by 2002:a5d:6151:: with SMTP id y17mr346442wrt.275.1636388288901; Mon, 08 Nov 2021 08:18:08 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Cleber Rosa , Wainer dos Santos Moschetta , Willian Rampazzo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 5/9] tests/avocado: Introduce QemuUserTest base class Date: Mon, 8 Nov 2021 17:17:35 +0100 Message-Id: <20211108161739.1371503-6-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211108161739.1371503-1-philmd@redhat.com> References: <20211108161739.1371503-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1636388295977100001 From: Philippe Mathieu-Daud=C3=A9 Similarly to the 'System' Test base class with methods for testing system emulation, the QemuUserTest class contains methods useful to test user-mode emulation. Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Willian Rampazzo Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211105143416.148332-4-f4bug@amsat.org> --- tests/avocado/avocado_qemu/__init__.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado= _qemu/__init__.py index 984c554e7d6..e46b3ecb89e 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -17,7 +17,7 @@ import uuid =20 import avocado -from avocado.utils import cloudinit, datadrainer, network, ssh, vmimage +from avocado.utils import cloudinit, datadrainer, network, process, ssh, v= mimage from avocado.utils.path import find_command =20 #: The QEMU build root directory. It may also be the source directory @@ -295,6 +295,23 @@ def tearDown(self): super().tearDown() =20 =20 +class QemuUserTest(QemuBaseTest): + """Facilitates user-mode emulation tests.""" + + def setUp(self): + self._ldpath =3D [] + super().setUp('qemu-') + + def add_ldpath(self, ldpath): + self._ldpath.append(os.path.abspath(ldpath)) + + def run(self, bin_path, args=3D[]): + qemu_args =3D " ".join(["-L %s" % ldpath for ldpath in self._ldpat= h]) + bin_args =3D " ".join(args) + return process.run("%s %s %s %s" % (self.qemu_bin, qemu_args, + bin_path, bin_args)) + + class LinuxSSHMixIn: """Contains utility methods for interacting with a guest via SSH.""" =20 --=20 2.31.1