From nobody Fri May 17 03:54:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675698050; cv=none; d=zohomail.com; s=zohoarc; b=eMKt8fETK2TVXYtq7oiENUlVfWp2mI+PVTBMoyuT1VoInB55FavmUmuV/B0/56CRUIL0oXXWAhZI6JD/Ogz7T9RBdy1HxS/QBKGrXEgkgiQ/qlgmDupYVjcLge/rjq83VBN26hzHNIMcB3dJlMOgADCxiHpAWaBzcxP+Y+lekvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675698050; h=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=goSDfx7cmfycf8tBXDj8HVE4wyFuG1uzctEfXFzu2j8=; b=Eh9b0r8ktYUtgtbWF6UwzsiHP5CSQwjeyso8+pxFF+gIWRdYGLyEK0RFSFwl8nuaZkuqft5cskx8u69XerhaDP6bKNl9USc9LSAWQ7QeD5vebQsHWcbKLtHk3aVj1GMOrQYzdUN1H4T3nH0wMLgzh4sB3DCJnz4vpEhgmIUmCkM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675698050557806.6475861542971; Mon, 6 Feb 2023 07:40:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP34d-0003nz-PZ; Mon, 06 Feb 2023 10:06:27 -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 1pP34a-0003mb-74 for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:24 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34Y-0008MM-O6 for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:23 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8A46E605EA; Mon, 6 Feb 2023 15:06:21 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 34F52138E8; Mon, 6 Feb 2023 15:06:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SJB4O2sX4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675695981; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=goSDfx7cmfycf8tBXDj8HVE4wyFuG1uzctEfXFzu2j8=; b=b38f/EWiastCCpeu+pM77HwRhEscUWXyIy2OCgiZoXycRQpfIEp1YX79ecV0zYkUDhEXbf HlwejqtuBt71PcdJf5YicerOHTa7sSiYRgpIOBDl708ziIN2prmoY7rvllFmJ/dnoTGjtT tJs2yzm12R5rNQEO97x0Y03BPao17ig= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675695981; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=goSDfx7cmfycf8tBXDj8HVE4wyFuG1uzctEfXFzu2j8=; b=85qNz+LGJDAW9Rtmw7M2FJFJhuf1lhuvV1ke65q8rxUe9tDRJewfubHwAB0y6Mog8QFoVm B0VBAfUZK9wX0xAA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PATCH 01/12] tests/qtest: Skip PXE tests for missing devices Date: Mon, 6 Feb 2023 12:04:05 -0300 Message-Id: <20230206150416.4604-2-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=195.135.220.29; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675698050994100001 Content-Type: text/plain; charset="utf-8" Check if the devices we're trying to add are present in the QEMU binary. They could have been removed from the build via Kconfig or the --without-default-devices option. Signed-off-by: Fabiano Rosas Reviewed-by: Thomas Huth --- tests/qtest/pxe-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qtest/pxe-test.c b/tests/qtest/pxe-test.c index 52f0b5c67c..62b6eef464 100644 --- a/tests/qtest/pxe-test.c +++ b/tests/qtest/pxe-test.c @@ -108,6 +108,10 @@ static void test_batch(const testdef_t *tests, bool ip= v6) const testdef_t *test =3D &tests[i]; char *testname; =20 + if (!qtest_has_device(test->model)) { + continue; + } + testname =3D g_strdup_printf("pxe/ipv4/%s/%s", test->machine, test->model); qtest_add_data_func(testname, test, test_pxe_ipv4); --=20 2.35.3 From nobody Fri May 17 03:54:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675698512; cv=none; d=zohomail.com; s=zohoarc; b=dDugG7zqpjs0uqLJciRPSK+Vjx7cg+MxG+fBXKgFZtTB1syu8mGk4y+TgUrkaDcQUAQLJiwXgrC5qC90+YRfTOZ5diMosqMqucQ3ratVIFRQGrjHhDNj7EJ3uHfm4JKbqQMAlkqFY74LVjIX2j0Lk96qi62qC/RBCbu10nlk6JY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675698512; h=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=rY9bvUmHzpF8EYq003M5m/AMh8SAb7YC+mha6Wm6cEo=; b=b/z/+jaI1VaDbn0dMzElYrcIFlUNADpF/0KfqgP8aTYyNYD6fGnnhfSeuQyia0opz2DOPMMvPP/7XjUpyB3vOI5Zry95c8IAkK7l0zm6YWUmTM2d8mU9CqOznB6bXSnUaH47T112yCpvkFtHVtUuNJPIq+fn1x42T9qVG3tP/Wc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675698512754566.6721582490887; Mon, 6 Feb 2023 07:48:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP34g-0003oo-KF; Mon, 06 Feb 2023 10:06:30 -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 1pP34f-0003o9-Ag for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:29 -0500 Received: from smtp-out1.suse.de ([2001:67c:2178:6::1c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34d-0008N6-Q6 for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:29 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A5F183F455; Mon, 6 Feb 2023 15:06:24 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0416E138E8; Mon, 6 Feb 2023 15:06:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YEeNL20X4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675695984; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rY9bvUmHzpF8EYq003M5m/AMh8SAb7YC+mha6Wm6cEo=; b=bm+5c8OJUBXNXNBNYKkxgo8RNGvo13rRT7Ajf1S9arfWDo4CGKHlv9nHGEdtuxoXjGWrPo ofn+ilWZw1guesJ5ItcCBMCX6ZTIncmOVuwaTL/vXO3ohe/a8lELtiirD0G+QcgXt/3jIn a0Wug6ravI5paO674yTbsWOWcBE0kBU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675695984; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rY9bvUmHzpF8EYq003M5m/AMh8SAb7YC+mha6Wm6cEo=; b=dwiPUvmHgL5lexOZFYqlbxIEAQi2zclUlcbi5iFAnd60RXHWRerznqK0j/QbwkQSJjYGZS Pg5pfZ9KM+OqsbAA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , Paolo Bonzini , Fam Zheng , Alexander Bulekov , Bandan Das , Stefan Hajnoczi , Darren Kenny , Qiuhao Li , Laurent Vivier Subject: [PATCH 02/12] tests/qtest: Do not run lsi53c895a test if device is not present Date: Mon, 6 Feb 2023 12:04:06 -0300 Message-Id: <20230206150416.4604-3-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=2001:67c:2178:6::1c; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675698514784100003 Content-Type: text/plain; charset="utf-8" The tests are built once for all the targets, so as long as one QEMU binary is built with CONFIG_LSI_SCSI_PCI=3Dy, this test will run. However some binaries might not include the device. So check this again in runtime. Signed-off-by: Fabiano Rosas Reviewed-by: Thomas Huth --- tests/qtest/fuzz-lsi53c895a-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qtest/fuzz-lsi53c895a-test.c b/tests/qtest/fuzz-lsi53c89= 5a-test.c index 392a7ae7ed..a9254b455d 100644 --- a/tests/qtest/fuzz-lsi53c895a-test.c +++ b/tests/qtest/fuzz-lsi53c895a-test.c @@ -112,6 +112,10 @@ static void test_lsi_do_dma_empty_queue(void) =20 int main(int argc, char **argv) { + if (!qtest_has_device("lsi53c895a")) { + return 0; + } + g_test_init(&argc, &argv, NULL); =20 qtest_add_func("fuzz/lsi53c895a/lsi_do_dma_empty_queue", --=20 2.35.3 From nobody Fri May 17 03:54:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675696967; cv=none; d=zohomail.com; s=zohoarc; b=U0SpoIpu9Q+LJIKu6F8Y4M1Gs5xdCfvec01UtyxLczJ+el7N3C/uAtqudOmXdEQzcSILbxQ6wq2f5aot8dmeryPVvDClGJLf5hvm4kVBbjznCg+89FP3Jsyr+YG9oq6H2sCVVnYBnqbX7TNKQwk66IXrI6aex+rjRMjY/ICX66c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675696967; h=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=3J7/NcxoVEWec5A/Vpx7Mh9Ixo+lExXmGYXiad7Zabk=; b=WP+PMO6NXbMa5BZyzibkEoALj5t/v6+SDG6vn7p70v3w1KjDAVKSjRmMk0fTwhqgk+DQHNhqnhtI9+kAMDcp+yQScvbUm9Pz+2pxzCZcI+5rHmzO13JIPqcAsnbEYpJNr7zM8ywTRSK/oYrUIgjySuziqJlnpJfb0QSHLOJitew= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675696967365819.6535044695476; Mon, 6 Feb 2023 07:22:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP34i-0003pJ-2Q; Mon, 06 Feb 2023 10:06:32 -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 1pP34g-0003og-4v for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:30 -0500 Received: from smtp-out1.suse.de ([2001:67c:2178:6::1c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34e-0008NP-It for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:29 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 768BA3F456; Mon, 6 Feb 2023 15:06:26 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1FF43138E8; Mon, 6 Feb 2023 15:06:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QIyJNnAX4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675695986; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3J7/NcxoVEWec5A/Vpx7Mh9Ixo+lExXmGYXiad7Zabk=; b=Oxy3CrloHPET3zJl8WlBIjym4LkkIf1tBMEKAc1Y2u/pIFOJAv5jzHwCg92AW0Yqgk17gU xp8NHelf/w20xRi4CVpkV7p5EearDW/2jznxzom9XLwoA0QjiFr3wqoJJ+dZizRmQvRk5n Ckl6VVGRO7EDt1RWO74bElMTbSsZPhM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675695986; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3J7/NcxoVEWec5A/Vpx7Mh9Ixo+lExXmGYXiad7Zabk=; b=SwBmnultg/4YNn6h8UDZdl5hCD5zAfBf3eThwtqC+7bpf8ipjpTCJebhTI+XWzpJbUjXG7 dxb/5oBl6zS1RXBA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PATCH 03/12] tests/qtest: Add dependence on PCIE_ROOT for virtio-net-failover.c Date: Mon, 6 Feb 2023 12:04:07 -0300 Message-Id: <20230206150416.4604-4-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=2001:67c:2178:6::1c; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675696969625100003 Content-Type: text/plain; charset="utf-8" This test depends on the presence of the pcie-root-port device. Add a build time dependency and a runtime check. Signed-off-by: Fabiano Rosas --- tests/qtest/meson.build | 3 ++- tests/qtest/virtio-net-failover.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index e97616d327..431b623df9 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -73,7 +73,8 @@ qtests_i386 =3D \ (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) = + \ (config_host.has_key('CONFIG_POSIX') and = \ config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + = \ - (config_all_devices.has_key('CONFIG_VIRTIO_NET') and = \ + (config_all_devices.has_key('CONFIG_PCIE_ROOT') and = \ + config_all_devices.has_key('CONFIG_VIRTIO_NET') and = \ config_all_devices.has_key('CONFIG_Q35') and = \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and = \ slirp.found() ? ['virtio-net-failover'] : []) + = \ diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-fai= lover.c index 4a809590bf..9ca52cb026 100644 --- a/tests/qtest/virtio-net-failover.c +++ b/tests/qtest/virtio-net-failover.c @@ -1835,6 +1835,11 @@ int main(int argc, char **argv) gchar *tmpfile; int ret; =20 + if (!qtest_has_device("pcie-root-port") || + !qtest_has_device("virtio-net")) { + return 0; + } + g_test_init(&argc, &argv, NULL); =20 ret =3D g_file_open_tmp("failover_test_migrate-XXXXXX", &tmpfile, NULL= ); --=20 2.35.3 From nobody Fri May 17 03:54:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675696975; cv=none; d=zohomail.com; s=zohoarc; b=OD0bIGzvwYv+7SKHe5CNEUW0y7BXFcBIBFjYtdeui0zJzN5HfkRM5Hd7xehB6HwHkV/XWm9WTsE8v5ZOjmdnx2F4VKMlHnaTOlK3bNPVL3yUEI3e69E50b9NtMSb8qzcbhMHslLY81iooIb4M2WtJtWV8xTx1GXh82HEVTiK2JY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675696975; h=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=DHXn+iXSeZx5fTkpypKbwr2Y15Iugu7LIivXTes9CAI=; b=C13CSDrvQqhLAsz/0GuS8nK5CY6MsuJ2jcoPl3zpNwRPfFqieOSwRadneM9oyLzHuxeO9DpaFxoCWxfR68rcQ+5BIovlwVh31uaxa3N592tb5dlH/17o8yfF7aU1rFYUl+cQ9kI4Nqwm88/zk+ped3Wg3GDLqm/8MnJxa/FTJGU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675696975559609.6074091271511; Mon, 6 Feb 2023 07:22:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP34k-0003q3-0L; Mon, 06 Feb 2023 10:06:34 -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 1pP34h-0003or-1S for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:31 -0500 Received: from smtp-out1.suse.de ([2001:67c:2178:6::1c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34f-0008Nm-JJ for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:30 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 808383F457; Mon, 6 Feb 2023 15:06:28 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E29B3138E8; Mon, 6 Feb 2023 15:06:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SENZKnIX4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675695988; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DHXn+iXSeZx5fTkpypKbwr2Y15Iugu7LIivXTes9CAI=; b=ep+hx7G7KWE3pSSsMRrd3Galf73/O/2ONmj8nYp6mbbZbkM72w061k7wsUgiQnwHbDsH2k uBqt+wcx4jcN9+oG2At0+YEFAjd8icJN3hXAPd77+xA+6/a6+vsAOHJ/w1H5ky6Lv4AKU8 Dkl/S+HpmioOpNfo7bXjtOAVJK/xhbI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675695988; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DHXn+iXSeZx5fTkpypKbwr2Y15Iugu7LIivXTes9CAI=; b=tJHXPQVaqBQ5k9MiG1XK6xmXZtCKqjS6JUksSMkzqgwocRk1O5Rf0A0Z48wUDoF/5ruJFr zZwDQG9eNdrStLAw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , Laurent Vivier , Amit Shah , Paolo Bonzini Subject: [PATCH 04/12] tests/qtest: Skip virtio-serial-console tests if device not present Date: Mon, 6 Feb 2023 12:04:08 -0300 Message-Id: <20230206150416.4604-5-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=2001:67c:2178:6::1c; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675696977786100003 Content-Type: text/plain; charset="utf-8" The virtconsole device might not be present in the QEMU build that is being tested. Skip the test if that's the case. Signed-off-by: Fabiano Rosas --- tests/qtest/virtio-serial-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qtest/virtio-serial-test.c b/tests/qtest/virtio-serial-t= est.c index 2541034822..f4e05e8fdd 100644 --- a/tests/qtest/virtio-serial-test.c +++ b/tests/qtest/virtio-serial-test.c @@ -28,6 +28,10 @@ static void register_virtio_serial_test(void) { QOSGraphTestOptions opts =3D { }; =20 + if (!qtest_has_device("virtconsole")) { + return; + } + opts.edge.before_cmd_line =3D "-device virtconsole,bus=3Dvser0.0"; qos_add_test("console-nop", "virtio-serial", virtio_serial_nop, &opts); =20 --=20 2.35.3 From nobody Fri May 17 03:54:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675697775; cv=none; d=zohomail.com; s=zohoarc; b=RG+3psc1iX4DqNK07ed9T+ORfr+5yg5oCxZ3IMYdtdX+or0iW5Tqezg3UOz5cC1o5pfGdP4xE64Q8g6O+toiPjXsJ9zTyFtIBr3FZcYJfahlSiwNCmt+nr2AeQ8REIiUz7iP+jQkJQoUEn2MY6el0uiYiAl7Wgn17GWbpCLEQgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675697775; h=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=o+GYSl9BGML22x7esUYqOdo8etuTX5DUa2/li2dtsRA=; b=jql2pls9tF+6JC6MH0gdfuB+sx7xvQFswG9N4KvridfGknEH0ps6qyS6tLpJQ3haRSAOmVLn9Vyq6CzcGFbA8vE8rgMb7d95BzkYPtTUroTl5pIQHKVgUZMwpU/S76Bh1X3maRedlVi2SPjrArdZIUScgFK3hiVAsSyIWnUDd4c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675697775299818.4969693962964; Mon, 6 Feb 2023 07:36:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP34l-0003qY-6P; Mon, 06 Feb 2023 10:06: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 1pP34j-0003pf-5D for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:33 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34h-0008OL-Ca for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:32 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4B4726056C; Mon, 6 Feb 2023 15:06:30 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id ED86B138E8; Mon, 6 Feb 2023 15:06:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id oM32LHQX4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675695990; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o+GYSl9BGML22x7esUYqOdo8etuTX5DUa2/li2dtsRA=; b=ycZ/SuEPeLDjiItb8QEXLnNgvo8sphEE8KqKzcz7vXtXWtcBsDYgl+mF4qzKmYLnKOVS7F qATgpswhEu8RPGmicQVcIFY5FHY9nulV8uw6umbcc18QadjZbO+B61AfFJ32vTvmK1zGJa KxZIJMR+K6hnuesf1Ay2NZRd0sRa1pg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675695990; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o+GYSl9BGML22x7esUYqOdo8etuTX5DUa2/li2dtsRA=; b=bHvMi5zCGsdHvUB3LH9RdvPu0hv1d62wlre6IkwFzBd3wZvvdk1LQHbvcJSWkxtYBQZxIf cWAgiLIJ1ikCfbCg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PATCH 05/12] tests/qtest: hd-geo-test: Check for missing devices Date: Mon, 6 Feb 2023 12:04:09 -0300 Message-Id: <20230206150416.4604-6-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=195.135.220.29; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675697775960100001 Content-Type: text/plain; charset="utf-8" Don't include tests that require devices not available in the QEMU binary. Signed-off-by: Fabiano Rosas Reviewed-by: Thomas Huth --- tests/qtest/hd-geo-test.c | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index 4a7628077b..5aa258a2b3 100644 --- a/tests/qtest/hd-geo-test.c +++ b/tests/qtest/hd-geo-test.c @@ -1090,30 +1090,42 @@ int main(int argc, char **argv) qtest_add_func("hd-geo/override/ide", test_override_ide); if (qtest_has_device("lsi53c895a")) { qtest_add_func("hd-geo/override/scsi", test_override_scsi); - qtest_add_func("hd-geo/override/scsi_2_controllers", - test_override_scsi_2_controllers); + if (qtest_has_device("virtio-scsi-pci")) { + qtest_add_func("hd-geo/override/scsi_2_controllers", + test_override_scsi_2_controllers); + } } - qtest_add_func("hd-geo/override/virtio_blk", test_override_virtio_= blk); qtest_add_func("hd-geo/override/zero_chs", test_override_zero_chs); - qtest_add_func("hd-geo/override/scsi_hot_unplug", - test_override_scsi_hot_unplug); - qtest_add_func("hd-geo/override/virtio_hot_unplug", - test_override_virtio_hot_unplug); + if (qtest_has_device("virtio-scsi-pci")) { + qtest_add_func("hd-geo/override/scsi_hot_unplug", + test_override_scsi_hot_unplug); + } + if (qtest_has_device("virtio-blk-pci")) { + qtest_add_func("hd-geo/override/virtio_hot_unplug", + test_override_virtio_hot_unplug); + qtest_add_func("hd-geo/override/virtio_blk", + test_override_virtio_blk); + } =20 if (qtest_has_machine("q35")) { qtest_add_func("hd-geo/override/sata", test_override_sata); - qtest_add_func("hd-geo/override/virtio_blk_q35", - test_override_virtio_blk_q35); qtest_add_func("hd-geo/override/zero_chs_q35", test_override_zero_chs_q35); if (qtest_has_device("lsi53c895a")) { qtest_add_func("hd-geo/override/scsi_q35", test_override_scsi_q35); } - qtest_add_func("hd-geo/override/scsi_hot_unplug_q35", - test_override_scsi_hot_unplug_q35); - qtest_add_func("hd-geo/override/virtio_hot_unplug_q35", - test_override_virtio_hot_unplug_q35); + if (qtest_has_device("virtio-scsi-pci")) { + qtest_add_func("hd-geo/override/scsi_hot_unplug_q35", + test_override_scsi_hot_unplug_q35); + } + if (qtest_has_device("virtio-blk-pci")) { + qtest_add_func("hd-geo/override/virtio_hot_unplug_q35", + test_override_virtio_hot_unplug_q35); + qtest_add_func("hd-geo/override/virtio_blk_q35", + test_override_virtio_blk_q35); + } + } } else { g_test_message("QTEST_QEMU_IMG not set or qemu-img missing; " --=20 2.35.3 From nobody Fri May 17 03:54:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675698230; cv=none; d=zohomail.com; s=zohoarc; b=jgGL3Erh+U07KOhjvkuFzCDeweyrEtFMDnYhYV7i162Ms32x21gnDa4ha1FZ1TZuP8iWs8QAI4NlIuvDhI571FDI8VmEm5Jwy1c5Ysxvx5e4FclSqgA5qp3YsF8rQrfAKDxmDW3RM9YLsQ8VU+v59llUR599bDayRQeGbftY0Uk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675698230; h=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=O8MO8fFpHkrT5iCSfryXtaeiZ8WPv8JiXUvDOuHVgjw=; b=Td8otHQSbo2K7YinDS4H7HVMIT+VrxtHNunOgHkegSLXzVGWnOml+d2lBkI4PAOVRnXQsGjMCocCnlhrJ9w5rFfJykVpfpf73I46VrM6BKazs0A5QxXbEP45hrRIyGBwQPkKO+QOlrns2P20DY5TPm1znKDLUnl9VyWE6RbcGt8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675698230527908.5339431337343; Mon, 6 Feb 2023 07:43:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP34n-0003r5-SA; Mon, 06 Feb 2023 10:06:37 -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 1pP34k-0003qW-WD for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:35 -0500 Received: from smtp-out1.suse.de ([2001:67c:2178:6::1c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34j-0008Op-7m for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:34 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1ADBC3F457; Mon, 6 Feb 2023 15:06:32 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B89E5138E8; Mon, 6 Feb 2023 15:06:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EO0ZIHYX4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675695992; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O8MO8fFpHkrT5iCSfryXtaeiZ8WPv8JiXUvDOuHVgjw=; b=kju15KLLhTKGMx7NNGY1M05BXofkcVzKEsYg1cdoz1wB/6q2E1FskZQvJrIhcsO0VGoydS 2lux9w+vYjbcmF1oxedpAEeicjDhaHo0gdbPtadYbXePZWQo9jZTUNdXMjBFCYj2XWJ/X8 fSFivnmTbPnwIPUeDdlpJEgDqi0UuP0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675695992; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O8MO8fFpHkrT5iCSfryXtaeiZ8WPv8JiXUvDOuHVgjw=; b=SG3avQZM8Z60QBACOMwSTBs+qGrscR/eHvFiQ1bxKDzfMoJLeF9zZAptaNDOC7BUc4UOOz YAoqKlrxJp0U2+CA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PATCH 06/12] tests/qtest: Skip unplug tests that use missing devices Date: Mon, 6 Feb 2023 12:04:10 -0300 Message-Id: <20230206150416.4604-7-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=2001:67c:2178:6::1c; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675698230721100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Fabiano Rosas --- tests/qtest/device-plug-test.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c index 5a6afa2b57..931acbdf50 100644 --- a/tests/qtest/device-plug-test.c +++ b/tests/qtest/device-plug-test.c @@ -67,6 +67,11 @@ static void test_pci_unplug_request(void) const char *arch =3D qtest_get_arch(); const char *machine_addition =3D ""; =20 + if (!qtest_has_device("virtio-mouse-pci")) { + g_test_skip("Device virtio-mouse-pci not available"); + return; + } + if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { machine_addition =3D "-machine pc"; } @@ -81,6 +86,10 @@ static void test_pci_unplug_request(void) =20 static void test_q35_pci_unplug_request(void) { + if (!qtest_has_device("virtio-mouse-pci")) { + g_test_skip("Device virtio-mouse-pci not available"); + return; + } =20 QTestState *qtest =3D qtest_initf("-machine q35 " "-device pcie-root-port,id=3Dp1 " @@ -97,6 +106,11 @@ static void test_pci_unplug_json_request(void) const char *arch =3D qtest_get_arch(); const char *machine_addition =3D ""; =20 + if (!qtest_has_device("virtio-mouse-pci")) { + g_test_skip("Device virtio-mouse-pci not available"); + return; + } + if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { machine_addition =3D "-machine pc"; } @@ -123,6 +137,11 @@ static void test_q35_pci_unplug_json_request(void) "'bus': 'b1', " "'id': 'dev0'}\""; =20 + if (!qtest_has_device("virtio-mouse-pci")) { + g_test_skip("Device virtio-mouse-pci not available"); + return; + } + QTestState *qtest =3D qtest_initf("-machine q35 %s %s %s", port, bridge, device); =20 --=20 2.35.3 From nobody Fri May 17 03:54:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675696987; cv=none; d=zohomail.com; s=zohoarc; b=CcIyK5uEkoDjjJoYq5BQCPoGiXgl70L2egE4AQ+QBan/PJs/9VT1xAkX1Y+IAzP3ky98dGFv7/ruhB+9DPayfcA2s4Gm5sYndMD3hSuvbrsHSuagjPxrCjPpi1pT/FcfDctMm/pXntXxWAXexSWCCsiBEZw/86GsuWGfOQu7cVA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675696987; h=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=gThNfP6Ml2oVg/SfCswVI8P1z1B+P2O76UmDUlqm5UY=; b=eEvsM16KeARH1SFxbD+WB0H8ZXPvM0RDWHZN3WOwF9Cx+hvU24R6qMeSoDrlGY/iSIEfmhTXk7cW7smb3BjZlMNVw/VfVnuOiWKzU/jvnQp+xeXP0tmlGKCNGi4q+XPr2ElFNqmKpn4r///MdUcxf0szNriQnT/7DTCyVNbMVxQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675696987343417.9527295735742; Mon, 6 Feb 2023 07:23:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP34o-0003rk-SY; Mon, 06 Feb 2023 10:06:38 -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 1pP34m-0003r8-Su for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:36 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34k-0008PI-Ve for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:36 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D45943F458; Mon, 6 Feb 2023 15:06:33 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8754E138E8; Mon, 6 Feb 2023 15:06:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8GsrFHgX4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675695993; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gThNfP6Ml2oVg/SfCswVI8P1z1B+P2O76UmDUlqm5UY=; b=m1r3o71KMDsD2xaEhSEmU0kTe5wmQRuga+GmI/waA06KjTExBSp8PjxbkdtGhJelT0syBe 6M8sfvXgXwrxJOht9bUVoOLLOIPuLuFi4lCeMuCPsWJTwMiy0C92VSyAYG5TDwe4z7WxTU ewqdrWm6ys2Kg4qJUwUKYkZ0eStSU5w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675695993; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gThNfP6Ml2oVg/SfCswVI8P1z1B+P2O76UmDUlqm5UY=; b=nAmbg7G95xSQjHDjxcHlSH1818JVoyIXcMoHHcfVY0Y8GDZtjb2/co1x6gEtffMJzSGQtP SEWsd6o8VLwkKVBg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PATCH 07/12] tests/qtest: drive_del-test: Skip tests that require missing devices Date: Mon, 6 Feb 2023 12:04:11 -0300 Message-Id: <20230206150416.4604-8-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=195.135.220.28; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675696987701100012 Content-Type: text/plain; charset="utf-8" Signed-off-by: Fabiano Rosas --- tests/qtest/drive_del-test.c | 70 ++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c index 9a750395a9..6fa96fa94a 100644 --- a/tests/qtest/drive_del-test.c +++ b/tests/qtest/drive_del-test.c @@ -16,6 +16,21 @@ #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" =20 +static const char *qvirtio_get_dev_type(void); + +/* + * This covers the possible absence of a device due to QEMU build + * options. + */ +static bool look_for_device_builtin(const char *prefix, const char *suffix) +{ + gchar *device =3D g_strdup_printf("%s-%s", prefix, suffix); + bool rc =3D qtest_has_device(device); + + g_free(device); + return rc; +} + static bool look_for_drive0(QTestState *qts, const char *command, const ch= ar *key) { QDict *response; @@ -40,6 +55,11 @@ static bool look_for_drive0(QTestState *qts, const char = *command, const char *ke return found; } =20 +static bool has_device_builtin(const char *dev) +{ + return look_for_device_builtin(dev, qvirtio_get_dev_type()); +} + static bool has_drive(QTestState *qts) { return look_for_drive0(qts, "query-block", "device"); @@ -208,6 +228,11 @@ static void test_drive_del_device_del(void) { QTestState *qts; =20 + if (!has_device_builtin("virtio-scsi")) { + g_test_skip(NULL); + return; + } + /* Start with a drive used by a device that unplugs instantaneously */ qts =3D qtest_initf("-drive if=3Dnone,id=3Ddrive0,file=3Dnull-co://," "file.read-zeroes=3Don,format=3Draw" @@ -232,6 +257,11 @@ static void test_cli_device_del(void) const char *arch =3D qtest_get_arch(); const char *machine_addition =3D ""; =20 + if (!has_device_builtin("virtio-blk")) { + g_test_skip(NULL); + return; + } + if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { machine_addition =3D "-machine pc"; } @@ -256,6 +286,11 @@ static void test_cli_device_del_q35(void) { QTestState *qts; =20 + if (!has_device_builtin("virtio-blk")) { + g_test_skip(NULL); + return; + } + /* * -drive/-device and device_del. Start with a drive used by a * device that unplugs after reset. @@ -277,6 +312,11 @@ static void test_empty_device_del(void) { QTestState *qts; =20 + if (!has_device_builtin("virtio-scsi")) { + g_test_skip(NULL); + return; + } + /* device_del with no drive plugged. */ qts =3D qtest_initf("-device virtio-scsi-%s -device scsi-cd,id=3Ddev0", qvirtio_get_dev_type()); @@ -291,6 +331,11 @@ static void test_device_add_and_del(void) const char *arch =3D qtest_get_arch(); const char *machine_addition =3D ""; =20 + if (!has_device_builtin("virtio-blk")) { + g_test_skip(NULL); + return; + } + if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { machine_addition =3D "-machine pc"; } @@ -330,6 +375,11 @@ static void test_device_add_and_del_q35(void) { QTestState *qts; =20 + if (!has_device_builtin("virtio-blk")) { + g_test_skip(NULL); + return; + } + /* * -drive/device_add and device_del. Start with a drive used by a * device that unplugs after reset. @@ -352,6 +402,11 @@ static void test_drive_add_device_add_and_del(void) const char *arch =3D qtest_get_arch(); const char *machine_addition =3D ""; =20 + if (!has_device_builtin("virtio-blk")) { + g_test_skip(NULL); + return; + } + if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { machine_addition =3D "-machine pc"; } @@ -374,6 +429,11 @@ static void test_drive_add_device_add_and_del_q35(void) { QTestState *qts; =20 + if (!has_device_builtin("virtio-blk")) { + g_test_skip(NULL); + return; + } + qts =3D qtest_init("-machine q35 -device pcie-root-port,id=3Dp1 " "-device pcie-pci-bridge,bus=3Dp1,id=3Db1"); =20 @@ -395,6 +455,11 @@ static void test_blockdev_add_device_add_and_del(void) const char *arch =3D qtest_get_arch(); const char *machine_addition =3D ""; =20 + if (!has_device_builtin("virtio-blk")) { + g_test_skip(NULL); + return; + } + if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { machine_addition =3D "-machine pc"; } @@ -417,6 +482,11 @@ static void test_blockdev_add_device_add_and_del_q35(v= oid) { QTestState *qts; =20 + if (!has_device_builtin("virtio-blk")) { + g_test_skip(NULL); + return; + } + qts =3D qtest_init("-machine q35 -device pcie-root-port,id=3Dp1 " "-device pcie-pci-bridge,bus=3Dp1,id=3Db1"); =20 --=20 2.35.3 From nobody Fri May 17 03:54:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675696985; cv=none; d=zohomail.com; s=zohoarc; b=Ax7NWwpCRYvlAxJdGcx4vGMvxkw1tdUyrDwCvNMsIFgg0qxT104dIqX/UYnVyDtQFlJXKROdJSs/db5B3WwWvfy5/FlS3TzmbzRTgO9zuVhIAQM+gnxGvquBlAMBo6T46H7AqGqhSRkaBzmvvQ472Z6ld2XDcGJkkll1lKpcrOw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675696985; h=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=tt7m42D4iHF+/zWVavAL6Ksm1ZZSEgB/IQavnNmDYZk=; b=LqjwpJ/rWGnwU9o+WfzIBlev2jcFbUlErgAQvgxPzgS7pwbh9lqmSAWsUb9ah2CABSaIm3vL2j9txXqIuEQ8sU7WD+cBjxJbGO8ruGDa4+Gu/MTqVtpPht3LPlQERBr7uFRt020RfMRWb527DOFjAAQfNHUaxX0YZs166L08GVc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675696985720314.4275781589671; Mon, 6 Feb 2023 07:23:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP34r-0003um-Ua; Mon, 06 Feb 2023 10:06:41 -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 1pP34p-0003uA-UB for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:40 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34n-0008Pi-0A for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:39 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D5B0E6056C; Mon, 6 Feb 2023 15:06:35 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4D514138E8; Mon, 6 Feb 2023 15:06:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gEIFBnoX4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675695995; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tt7m42D4iHF+/zWVavAL6Ksm1ZZSEgB/IQavnNmDYZk=; b=RQfX6lQPqXbVJFfaa3nHx936FLo3HnLbaXAvR3wKOSc9m3bQpxl9jGsiQ2ZAWT5rPPbGTE xghexnckxTnqh7J7zdfodHnn4NP9OzvsuAitGFJsTxKkak5cfTdVDIDAgJ6Zup/f3ods2G x/eipC0YQcmTBJB8zM6Za8k4R8BLN+M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675695995; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tt7m42D4iHF+/zWVavAL6Ksm1ZZSEgB/IQavnNmDYZk=; b=0qmrV3AopUeMSGcC0xb8I/PnJZoe6/ak8q5ZtMDLR4jvTJznIcdKUNB0JCMCJceikd7mOF woWKVTlHIjePgACg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Subject: [PATCH 08/12] tests/qtest: Check for devices in bios-tables-test Date: Mon, 6 Feb 2023 12:04:12 -0300 Message-Id: <20230206150416.4604-9-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=195.135.220.29; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675696987696100011 Content-Type: text/plain; charset="utf-8" Do not include tests that require devices that are not available in the QEMU build. Signed-off-by: Fabiano Rosas Acked-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test.c | 75 ++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 4 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index d8c8cda58e..d29a4e47af 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1008,6 +1008,12 @@ static void test_acpi_q35_multif_bridge(void) .machine =3D MACHINE_Q35, .variant =3D ".multi-bridge", }; + + if (!qtest_has_device("pcie-root-port")) { + g_test_skip("Device pcie-root-port is not available"); + goto out; + } + test_vm_prepare("-S" " -device virtio-balloon,id=3Dballoon0,addr=3D0x4.0x2" " -device pcie-root-port,id=3Drp0,multifunction=3Don," @@ -1043,6 +1049,7 @@ static void test_acpi_q35_multif_bridge(void) /* check that reboot/reset doesn't change any ACPI tables */ qtest_qmp_send(data.qts, "{'execute':'system_reset' }"); process_acpi_tables(&data); +out: free_test_data(&data); } =20 @@ -1396,6 +1403,11 @@ static void test_acpi_tcg_dimm_pxm(const char *machi= ne) { test_data data; =20 + if (!qtest_has_device("nvdimm")) { + g_test_skip("Device nvdimm is not available"); + return; + } + memset(&data, 0, sizeof(data)); data.machine =3D machine; data.variant =3D ".dimmpxm"; @@ -1444,6 +1456,11 @@ static void test_acpi_virt_tcg_memhp(void) .scan_len =3D 256ULL * 1024 * 1024, }; =20 + if (!qtest_has_device("nvdimm")) { + g_test_skip("Device nvdimm is not available"); + goto out; + } + data.variant =3D ".memhp"; test_acpi_one(" -machine nvdimm=3Don" " -cpu cortex-a57" @@ -1457,7 +1474,7 @@ static void test_acpi_virt_tcg_memhp(void) " -device pc-dimm,id=3Ddimm0,memdev=3Dram2,node=3D0" " -device nvdimm,id=3Ddimm1,memdev=3Dnvm0,node=3D1", &data); - +out: free_test_data(&data); =20 } @@ -1475,6 +1492,11 @@ static void test_acpi_microvm_tcg(void) { test_data data; =20 + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); test_acpi_one(" -machine microvm,acpi=3Don,ioapic2=3Doff,rtc=3Doff", &data); @@ -1485,6 +1507,11 @@ static void test_acpi_microvm_usb_tcg(void) { test_data data; =20 + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); data.variant =3D ".usb"; test_acpi_one(" -machine microvm,acpi=3Don,ioapic2=3Doff,usb=3Don,rtc= =3Doff", @@ -1496,6 +1523,11 @@ static void test_acpi_microvm_rtc_tcg(void) { test_data data; =20 + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); data.variant =3D ".rtc"; test_acpi_one(" -machine microvm,acpi=3Don,ioapic2=3Doff,rtc=3Don", @@ -1507,6 +1539,11 @@ static void test_acpi_microvm_pcie_tcg(void) { test_data data; =20 + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); data.variant =3D ".pcie"; data.tcg_only =3D true; /* need constant host-phys-bits */ @@ -1519,6 +1556,11 @@ static void test_acpi_microvm_ioapic2_tcg(void) { test_data data; =20 + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); data.variant =3D ".ioapic2"; test_acpi_one(" -machine microvm,acpi=3Don,ioapic2=3Don,rtc=3Doff", @@ -1558,6 +1600,12 @@ static void test_acpi_virt_tcg_pxb(void) .ram_start =3D 0x40000000ULL, .scan_len =3D 128ULL * 1024 * 1024, }; + + if (!qtest_has_device("pcie-root-port")) { + g_test_skip("Device pcie-root-port is not available"); + goto out; + } + /* * While using -cdrom, the cdrom would auto plugged into pxb-pcie, * the reason is the bus of pxb-pcie is also root bus, it would lead @@ -1576,7 +1624,7 @@ static void test_acpi_virt_tcg_pxb(void) " -cpu cortex-a57" " -device pxb-pcie,bus_nr=3D128", &data); - +out: free_test_data(&data); } =20 @@ -1764,6 +1812,12 @@ static void test_acpi_microvm_acpi_erst(void) gchar *params; test_data data; =20 + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + g_free(tmp_path); + return; + } + test_acpi_microvm_prepare(&data); data.variant =3D ".pcie"; data.tcg_only =3D true; /* need constant host-phys-bits */ @@ -1824,6 +1878,11 @@ static void test_acpi_q35_viot(void) .variant =3D ".viot", }; =20 + if (!qtest_has_device("virtio-iommu")) { + g_test_skip("Device virtio-iommu is not available"); + goto out; + } + /* * To keep things interesting, two buses bypass the IOMMU. * VIOT should only describes the other two buses. @@ -1834,6 +1893,7 @@ static void test_acpi_q35_viot(void) "-device pxb-pcie,bus_nr=3D0x20,id=3Dpcie.200,bus=3Dpcie= .0,bypass_iommu=3Don " "-device pxb-pcie,bus_nr=3D0x30,id=3Dpcie.300,bus=3Dpcie= .0", &data); +out: free_test_data(&data); } =20 @@ -1894,8 +1954,10 @@ static void test_acpi_virt_viot(void) .scan_len =3D 128ULL * 1024 * 1024, }; =20 - test_acpi_one("-cpu cortex-a57 " - "-device virtio-iommu-pci", &data); + if (qtest_has_device("virtio-iommu")) { + test_acpi_one("-cpu cortex-a57 " + "-device virtio-iommu-pci", &data); + } free_test_data(&data); } =20 @@ -2004,6 +2066,11 @@ static void test_acpi_microvm_oem_fields(void) test_data data; char *args; =20 + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); =20 args =3D test_acpi_create_args(&data, --=20 2.35.3 From nobody Fri May 17 03:54:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675697342; cv=none; d=zohomail.com; s=zohoarc; b=P8R6FFSclYu/BAv+5K+46ev86cRoJLrV0YGckk+o6IHU+JYAocOixeVzd4Z51ndmlHrrUkLnbP93ogYJ8umPUK2KISkc6AMW5C9g1bb4wS8r/uM81MR6wmIl8RcAYkMWLVw8C9QQuDRGU5doyu9arRzUpzEdFkZMdv2b1BkqZHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675697342; h=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=ERF/eYRp1uSXd+v28TrQ+yEaIQU6blReaQ6jeUk4Uzo=; b=b2uH7TrPC9+eG03cF/sfc6cCLBMq3fNun0hXE15Re3Y2MIabWwXgFoa13aMSOrQH853/k/yslP9MvSFKtg4580v8Goepog2DoQtk85Xl6XJbwuVJLeLXx5UUrJbw+ipKBH7riGxd9Dled8EzlemFQ5+oNWejDX2YtDylRLhcYdA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675697342474306.62003567197826; Mon, 6 Feb 2023 07:29:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP34u-0003xp-NT; Mon, 06 Feb 2023 10:06:44 -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 1pP34q-0003uH-N0 for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:40 -0500 Received: from smtp-out1.suse.de ([2001:67c:2178:6::1c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34p-0008QA-1f for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:40 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DC7AE3F458; Mon, 6 Feb 2023 15:06:37 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 50831138E8; Mon, 6 Feb 2023 15:06:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id yPmgBnwX4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675695997; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ERF/eYRp1uSXd+v28TrQ+yEaIQU6blReaQ6jeUk4Uzo=; b=WsPrrd4VEbcFJ7l6Q2L8ha2N+02eN0bwwVE5EuAfRMsPMjYeQV1fk3PUpW77gCSAe0RnCP QClecxpHrQgv/xBFY5y72Y5x63UVAv9U5pwoCcdCCsghElLGCcNZC7NwR8eJW+dgkPS0nW px54g5r5wgaJhnxkYbCq7vgOLq6i3Mk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675695997; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ERF/eYRp1uSXd+v28TrQ+yEaIQU6blReaQ6jeUk4Uzo=; b=GcfvnPmdsG16C6zGf7M0FwKRlaQ3RG9SLEVrddhDc/qtHYpyPldaRvX3jxwMHJMo5Ii32g d9G+EsiVQu5HYkCg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , Su Hang , Laurent Vivier , Paolo Bonzini Subject: [PATCH 09/12] tests/qtest: Do not include hexloader-test if loader device is not present Date: Mon, 6 Feb 2023 12:04:13 -0300 Message-Id: <20230206150416.4604-10-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=2001:67c:2178:6::1c; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675697344721100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Fabiano Rosas --- tests/qtest/hexloader-test.c | 5 +++++ tests/qtest/meson.build | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/qtest/hexloader-test.c b/tests/qtest/hexloader-test.c index 3023548041..3ab464f438 100644 --- a/tests/qtest/hexloader-test.c +++ b/tests/qtest/hexloader-test.c @@ -22,6 +22,11 @@ static void hex_loader_test(void) unsigned int i; const unsigned int base_addr =3D 0x00010000; =20 + if (!qtest_has_device("loader")) { + g_test_skip("Device 'loader' not available"); + return; + } + QTestState *s =3D qtest_initf( "-M vexpress-a9 -device loader,file=3Dtests/data/hex-loader/test.h= ex"); =20 diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 431b623df9..a930706a43 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -197,11 +197,11 @@ qtests_arm =3D \ (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test= '] : []) + \ (config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed : []) += \ (config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \ + (config_all_devices.has_key('CONFIG_GENERIC_LOADER') ? ['hexloader-test'= ] : []) + \ ['arm-cpu-features', 'microbit-test', 'test-arm-mptimer', - 'boot-serial-test', - 'hexloader-test'] + 'boot-serial-test'] =20 # TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-tes= t unconditional qtests_aarch64 =3D \ --=20 2.35.3 From nobody Fri May 17 03:54:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675698444; cv=none; d=zohomail.com; s=zohoarc; b=jrKNdZy0yExy8cGk+jCxkoXaz6wMIvV0D6a/RCN4wO4h7z09VFmZw0aNA0w3EzvY2aGIogvR8CmjNvYcXkknETAga/5vVjUKvV6YrRITSUwFXOfODuilEmKoCVgU05fYSlCz2Tm8gVTyfrcoTP97TwTMxKRJdeVZOJXBzGU/vVM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675698444; h=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=1eNbsYvP7CwZOcw5Y0L+l8vJNH2vWuCrSQHXOX6eOOY=; b=h2pM5XBj6AleRKeApdobUABAu2jN4PV9L5Da+UDE5rZw8ALKN9Hw6/+QdNvX9sd/3k0h6Lc7RniHfRz/WeKpBHRSjoCfWHIKWVi8Q+caAj7J8Urov9Wv/pqwZ3F/Kibj8s9XpZbltnx7HMTZAX/9IAPrk6xZFhxIbc+VmeliHu0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675698444039105.38263769305365; Mon, 6 Feb 2023 07:47:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP34v-00043g-89; Mon, 06 Feb 2023 10:06:45 -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 1pP34s-0003v9-VD; Mon, 06 Feb 2023 10:06:42 -0500 Received: from smtp-out1.suse.de ([2001:67c:2178:6::1c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34r-0008S2-AU; Mon, 06 Feb 2023 10:06:42 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E7BE13F459; Mon, 6 Feb 2023 15:06:39 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 54C4A138E8; Mon, 6 Feb 2023 15:06:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wI6zB34X4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675695999; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1eNbsYvP7CwZOcw5Y0L+l8vJNH2vWuCrSQHXOX6eOOY=; b=qN7X2Hhg5crivArYxP/KoeMjr93bJcv5/6H1+YvuyUVC2AWV6D2W+2g54CD6/GpPmZH2gK hJ9jVF+FNb2W6oeNf8vHtj5ZGC4d9+ELny6F2faHxar2hzVvdjjVUbHnlv87TAUaWAkjUc zLNA2NQ2OpnFdkXSD3L9/SRBMwVIAMk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675695999; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1eNbsYvP7CwZOcw5Y0L+l8vJNH2vWuCrSQHXOX6eOOY=; b=ugo17InzdXr7G+x9Y9pTD8v/NlOUq8hyhjngzLxZEZSZwuX/BiwaWsMWWiBgU83HQN+YjD YYovQ7Fa4UbveYCQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org Subject: [PATCH 10/12] tests/qemu-iotests: Require virtio-scsi-pci Date: Mon, 6 Feb 2023 12:04:14 -0300 Message-Id: <20230206150416.4604-11-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=2001:67c:2178:6::1c; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675698446441100003 Content-Type: text/plain; charset="utf-8" Check that virtio-scsi-pci is present in the QEMU build before running the tests. Signed-off-by: Fabiano Rosas Reviewed-by: Thomas Huth --- tests/qemu-iotests/186 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/186 b/tests/qemu-iotests/186 index 072e54e62b..eaf13c7a33 100755 --- a/tests/qemu-iotests/186 +++ b/tests/qemu-iotests/186 @@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file fuse _require_drivers null-co +_require_devices virtio-scsi-pci =20 if [ "$QEMU_DEFAULT_MACHINE" !=3D "pc" ]; then _notrun "Requires a PC machine" --=20 2.35.3 From nobody Fri May 17 03:54:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675697303; cv=none; d=zohomail.com; s=zohoarc; b=iwHsV3I/iZ5UkrhyMOrrpGswiY19F3tX9szC7voVK9YYuGSUXz+PgEF4ELO5vWwNdspCJfqH33QKiIucLT8+3JHcUh1/oa1WgPobkL4eA6vp+GiTeqdUkfOEKwsyIBEir+qF6ZJowmDOC1GV6wO/Ds1MpIMQGch2+cWHmRaWP3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675697303; h=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=NXZtz6drXmu5S9m5FeMIml4zOVj2zvdZ6JoGmNfyPl4=; b=B3plwDPxPxTAik+KHQqNQ35ZlN6EV1woOXmpsbeyVdR5AVm3p+N7GMvHDBDZbJA4R7HFB8eug/Gbw4q3If1WwA9Holp6bIw/FSkdL+1lKUod88BnvaqWtfwmg3a65Cw5weRBiBBZ/8Wh9Kx0bp2Ye2NsM/3ph58lbxgG3mezE1Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675697303425415.9440926697753; Mon, 6 Feb 2023 07:28:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP34x-0004BN-HS; Mon, 06 Feb 2023 10:06:47 -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 1pP34v-000446-8L for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:45 -0500 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34t-0008SS-Dh for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:44 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B48F6605EA; Mon, 6 Feb 2023 15:06:41 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5FC1F138E8; Mon, 6 Feb 2023 15:06:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wCtzCoAX4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675696001; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NXZtz6drXmu5S9m5FeMIml4zOVj2zvdZ6JoGmNfyPl4=; b=hMxm3egKZI8OGcPg4wOPzKQVUvKFu94i21/lG+PXN3Dn8JZMpn3gu5/s/fWgr6zUa0/XBI UnR+zT3Cc4eGSVTQCUsNrKzl4msxwO5Q/AjIY8Dk/ZfzkkVOkEmvnu7+WmNWJMu5TSqPe4 PtW6HzLW3PMWRYmc0dvN8BErZCLqNkY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675696001; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NXZtz6drXmu5S9m5FeMIml4zOVj2zvdZ6JoGmNfyPl4=; b=MX5ipKjeN2j3tesA5jEfuLfPHI0RrHEVkNA4iLx3Io21GJDJvyf1TKVS4Iz5Iu76RVwtuG UV8MDM5Y/Lt2nPBQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PATCH 11/12] tests/qtest: bios-tables-test: Skip if missing configs Date: Mon, 6 Feb 2023 12:04:15 -0300 Message-Id: <20230206150416.4604-12-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=2001:67c:2178:6::1d; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675697305239100003 Content-Type: text/plain; charset="utf-8" If we build with --without-default-devices, CONFIG_HPET and CONFIG_PARALLEL are set to N, which makes the respective devices go missing from acpi tables. Signed-off-by: Fabiano Rosas Reviewed-by: Thomas Huth --- I currently don't see a way of allowing the tests to pass in the absence of these two configs. As far as I understand, we would need to have one set of expected table files (tests/data/acpi) for each combination of machine vs. possible CONFIG that can be toggled. Any ideas? --- tests/qtest/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index a930706a43..2829eda2c9 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -78,7 +78,9 @@ qtests_i386 =3D \ config_all_devices.has_key('CONFIG_Q35') and = \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and = \ slirp.found() ? ['virtio-net-failover'] : []) + = \ - (unpack_edk2_blobs ? ['bios-tables-test'] : []) + = \ + (unpack_edk2_blobs and = \ + config_all_devices.has_key('CONFIG_HPET') and = \ + config_all_devices.has_key('CONFIG_PARALLEL') ? ['bios-tables-test'] : = []) + \ qtests_pci + = \ qtests_cxl + = \ ['fdc-test', --=20 2.35.3 From nobody Fri May 17 03:54:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1675697033; cv=none; d=zohomail.com; s=zohoarc; b=JKL5kGZwcp+395IYXBs9tdPsFzC7sER6gHg75KL1xgr3FaCzJWNRQHsrzSRCpNuva2kFac4tqvLtNgI1KtYpWw6TXGXeMKv/m869g+oUXaUkvwNw8TF9a9BjvqX9ryVaj71AAx4AuZ+F7sCdGzLK6uOSmVNMNCB7I1+i/GQLaPI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675697033; h=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=iV4D1SZmdiSkiFhOYrzlFFCeUDfheBMubmsqJ6Gm/DE=; b=ZQy8T8meMn0vHKZGvaDWLtkopyHgH1sZaA3fNiYrqIQQk/etCzTnU9X5rdy03IhfknTXW+814qfHOgALVktMhPWQmXnPFR64HP92gUl/Dh78JNRKjCAcr+00aPU3rYSIdIeDLw68pDnOuugZipoUcZCpepxPJadZ+YRLi3Ly4AU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675697033287680.2340776784838; Mon, 6 Feb 2023 07:23:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP350-0004Fx-Nb; Mon, 06 Feb 2023 10:06:50 -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 1pP34x-0004Bu-KG for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:47 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP34u-0008St-LW for qemu-devel@nongnu.org; Mon, 06 Feb 2023 10:06:47 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 80BC5605F1; Mon, 6 Feb 2023 15:06:43 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 301EE138E8; Mon, 6 Feb 2023 15:06:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6MtNOoEX4WPSXwAAMHmgww (envelope-from ); Mon, 06 Feb 2023 15:06:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675696003; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iV4D1SZmdiSkiFhOYrzlFFCeUDfheBMubmsqJ6Gm/DE=; b=jKzqR3/oNpAKJQs9btsXp0CB2+P9mElBkolpxt2TjfUMk5jEeY0104++CqRgFjgeqMW6fQ gLAZN7Vy5PMoFyJSZ4ChqeEh+bwx5aYH1hHEGeQS/HgFX1As/FYMJqbPaudB8jYp5ny97e ZRowQvYCjEjLIGgjRpLnc5Y7ZxoSd0s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675696003; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iV4D1SZmdiSkiFhOYrzlFFCeUDfheBMubmsqJ6Gm/DE=; b=QWRlwW4y3sOk2RBStvfRbBeN+S7fgRxSxiHVFOQHiBxRxzbGRB5xT91zeXoZMjwbJfJ3+r R/g9jztUhFgPRNBg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PATCH 12/12] [NOT FOR MERGE] tests/qtest: Introduce qtest_validate_args Date: Mon, 6 Feb 2023 12:04:16 -0300 Message-Id: <20230206150416.4604-13-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230206150416.4604-1-farosas@suse.de> References: <20230206150416.4604-1-farosas@suse.de> MIME-Version: 1.0 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=195.135.220.29; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1675697034308100002 Content-Type: text/plain; charset="utf-8" The QEMU binary can be built with a varied set of features/devices which are opaque to the tests. Add a centralized point for parsing and validating the command line. Tests can now be skipped with the following pattern: qts =3D qtest_init(args); if (!qts) { return; } For now, the only validation is that the -device options all correspond to devices that are actually present in the build. Signed-off-by: Fabiano Rosas --- Would this be better than checking for missing devices in individual tests? --- tests/qtest/libqtest.c | 137 ++++++++++++++++++++++++++++++++++++++++- tests/qtest/libqtest.h | 12 ++++ 2 files changed, 148 insertions(+), 1 deletion(-) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index d658222a19..7920fd1506 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -479,10 +479,145 @@ QTestState *qtest_init_without_qmp_handshake(const c= har *extra_args) return s; } =20 +enum qemu_options { + DEVICE =3D G_TOKEN_LAST + 1, + DRIVER =3D G_TOKEN_LAST + 2, +}; + +static void _add_option(GHashTable *ht, const char *key, const char *val) +{ + GList *list =3D g_hash_table_lookup(ht, key); + + if (!list) { + list =3D g_list_append(list, g_strdup(val)); + g_hash_table_insert(ht, g_strdup(key), list); + } else { + list =3D g_list_append(list, g_strdup(val)); + } +} + +static void _parse_device_json(GHashTable *opts, GScanner *top_scanner) +{ + GScanner *scanner =3D g_scanner_new(top_scanner->config); + gchar *text; + + assert(top_scanner->token =3D=3D G_TOKEN_STRING); + text =3D g_strdup(top_scanner->value.v_string); + + g_scanner_scope_add_symbol(scanner, 0, "driver", GINT_TO_POINTER(DRIVE= R)); + g_scanner_input_text(scanner, text, strlen(text)); + + do { + g_scanner_get_next_token(scanner); + switch ((enum qemu_options)scanner->token) { + case DRIVER: + /* -device "{'driver':'dev' */ + g_scanner_get_next_token(scanner); + + switch (scanner->token) { + case G_TOKEN_IDENTIFIER: + _add_option(opts, "devices", scanner->value.v_string); + break; + + default: /* invalid */ + _add_option(opts, "devices", NULL); + } + break; + default: + break; + } + g_scanner_peek_next_token(scanner); + } while (scanner->next_token !=3D G_TOKEN_EOF && + scanner->next_token !=3D G_TOKEN_ERROR); + + g_scanner_destroy(scanner); + g_free(text); +} + +static void qtest_parse_args(GHashTable *opts, const char *args) +{ + GScanner *scanner =3D g_scanner_new(NULL); + + scanner->input_name =3D "qtest args"; + scanner->config->symbol_2_token =3D 1; + scanner->config->scan_float =3D 0; + scanner->config->scan_string_sq =3D 0; + scanner->config->cset_skip_characters =3D g_strdup(" \t\n':"); + scanner->config->cset_identifier_first =3D g_strdup("-" G_CSET_a_2_z + G_CSET_A_2_Z + G_CSET_DIGITS), + scanner->config->cset_identifier_nth =3D g_strdup("-_." G_CSET_a_2_z + G_CSET_A_2_Z G_CSET_DI= GITS), + + g_scanner_scope_add_symbol(scanner, 0, "-device", GINT_TO_POINTER(DEVI= CE)); + + g_scanner_input_text(scanner, args, strlen(args)); + + do { + g_scanner_get_next_token(scanner); + + switch ((enum qemu_options)scanner->token) { + case DEVICE: + g_scanner_get_next_token(scanner); + + switch (scanner->token) { + case G_TOKEN_IDENTIFIER: /* -device dev */ + _add_option(opts, "devices", scanner->value.v_string); + break; + + case G_TOKEN_STRING: /* -device "{'driver':'dev' */ + _parse_device_json(opts, scanner); + break; + + default: /* invalid */ + _add_option(opts, "devices", NULL); + } + break; + default: + break; + } + g_scanner_peek_next_token(scanner); + } while (scanner->next_token !=3D G_TOKEN_EOF && + scanner->next_token !=3D G_TOKEN_ERROR); + + g_scanner_destroy(scanner); +} + +bool qtest_validate_args(const char *args, char **msg) +{ + GHashTable *opts =3D g_hash_table_new(g_str_hash, g_str_equal); + GList *l; + bool rc =3D true; + + qtest_parse_args(opts, args); + + for (l =3D g_hash_table_lookup(opts, "devices"); l !=3D NULL; l =3D l-= >next) { + if (!l->data || !qtest_has_device(l->data)) { + *msg =3D g_strdup_printf("Device %s is not available", + (char *)l->data); + rc =3D false; + break; + } + } + g_hash_table_unref(opts); + return rc; +} + QTestState *qtest_init(const char *extra_args) { - QTestState *s =3D qtest_init_without_qmp_handshake(extra_args); + QTestState *s; QDict *greeting; +/* + * char *err_msg; + * + * if (!qtest_validate_args(extra_args, &err_msg)) { + * g_test_skip(err_msg); + * g_free(err_msg); + * + * return NULL; + * } + */ + s =3D qtest_init_without_qmp_handshake(extra_args); =20 /* Read the QMP greeting and then do the handshake */ greeting =3D qtest_qmp_receive(s); diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h index fcf1c3c3b3..01a07c448a 100644 --- a/tests/qtest/libqtest.h +++ b/tests/qtest/libqtest.h @@ -832,4 +832,16 @@ void qtest_qom_set_bool(QTestState *s, const char *pat= h, const char *property, * Returns: Value retrieved from property. */ bool qtest_qom_get_bool(QTestState *s, const char *path, const char *prope= rty); + +/** + * qtest_validate_args: + * @args: arguments to validate, exactly as they would be passed + * into qtest_init. + * @err_msg: String with the reason for the failure, if any. + * + * Validates the command line (args) for options that are incompatible + * with the current QEMU build. + */ +bool qtest_validate_args(const char *args, char **err_msg); + #endif --=20 2.35.3