From patchwork Sat Mar 8 21:52:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 871588 Delivered-To: patch@linaro.org Received: by 2002:a5d:64ce:0:b0:38f:210b:807b with SMTP id f14csp332673wri; Sat, 8 Mar 2025 13:58:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXadOWpoJvQh8o3PK1EogT51ao3hs3LyQTvVbjaACR7+RBdPdIs0Gd7TlzPfZ4Aw3lQCwR2WA==@linaro.org X-Google-Smtp-Source: AGHT+IGZdtbwBqkPJgThzeW5/hrKvji/e5ATRg4JjG3CjKgnrqY7o5Oy//mJ/6Ua+WPSyDzlHDFL X-Received: by 2002:a05:6214:5010:b0:6e8:9843:ec99 with SMTP id 6a1803df08f44-6e9006cdb8dmr118061696d6.41.1741471129350; Sat, 08 Mar 2025 13:58:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741471129; cv=none; d=google.com; s=arc-20240605; b=HnCeBDNMQCGgd3qNMk5WmvDzaJXsU6HEi3GiEgobsuorEdmLE6pfkZxfRZNBBG/ZzJ C/hBZTF0uJ6PTDv1rQ1GTXn4QkDvKrbwhhypHEeFDSaR614hIKkzP5sKT+YqUFTnAGcb 7gU7YueK9olATaiofS5tPIBZk4nezJdjiEng3kSjhJVDOZVg2kPmiMtlbgoDT6Qbp05F 1uJ7jV2fRwApVi+zZEUM22duNtZUVWpMmUF3lxqslM7tWXijFKaL9FGsrOLnkVB7LydW VtD3LNQJiMt8i7Q9VXI1/F1+PDogRQvfPYfSRW4+ZAEMd9JpZc2GKHLl8nKG5iULtmyF zowg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=sd1Rqb0eZxPQ/q4aV8APc+tkTpr19bp2JQoIjr8lN20=; fh=wYVRRC5+r0azqcwHZD+eJ3VNdPCFRV/iIEAH5X047kQ=; b=jEmo//srgE9g5qkslQf5jMvl/4Ru48wGWCQb3QgXu1+1mYcsvKbbNTTxnXvf+vkOUm jfBN0LG4teM3zcntW8Y4m/qflK9fmyioUxZXoiNldXblX+1G2AEsTkRVWCfQC6zZQRLD u2Yv3z+oluYcE8xb472zxbj7cy5fGc9efOU/Be94ln5kx2yNDsLvqEHirxa5ZHpHdRfV cxBy1bXTArmawbLldtFfmuifA9fGIRTNUlIgvyeuI88nW8xGz3bTrQ5spDUQ7EaxHc3o S9wXERx4FT5/szK++eFNdFuAknBVI4kqIkeewoW/yoXvYUSuRTUDhLxGsPro0qLHZjY7 H/7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DtaIKAUv; 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-6e8f746a07dsi59556696d6.468.2025.03.08.13.58.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Mar 2025 13:58:49 -0800 (PST) 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=DtaIKAUv; 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 1tr26x-0003EX-K4; Sat, 08 Mar 2025 16:53:35 -0500 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 1tr26u-0003DJ-Q6 for qemu-devel@nongnu.org; Sat, 08 Mar 2025 16:53:33 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tr26t-0000u1-04 for qemu-devel@nongnu.org; Sat, 08 Mar 2025 16:53:32 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-43bb6b0b898so25414235e9.1 for ; Sat, 08 Mar 2025 13:53:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741470808; x=1742075608; 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=sd1Rqb0eZxPQ/q4aV8APc+tkTpr19bp2JQoIjr8lN20=; b=DtaIKAUvHKpHRbtjsKhypSASO4Jkl7CqOVIVEbRi6ix0YPlwdc/b+RRVR/UHiZgWWN H446sFXDpSwmdFBGkq+AwAz0C1CMNIiPutFFizs5usJfr7jabwzpC3x5fetx78kbxBh6 YAweyY/+MjL8LviPjwakW+66SoVAIsnwrQI189gcYLWDfuDi38Wbl/oAF3IPmbEPw3UR t1v+U5hbSw7buFOzS8CE0LQts6uk7APMxz31I0aKjSK1oa/J/Sh44DB/4PArc3xlGz72 nL8JTtXemjv0nGn5t3kNEkryVAjR1uKCEnfJAwpttYoOUtn4iK2Ufyj/qkkk3bz2IELC AVbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741470808; x=1742075608; 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=sd1Rqb0eZxPQ/q4aV8APc+tkTpr19bp2JQoIjr8lN20=; b=W+WTLniTmYr73BBGI5bJoqveeAmDmoa1pQ4qP98JkT5REnZDYUxYAjqw+NBicL2rFU 4JyIyyoWuD7sYiwC2s5DwDyH+H4YbJSFsHM4R/knIAlP7wEd5wx/MAdvnhNUB8UNBUlS Hr2YZg5Rx6DRzdyeN8yNZOboin3QTcIl8b9fGALWbJvf1kFJ/qE03N2R9Rf4j8MkigL1 7FTutzgfx/YHWjb5tLGkd5PrBOZaYRKUI/A+6cJC4r4CH5NfiOmf60Tlw3R6f600TgOj gcqyeGR4BFcLqKdiOvRSFWWWUnL+pDNqwgPEf2sRyxciU8eJzei345jpdN9y26tgYt3h gO7Q== X-Gm-Message-State: AOJu0Yx6uulzfk4jJP1B3UDSrCiR3I2ZrFC5Ts2dvTF8H+atjsqJYotB oZEXZ2eikFODRUY4uVDIsOGz+Vvf8/8d9VRlFW2uYm6UcBfD4fl/pegp8+BUhWQ= X-Gm-Gg: ASbGnctruYkWFeqCbwURilbWR+w+2dwcIIgWrrGwcCbJiaz57P7/bTpIefLgmwAh0b4 6Wa16wWyHTFRj2tRiS2WkALGAG6PEuMh/v+sjR6I7+3oi0MCgXIosPnu67zBMmgjMXqZ0Q/gTlX rCKBlrxIYYSGSoWhUt1apm0TpV0B9VimReZ/Nv4YXufvs/hCU+oWXn1n3BsUmkFsUErKZZmhCyc ir+u/oPkH89ncpeRtUxNjvbGxNKX3EvViDsahjxmymCjX7Royj29Qoslt0w8tKTh+no+xHtor7A hzEnomINR+iss5iC2NN57J1W7AbKpyJTlnxmOKMU/tN7f4s= X-Received: by 2002:a05:600c:214d:b0:439:a139:7a19 with SMTP id 5b1f17b1804b1-43cb302205emr46732615e9.23.1741470808577; Sat, 08 Mar 2025 13:53:28 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bdd93c9b6sm95691585e9.29.2025.03.08.13.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Mar 2025 13:53:27 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id BB9595FA77; Sat, 8 Mar 2025 21:53:26 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PULL 02/31] tests/functional: factor out common code in gpu test Date: Sat, 8 Mar 2025 21:52:57 +0000 Message-Id: <20250308215326.2907828-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250308215326.2907828-1-alex.bennee@linaro.org> References: <20250308215326.2907828-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.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 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 In preparation for handling more tests split out the common machine setup details from the test specific stuff and add a helper for launching the weston test. Instead of searching for "vkmark score" we set a custom PS1 and wait for a successful completion. This ensures we capture the score in the console log which otherwise wouldn't log anything. Reviewed-by: Thomas Huth Signed-off-by: Alex Bennée Message-Id: <20250304222439.2035603-3-alex.bennee@linaro.org> diff --git a/tests/functional/test_aarch64_virt_gpu.py b/tests/functional/test_aarch64_virt_gpu.py index 32af941cd5..b4679c0460 100755 --- a/tests/functional/test_aarch64_virt_gpu.py +++ b/tests/functional/test_aarch64_virt_gpu.py @@ -12,7 +12,7 @@ from qemu.machine.machine import VMLaunchFailure from qemu_test import Asset -from qemu_test import exec_command, exec_command_and_wait_for_pattern +from qemu_test import exec_command_and_wait_for_pattern as ec_and_wait from qemu_test import skipIfMissingCommands from qemu_test.linuxkernel import LinuxKernelTest @@ -31,12 +31,7 @@ class Aarch64VirtGPUMachine(LinuxKernelTest): 'rootfs.ext4.zstd', '792da7573f5dc2913ddb7c638151d4a6b2d028a4cb2afb38add513c1924bdad4') - @skipIfMissingCommands('zstd') - def test_aarch64_virt_with_vulkan_gpu(self): - # This tests boots with a buildroot test image that contains - # vkmark and other GPU exercising tools. We run a headless - # weston that nevertheless still exercises the virtio-gpu - # backend. + def _launch_virt_gpu(self, gpu_device): self.set_machine('virt') self.require_accelerator("tcg") @@ -54,10 +49,10 @@ def test_aarch64_virt_with_vulkan_gpu(self): '-kernel', kernel_path, '-append', kernel_command_line) self.vm.add_args("-smp", "2", "-m", "2048") - self.vm.add_args("-device", - "virtio-gpu-gl-pci,hostmem=4G,blob=on,venus=on") + self.vm.add_args("-device", gpu_device) self.vm.add_args("-display", "egl-headless") self.vm.add_args("-display", "dbus,gl=on") + self.vm.add_args("-device", "virtio-blk-device,drive=hd0") self.vm.add_args("-blockdev", "driver=raw,file.driver=file," @@ -81,14 +76,23 @@ def test_aarch64_virt_with_vulkan_gpu(self): raise excp self.wait_for_console_pattern('buildroot login:') - exec_command(self, 'root') - exec_command(self, 'export XDG_RUNTIME_DIR=/tmp') - exec_command_and_wait_for_pattern(self, - "weston -B headless " - "--renderer gl " - "--shell kiosk " - "-- vkmark -b:duration=1.0", - "vkmark Score") + ec_and_wait(self, 'root', '#') + + def _run_virt_weston_test(self, cmd): + + # make it easier to detect successful return to shell + PS1 = 'RES=[$?] # ' + OK_CMD = 'RES=[0] # ' + + ec_and_wait(self, 'export XDG_RUNTIME_DIR=/tmp', '#') + ec_and_wait(self, f"export PS1='{PS1}'", OK_CMD) + full_cmd = f"weston -B headless --renderer gl --shell kiosk -- {cmd}" + ec_and_wait(self, full_cmd, OK_CMD) + + @skipIfMissingCommands('zstd') + def test_aarch64_virt_with_vulkan_gpu(self): + self._launch_virt_gpu("virtio-gpu-gl-pci,hostmem=4G,blob=on,venus=on") + self._run_virt_weston_test("vkmark -b:duration=1.0") if __name__ == '__main__': LinuxKernelTest.main()