From patchwork Thu Aug 22 10:42:36 2024 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: 821324 Delivered-To: patch@linaro.org Received: by 2002:adf:e98a:0:b0:367:895a:4699 with SMTP id h10csp1113067wrm; Thu, 22 Aug 2024 03:43:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUtGwQX6buHndA/6lKFzWpfF9MNe/x5SzYsozgNFZW4t8/CKwLFdlmrhz353oZ9RX5bB9GiQQ==@linaro.org X-Google-Smtp-Source: AGHT+IFuTKjC5RUkNhwevqNnF+0db40ayLeXJoKfL9snbWdB7iToEZutJo0Ze2SC+nzcoreNi5RV X-Received: by 2002:a05:6214:3a86:b0:6bb:994c:3ef2 with SMTP id 6a1803df08f44-6c1567d81a4mr57338806d6.16.1724323420514; Thu, 22 Aug 2024 03:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724323420; cv=none; d=google.com; s=arc-20160816; b=kBfdf8r5paa4G3hplKh1Jk182OZ6iY3eH9WpelREI2J4eIRhwGXM2HYjQUvDeyVRg5 kyFEoOHvh5Io95YXaoH5d3ym4y4p/lYuC2V4o8Rkef4/QUhpwpft27hF6ulp7ApbufDd Ui48icB4fzwDSbzD93tEvo8GJZxLC2Y8yc+USqDxixhInlnjWTmiLOSHPCntP4gCEBnb ENi9DDLs2gvWwXzl1wK2FECdW0P4a8BUc8IumRU0A4elUFpQOHTslPXfou6fhOmmyDj/ nRidxiSnVIeXhY9UWVHTA0sBBCJqHt7hYIw2vFMEmzuG49Uem47ZtvRZXIDiTZGkCVSu q8QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tf5HkEASfWzSVkOHOTgGoEk72uRFvrW6k14mphVk1H0=; fh=JWMo7U+4BCk7ne4VdTRvgfD9sI/rlhCmhpfgFUNOsTU=; b=q6PIZkVMvf0S9mIw0Sj/8Ph7wps9qblaIfOOAIRJ4w3sczqU2YNcpMCSXg8TSIIyB8 T6Eg0GnMbFnF0L2yPrF7yyiup8A41SU0M0QcwnCNZFDTHrsavEehfCLpIsCfc35lisvk WWZGKMdkQX4cWfnXdYOemjslyQkucsWjgWZV2wuKwr/VM5yUtzggyVCGF0dih+GBYAZi 4q6XZoGLGecNW1ca/W2OlCpWl+AyOjhFFU4MzOi4DSesH99s1kdFKcat7dQtAZhyyw+5 VVIgZGO/dYg5eqINmepR1mXpaVSSoP8XFOPk5/NphSIpHeQM9+Xx2+srrOBiv3lJ/QJt g9Jg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ANf96sQM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c162dd671esi15062736d6.358.2024.08.22.03.43.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Aug 2024 03:43:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ANf96sQM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh5HK-0003Nj-Hk; Thu, 22 Aug 2024 06:42:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sh5HJ-0003Mk-0T for qemu-devel@nongnu.org; Thu, 22 Aug 2024 06:42:53 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sh5HH-00019q-CN for qemu-devel@nongnu.org; Thu, 22 Aug 2024 06:42:52 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-429da8b5feaso5881415e9.2 for ; Thu, 22 Aug 2024 03:42:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724323369; x=1724928169; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tf5HkEASfWzSVkOHOTgGoEk72uRFvrW6k14mphVk1H0=; b=ANf96sQMZBvQbIiGnmhb96fuw2QP3naQWMHOEnzHZxZzHdlYVabA5PtjW9tEf5HIDU Ppl8C50j37JMlIA0GnywSoqfOWMn0sQ5ouB497Ok7YIvHyEsJ+AzBCp7q0uiRcsgIMbT do04FxUMGDrkHfKKkZh//OU7N0XpKPboZaK4PKMEYfvfqCJ9TeW4Vflt7mdwLzZgomt/ d7ofp88qOJcZK74zg2Q8TEqkth56I/E1mp7XO3alpD4F4CalHPsswNJBc/b6hMqgeJ0h DFBkXDbFxQFb7U4I1S+fGp+c6Hm7t+Ds+jnQJptNJ/qMrSJEaVHhftl0SKUzF3xJ0isE ic+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724323369; x=1724928169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tf5HkEASfWzSVkOHOTgGoEk72uRFvrW6k14mphVk1H0=; b=LPujlFdlQrmlDe6PAlMggYnNkakBZCnanj2IYs+EOJ5N3QeHCsDRXUpXjQth05K9J1 +4TztJlMXAreC3/8t3QSBWt1xjefRIzD9GTqxLzDQb5G9EcwbtMXXIb80dj6oxVhzWUy GXgtL/1c0dk3aAb3DcCJ6xOBdVCgW0B7feFpMhxXqJy4gwfA2nwMl6CfPiudyxyeZxy0 i4SHBNDawUDIm6SYo1XKRNLofAbcPoTZ+Mhj9Q5T2CfzHKlRfLJ2U1y1tvdg4gBp4J// dP1Wv7V1g5vEE6Y4zS4tbktFIyfPcfjqOnRCZpcWf0l4AUSAXsGJgE6YBlE2uA/E0Yv5 1LFQ== X-Gm-Message-State: AOJu0YzM+ZEYa9PTBJlQJ7f4qH4tTa1PHmUWkza3EgD2wRDuTkhi8jHy 4uBA+KI3xzPQAwIoYM2EyWyU553KXxNo9ib44DK44Sw8lTKj0NiCpQzPPQdd0KWfQnzOZjwmiFU s X-Received: by 2002:a05:600c:1e8f:b0:426:5e8e:aa48 with SMTP id 5b1f17b1804b1-42ac55dfe1cmr13537755e9.22.1724323369120; Thu, 22 Aug 2024 03:42:49 -0700 (PDT) Received: from m1x-phil.lan ([176.187.206.153]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ac500e119sm20623675e9.0.2024.08.22.03.42.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 22 Aug 2024 03:42:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Cleber Rosa , Thomas Huth , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , Beraldo Leal Subject: [PATCH 1/3] tests/functional: Add QemuUserTest class Date: Thu, 22 Aug 2024 12:42:36 +0200 Message-ID: <20240822104238.75045-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240822104238.75045-1-philmd@linaro.org> References: <20240822104238.75045-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Per commit 5334df4822 ("tests/avocado: Introduce QemuUserTest base class"): Similarly to the 'System' Test base class with methods for testing system emulation, the QemuUserTest class contains methods useful to test user-mode emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- tests/functional/qemu_test/__init__.py | 2 +- tests/functional/qemu_test/testcase.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu_test/__init__.py index db05c8f412..6e9b017264 100644 --- a/tests/functional/qemu_test/__init__.py +++ b/tests/functional/qemu_test/__init__.py @@ -11,4 +11,4 @@ from .cmd import has_cmd, has_cmds, run_cmd, is_readable_executable_file, \ interrupt_interactive_console_until_pattern, wait_for_console_pattern, \ exec_command, exec_command_and_wait_for_pattern -from .testcase import QemuSystemTest, QemuBaseTest +from .testcase import QemuBaseTest, QemuUserTest, QemuSystemTest diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py index 18314be9d1..aa0146265a 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -13,6 +13,7 @@ import logging import os +import subprocess import pycotap import sys import unittest @@ -70,6 +71,22 @@ def main(): unittest.main(module = None, testRunner = tr, argv=["__dummy__", path]) +class QemuUserTest(QemuBaseTest): + + def setUp(self): + super().setUp('qemu-') + self._ldpath = [] + + def add_ldpath(self, ldpath): + self._ldpath.append(os.path.abspath(ldpath)) + + def run_cmd(self, bin_path, args=[]): + return subprocess.run([self.qemu_bin] + + ["-L %s" % ldpath for ldpath in self._ldpath] + + [bin_path] + + args, + text=True, capture_output=True) + class QemuSystemTest(QemuBaseTest): """Facilitates system emulation tests.""" From patchwork Thu Aug 22 10:42:37 2024 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: 821323 Delivered-To: patch@linaro.org Received: by 2002:adf:e98a:0:b0:367:895a:4699 with SMTP id h10csp1113062wrm; Thu, 22 Aug 2024 03:43:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUK3QE52XdWEnuBI8nKHJDuYLBwUa0XJdeCIrawTTzCOSGVINlCQM/N8KvgrCb3+BHThMDGhg==@linaro.org X-Google-Smtp-Source: AGHT+IEw+FnWYa0p8H6Fl+rc3UM4NIHD/XbnjUkvY24c05sjOa31ukUka985zCHS1Q7sOU37FlxE X-Received: by 2002:a05:620a:4511:b0:7a1:e4e3:5c42 with SMTP id af79cd13be357-7a680a6254amr145423085a.28.1724323420510; Thu, 22 Aug 2024 03:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724323420; cv=none; d=google.com; s=arc-20160816; b=SdBanrkSzLdqH3qaxMJxhSq02cm5R5I44fYDx8PFeTeErneFLPqU4IiQqyo917fewK 2bFwG0vUjuEo1e9pq1YRlz1v7fKsQo/r0gA6xH6jGtje+0Md3Q7smaKK8CvBozoutGio bGu/a+sFD6+TeH8SfLLGC+jRsemyzHJTc5GdIxIk5R2DTxUOO6m5QrZiPgWXA3JuEOab ilxpjhN+rrGD3KtOIZWy9wHI6w8aKmzsOzJ55sxX95VpRDMSTpK5n7YL4nQYYeGhhXoc OObjUzBE9kiShKtn/sJOjgN3IKfVfGYZfCxqHGo3OcDbQVEsRRCyy1Ytyb/+4eRuHwZt KfsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DC8WY1PhyTAf9am5ZSe2JMSlfNoWjsSxlIuu/lXOwxk=; fh=JWMo7U+4BCk7ne4VdTRvgfD9sI/rlhCmhpfgFUNOsTU=; b=UIQc0Y9nREq5WH/go/atolybiC09SXIH/yn7zenZxz0a4mc8b8AGdMQajaoRspXAXT Ffb/zAx3qFoSPVp90yh/3dsrEAkUpdZNTb83RkrFl/XsmACaZ/LsmOIm2IFv7cCFRB5e mM7TmO1KxPZ29hnFL6vpHcfl7+UNJ9ON2X+c2UoMjoNnTTRzZWmHImf5gqORx4G0uvg3 pja2nKFPdMhUMnY1YwBn/Gv0BCS/0PeUezoxySZVHGNWkTazpZ4ETdID13nJwnKkaEHQ 4f+vBqQ1thpe6ZrIDPKVVkPj12DBa+ioE6SbOHwgXcgCEDv39njvmxyfrC0uj6h+aek1 iV8Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KXlFDSlX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a67f3cf848si127386685a.239.2024.08.22.03.43.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Aug 2024 03:43:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KXlFDSlX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh5HR-0003XO-37; Thu, 22 Aug 2024 06:43:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sh5HP-0003Wk-UP for qemu-devel@nongnu.org; Thu, 22 Aug 2024 06:42:59 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sh5HN-0001A6-TO for qemu-devel@nongnu.org; Thu, 22 Aug 2024 06:42:59 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-37182eee02dso349587f8f.1 for ; Thu, 22 Aug 2024 03:42:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724323376; x=1724928176; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DC8WY1PhyTAf9am5ZSe2JMSlfNoWjsSxlIuu/lXOwxk=; b=KXlFDSlXcJ7ZDQdDXRcnWfghd1SjHNoUjXpVIMnBm5UdDRFd1ORv9cyy4HyIm/L0N1 Q3Vlwure3OgzxkFHmeP4Za/N4m+qVHeyQuzt4SV5v7ZwnPv7H2TpD8+Df2C2VM7O+4I2 rb1g/LrovNsJ8PTPM7zNXUuZS2PFUeu0OMteM3b/j1gL8vg9RBxgMvfLgaFBdfwsPvvm 1wIWTHJYlxTuJNHsh/WpW25UTmdsp/AxC8/XF74S6RlUlpgKMXGVg2ecmlJRnw+f8jfy IdZBYJNGlZv92xdoHw9zakVWto1w3q4e0cqyvLKluzUN7NWS3yWY51TBWhnSmmRv6KsC YVWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724323376; x=1724928176; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DC8WY1PhyTAf9am5ZSe2JMSlfNoWjsSxlIuu/lXOwxk=; b=oViHZdB5VsxO/9x5d5t//PldktA3IZ9o22TfP4AoVGoSkQFeW898f+CW4kDQdwnuZQ uAsyAUxIFzUnV0FvEilrhRICPutoQHAFiqAF9L+nwi88BiJPAis+uiTlhT6f4S093kI1 864MEgEADLmoDvt1g6BdmYeeLdVL6R8vOEaEkMG2VNqkUo9W5vm+U25lUQ+oXKz83jZM Tx4+GS7VkE7rvAUWWSJfNTZanAXdbD4oemuVfRQvIvbO5mWK0tTvjLL27Q2wtcsoM2Ay wf52OtmEQAMVoL6jPg4FMlxz33UovT7mrHJu0HZBG0p8rbqmZBFNr1bJpeEJWOKi1kSW 7H5A== X-Gm-Message-State: AOJu0YwUOq1+zNDPqwrEALC1M0gLfsNaCS07P8g8NrMqv+6v6UGTne0t BQgpIB0f8CBqQOPOMwEFP9KkcMSkR5F9nBpySrdWUjlc2y1r2ZlJPRbixOwwPVEFP9glfTlBTtd 0 X-Received: by 2002:adf:b317:0:b0:360:8c88:ab82 with SMTP id ffacd0b85a97d-373052a6411mr1584842f8f.30.1724323375957; Thu, 22 Aug 2024 03:42:55 -0700 (PDT) Received: from m1x-phil.lan ([176.187.206.153]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-373082657bdsm1356514f8f.107.2024.08.22.03.42.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 22 Aug 2024 03:42:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Cleber Rosa , Thomas Huth , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , Beraldo Leal Subject: [PATCH 2/3] tests/functional: Convert ARM bFLT linux-user avocado test Date: Thu, 22 Aug 2024 12:42:37 +0200 Message-ID: <20240822104238.75045-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240822104238.75045-1-philmd@linaro.org> References: <20240822104238.75045-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Expose cpio_extract() in qemu_test.utils for possible reuse. Signed-off-by: Philippe Mathieu-Daudé --- Missing meson plumbing, i.e. adding to tests_arm_thorough[] --- tests/avocado/load_bflt.py | 54 ----------------------------- tests/functional/qemu_test/utils.py | 9 +++++ tests/functional/test_arm_bflt.py | 44 +++++++++++++++++++++++ 3 files changed, 53 insertions(+), 54 deletions(-) delete mode 100644 tests/avocado/load_bflt.py create mode 100755 tests/functional/test_arm_bflt.py diff --git a/tests/avocado/load_bflt.py b/tests/avocado/load_bflt.py deleted file mode 100644 index 264489ee25..0000000000 --- a/tests/avocado/load_bflt.py +++ /dev/null @@ -1,54 +0,0 @@ -# Test the bFLT loader format -# -# Copyright (C) 2019 Philippe Mathieu-Daudé -# -# SPDX-License-Identifier: GPL-2.0-or-later - -import os -import bz2 -import subprocess - -from avocado import skipUnless -from avocado_qemu import QemuUserTest -from avocado_qemu import has_cmd - - -class LoadBFLT(QemuUserTest): - - def extract_cpio(self, cpio_path): - """ - Extracts a cpio archive into the test workdir - - :param cpio_path: path to the cpio archive - """ - cwd = os.getcwd() - os.chdir(self.workdir) - with bz2.open(cpio_path, 'rb') as archive_cpio: - subprocess.run(['cpio', '-i'], input=archive_cpio.read(), - stderr=subprocess.DEVNULL) - os.chdir(cwd) - - @skipUnless(*has_cmd('cpio')) - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code') - def test_stm32(self): - """ - :avocado: tags=arch:arm - :avocado: tags=linux_user - :avocado: tags=quick - """ - # See https://elinux.org/STM32#User_Space - rootfs_url = ('https://elinux.org/images/5/51/' - 'Stm32_mini_rootfs.cpio.bz2') - rootfs_hash = '9f065e6ba40cce7411ba757f924f30fcc57951e6' - rootfs_path_bz2 = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash) - busybox_path = os.path.join(self.workdir, "bin/busybox") - - self.extract_cpio(rootfs_path_bz2) - - res = self.run(busybox_path) - ver = 'BusyBox v1.24.0.git (2015-02-03 22:17:13 CET) multi-call binary.' - self.assertIn(ver, res.stdout_text) - - res = self.run(busybox_path, ['uname', '-a']) - unm = 'armv7l GNU/Linux' - self.assertIn(unm, res.stdout_text) diff --git a/tests/functional/qemu_test/utils.py b/tests/functional/qemu_test/utils.py index 99eae5fc45..2a1cb60d38 100644 --- a/tests/functional/qemu_test/utils.py +++ b/tests/functional/qemu_test/utils.py @@ -12,6 +12,7 @@ import lzma import os import shutil +import subprocess import tarfile def archive_extract(archive, dest_dir, member=None): @@ -45,3 +46,11 @@ def lzma_uncompress(xz_path, output_path): except: os.remove(output_path) raise + +def cpio_extract(cpio_handle, output_path): + cwd = os.getcwd() + os.chdir(output_path) + subprocess.run(['cpio', '-i'], + input=cpio_handle.read(), + stderr=subprocess.DEVNULL) + os.chdir(cwd) diff --git a/tests/functional/test_arm_bflt.py b/tests/functional/test_arm_bflt.py new file mode 100755 index 0000000000..281925d11a --- /dev/null +++ b/tests/functional/test_arm_bflt.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +# +# Test the bFLT loader format +# +# Copyright (C) 2019 Philippe Mathieu-Daudé +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +import bz2 + +from qemu_test import QemuUserTest, Asset +from qemu_test import has_cmd +from qemu_test.utils import cpio_extract +from unittest import skipUnless + + +class LoadBFLT(QemuUserTest): + + ASSET_ROOTFS = Asset( + ('https://elinux.org/images/5/51/Stm32_mini_rootfs.cpio.bz2'), + 'eefb788e4980c9e8d6c9d60ce7d15d4da6bf4fbc6a80f487673824600d5ba9cc') + + @skipUnless(*has_cmd('cpio')) + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted code') + def test_stm32(self): + # See https://elinux.org/STM32#User_Space + rootfs_path_bz2 = self.ASSET_ROOTFS.fetch() + busybox_path = os.path.join(self.workdir, "bin/busybox") + + with bz2.open(rootfs_path_bz2, 'rb') as cpio_handle: + cpio_extract(cpio_handle, self.workdir) + + res = self.run_cmd(busybox_path) + ver = 'BusyBox v1.24.0.git (2015-02-03 22:17:13 CET) multi-call binary.' + self.assertIn(ver, res.stdout) + + res = self.run_cmd(busybox_path, ['uname', '-a']) + unm = 'armv7l GNU/Linux' + self.assertIn(unm, res.stdout) + + +if __name__ == '__main__': + QemuUserTest.main() From patchwork Thu Aug 22 10:42:38 2024 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: 821326 Delivered-To: patch@linaro.org Received: by 2002:adf:e98a:0:b0:367:895a:4699 with SMTP id h10csp1113072wrm; Thu, 22 Aug 2024 03:43:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXeGKjdXp6Shfx4gfN/cv11ixA4O+ehHlJWHp+tAJbwBXHOCcjbCWjvAssAEdSNOApGDyVAhQ==@linaro.org X-Google-Smtp-Source: AGHT+IE6f9rLkbdlTVDcDqWf4tw2LCgKJpNJpoNH86LGV/mpM5n3DgaIU2TnDe9x1E8cNsCITbA6 X-Received: by 2002:a05:6214:3c9d:b0:6bf:9aa5:c3b0 with SMTP id 6a1803df08f44-6c155dbb500mr63258326d6.33.1724323420959; Thu, 22 Aug 2024 03:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724323420; cv=none; d=google.com; s=arc-20160816; b=q4ykUgarOwe/MoeuzMN462biS+1Hzs9Vy9gmmRVkKEa+H1nFNYN+RCkcKnHmuD3CK6 IH12q36pyE4+fJgixyfT+mJI7Tl9y19Kq0FxjrqQWpOskNmqY1WVmhzbUGgXPpZT7vyY w4tg0L/94gYNADs5OzVy7yBImck0nk+kp18ggLevrYczsDCxyAm3hpgc/S522ZK36aAx viJCthY9zXwou50wfJRSX9Y9M5ASvLzojRlEVp/7JGwHH0Lb/BAn/mjRFRhypDiWwtcL 1nboGFS/1KZh5Vfy4A56mJ8OfmqoLOSLOrn5ebexaEEYKLaRqqDArugPf7uumwY8hlep HsnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=a4qja5+51Vsbcc1haEmPRmBh3XPr17SQDcwk8vlpqiY=; fh=JWMo7U+4BCk7ne4VdTRvgfD9sI/rlhCmhpfgFUNOsTU=; b=ru1UQ1MhdwQX8HyIwhh+jTiSF51t7YIOzeshc1ds/KeDyuVkRIuEcjx8bc/SV6ARAE uVPiAJnSAqO7BF0VMcRBKpCk6g1JAsi9vG344n+e6uaaXOz8PENP7BXwrsE3+YtzAL1q NAFsqq9rYQXyrPEqFVBThTt/XVwAoU6wTiFs6lIx+H4Qkblf0OvZwiCt+ik9ZjmjbVcx zDZaFt4SLshGxKNmhipYRpvGXD7oZzyXEo+h9J958JZpowimy5Fk+D+/dWXBQh58gi44 ftX5/biqLZeeTG+UZLQpQnk8QSasFDTV/2Y+I/eBsWEq5ZaoPEg+5nj/ITPGrQsXeMD5 Cdug==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sAzIgTYk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c162dd805dsi14799626d6.393.2024.08.22.03.43.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Aug 2024 03:43:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sAzIgTYk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh5HY-0003hS-Nh; Thu, 22 Aug 2024 06:43:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sh5HW-0003gy-VN for qemu-devel@nongnu.org; Thu, 22 Aug 2024 06:43:06 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sh5HV-0001AN-EV for qemu-devel@nongnu.org; Thu, 22 Aug 2024 06:43:06 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3717de33d58so323933f8f.1 for ; Thu, 22 Aug 2024 03:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724323383; x=1724928183; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a4qja5+51Vsbcc1haEmPRmBh3XPr17SQDcwk8vlpqiY=; b=sAzIgTYkYfg1N4hVgk9wCtZqeTLjO1Asu1nuJkLFr/vWsn9txJZ39rKP24F+suTqdo 4im3GitPSoSM8430wHBO84L0wbSiKKbgX0zAyhoeKffBV8n/mxchJ+eHRWBRyfGaMjhN yHDAlDyMfA390NLdUn97NA9zwW3SwF09fqWQQn/yoO8vB19SLh36s/MXdqFiTvTKorkN gMVAm+GTELDjeB+Nc5GnjO9Dvj5XaxdDHZS6Aqj4K6Mc9VKAzkZI4IgR56XrtILGKT6c ew4jhTCrcAsH/4OUG/lruarYf6eV+uplCvKr6YIQ03CLS/tsTEEFbMqoiEGwatUMDnoZ xZSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724323383; x=1724928183; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a4qja5+51Vsbcc1haEmPRmBh3XPr17SQDcwk8vlpqiY=; b=Hn3LB451cOf8kahrR02/FFMcrEbmipf9sjq3yv6hsxsoa9wAOp5IZlERKG1F3MUk7Y GK9n8zMe3Ucl/N9Me/RV8Y7JK+CCVSMu1Rd8inA/2lrnKJLWkerJlPKtrVhwDoB9b5sb m9QUb7E/ediOeRYpxZQxRPpKPZF0zs7XGabnb9/QJCl7hqLnwGSTYRx5G1bSdKc4fz5U kF+adbzfSHyFaqBqSWLeuOQT9Rufolea1nZT0EtL1pJI36XKshGg0g42Uus1Z4xDzrbb UWf+eEV0ftK3DRh8gFi03tA/AjNsjpb3ynyzE0MJT6Br0Id4tTy19S2LgVtLMa78OL2+ a/ag== X-Gm-Message-State: AOJu0YzV7S7udMtMgluQPJ+Lui7M755fZIF7brMt7V+QI15/R0CS5mNa neIrAl7hbB8227eqHcy2bhmZ1pYAN5D8F1nlPvJXV30lo/lmo2rhuWccoiNsOZ+zXuIxep8fyIo I X-Received: by 2002:a05:6000:b09:b0:371:937a:326c with SMTP id ffacd0b85a97d-372fd73184amr2755660f8f.57.1724323382727; Thu, 22 Aug 2024 03:43:02 -0700 (PDT) Received: from m1x-phil.lan ([176.187.206.153]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3730821a92csm1344234f8f.93.2024.08.22.03.43.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 22 Aug 2024 03:43:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Cleber Rosa , Thomas Huth , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , Beraldo Leal Subject: [PATCH 3/3] tests/avocado: Remove unused QemuUserTest class Date: Thu, 22 Aug 2024 12:42:38 +0200 Message-ID: <20240822104238.75045-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240822104238.75045-1-philmd@linaro.org> References: <20240822104238.75045-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The single test that was using the QemuUserTest class has been converted to the functional test framework. This class is now unused, remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- tests/avocado/avocado_qemu/__init__.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py index 0d57addfea..0e4ecea7a0 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -17,7 +17,7 @@ import uuid import avocado -from avocado.utils import process, ssh +from avocado.utils import ssh from avocado.utils.path import find_command from qemu.machine import QEMUMachine @@ -384,23 +384,6 @@ def tearDown(self): super().tearDown() -class QemuUserTest(QemuBaseTest): - """Facilitates user-mode emulation tests.""" - - def setUp(self): - self._ldpath = [] - super().setUp('qemu-') - - def add_ldpath(self, ldpath): - self._ldpath.append(os.path.abspath(ldpath)) - - def run(self, bin_path, args=[]): - qemu_args = " ".join(["-L %s" % ldpath for ldpath in self._ldpath]) - bin_args = " ".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."""