From nobody Wed Nov 19 00:18:03 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1613333321; cv=none; d=zohomail.com; s=zohoarc; b=OgKRbIkwbuGpEX3KpY2+pbdhgJAWQdeWGbuIQ2sb543Yy0BHkF0BqP/0ULQo1lrT/W4A8/kWeCmVY1F0fCnoaRv+xI2HdYLDHeRvDCTzqw+yL4gMS6ockuKIxaO4Jh7pRKS4MVNIGHQ9nPKM/4WzBjnMWqoFgWz0UiBstcl5DPU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613333321; 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=tAIy7FUQhIbkzhnlwKrYWaoIdkoCcq/sJqrD/3OuL28=; b=LBPZzFuY+vfXAlM7h6PcUaitmsszqZR3IfnuV6wRLgGBMUN3B/PC6uUIxaVN18m1U/CMs177YZ0lR2dK2M3/U0bAvHnISc2SVZuEkXaC8zEqEifctyycje2MQ+f92UXySLZIYqehC0ETm6qWrYsvnvsxg2TRB1tKYGhEqBHqqr4= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613333321565793.0161994655773; Sun, 14 Feb 2021 12:08:41 -0800 (PST) Received: from localhost ([::1]:58692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBMCd-0000UI-GW for importer@patchew.org; Sun, 14 Feb 2021 13:33:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBLj2-0001Hw-EE for qemu-devel@nongnu.org; Sun, 14 Feb 2021 13:02:28 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:37193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBLj0-0004hT-UU for qemu-devel@nongnu.org; Sun, 14 Feb 2021 13:02:28 -0500 Received: by mail-wm1-x32c.google.com with SMTP id m1so5842922wml.2 for ; Sun, 14 Feb 2021 10:02:26 -0800 (PST) Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id v11sm20863355wrr.3.2021.02.14.10.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 10:02:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tAIy7FUQhIbkzhnlwKrYWaoIdkoCcq/sJqrD/3OuL28=; b=L7kU2i88pK4c1X1MYEzU2BgcBam0+Ky3HFvwlyl47piV557P6LyLhIN0RhcfCPrsVN zz2FqWSQhyfjx56vN0pzKgmez3hZdemnKo7J34quLLvH8GnUf7sYHlGNm2M1/u6qUoUk yvWEkuYKxb2yneZ3LSDby2AojTi1aDBV9f6VQK+A6WZ0ee7o3NOphe9L7ZxO/KuT5IgC WIXWiB42HAjyGMJ/VV+fdU7mvgU3ijIa3bTYxpOGfbs9lkmIjKhjtErgRqSzpEsl6oSr 92GdaeYOUsY1j4msrpGre8gz/sXj+L79lVSC6qWrNAwpwdZ3vTDiAUCCe7Hiiug40siy yghg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tAIy7FUQhIbkzhnlwKrYWaoIdkoCcq/sJqrD/3OuL28=; b=Z9+f4XA9rRiD2aiEtPBxNk4+KKIloIbaYazKhRGr9STA9FlY2d4WgRYexW6hpn69Aj +lOwyAM9nZKAC+J9O4CTeUb3XEaHH5BKbo6tCtaqPwhJXFS4b1PtNta3rk/r85Uz5Kzl 0OLybhxrUHaH3M1QOgkkxDEi0b7n5jDy05fkqHeT602QOlFj3TFoLOZUYwRaCE/BPYqE CejjzxIO1vNwtXTP5VdtIf3f8eaUkOc9OfeH6ewsoGe7p0i2+eIJjwkacdPDjHNG5HI5 Te2l40IdCzmEhye7VQHOqt3YwmGkdpcRhOTzjppgSVRJMw8o4rcRnFJBUnwKDy16XUvT JazQ== X-Gm-Message-State: AOAM533OXqGZ3WeVwWulXVQVEKnnuy/1EOSVrM81igmSGd05UiPxVcT9 8LZsH3tj8VpcbV7glKPVrW67fVERkak= X-Google-Smtp-Source: ABdhPJwhDsBPJJSpjDEErKfL4N7mN8WOG2ORpQYzFWPtVwOowa3xwqF9LM0C6J27pI5wfsMV36v0AA== X-Received: by 2002:a1c:de08:: with SMTP id v8mr11126032wmg.143.1613325745249; Sun, 14 Feb 2021 10:02:25 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 38/42] tests/acceptance: Extract QemuBaseTest from Test Date: Sun, 14 Feb 2021 18:59:08 +0100 Message-Id: <20210214175912.732946-39-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210214175912.732946-1-f4bug@amsat.org> References: <20210214175912.732946-1-f4bug@amsat.org> 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: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: Fredrik Noring , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Cleber Rosa , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno , "Maciej W. Rozycki" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The Avocado Test::fetch_asset() is handy to download artifacts before running tests. The current class is named Test but only tests system emulation. As we want to test user emulation, refactor the common code as QemuBaseTest. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/avocado_qemu/__init__.py | 35 +++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index bf54e419da2..31b7064c0e5 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -145,7 +145,7 @@ def exec_command_and_wait_for_pattern(test, command, """ _console_interaction(test, success_message, failure_message, command += '\r') =20 -class Test(avocado.Test): +class QemuBaseTest(avocado.Test): def _get_unique_tag_val(self, tag_name): """ Gets a tag value, if unique for a key @@ -156,8 +156,6 @@ def _get_unique_tag_val(self, tag_name): return None =20 def setUp(self): - self._vms =3D {} - self.arch =3D self.params.get('arch', default=3Dself._get_unique_tag_val('ar= ch')) =20 @@ -170,6 +168,25 @@ def setUp(self): if self.qemu_bin is None: self.cancel("No QEMU binary defined or found in the build tree= ") =20 + + def fetch_asset(self, name, + asset_hash=3DNone, algorithm=3DNone, + locations=3DNone, expire=3DNone, + find_only=3DFalse, cancel_on_missing=3DTrue): + return super(QemuBaseTest, self).fetch_asset(name, + asset_hash=3Dasset_hash, + algorithm=3Dalgorithm, + locations=3Dlocations, + expire=3Dexpire, + find_only=3Dfind_only, + cancel_on_missing=3Dcancel_on_missing) + +# a.k.a. QemuSystemTest for system emulation... +class Test(QemuBaseTest): + def setUp(self): + self._vms =3D {} + super(Test, self).setUp() + def _new_vm(self, *args): self._sd =3D tempfile.TemporaryDirectory(prefix=3D"avo_qemu_sock_") vm =3D QEMUMachine(self.qemu_bin, sock_dir=3Dself._sd.name) @@ -194,15 +211,3 @@ def tearDown(self): for vm in self._vms.values(): vm.shutdown() self._sd =3D None - - def fetch_asset(self, name, - asset_hash=3DNone, algorithm=3DNone, - locations=3DNone, expire=3DNone, - find_only=3DFalse, cancel_on_missing=3DTrue): - return super(Test, self).fetch_asset(name, - asset_hash=3Dasset_hash, - algorithm=3Dalgorithm, - locations=3Dlocations, - expire=3Dexpire, - find_only=3Dfind_only, - cancel_on_missing=3Dcancel_on_missing) --=20 2.26.2