From nobody Sun May 19 15:30:29 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1711807787; cv=none; d=zohomail.com; s=zohoarc; b=ltiu2vFlG0wyN1JhhK7MzfnJOAKDfTZMi1QF92+KqK0oxprly4Cus28RwqP3SDNLZNCC+5xkFO/+/LX5UIL5mwGCHnudKkIGJJMI50G6w2V01WzKrMZQw/Ufjxb0EjDnayFZag4EWAd9Uf0LUwGda9F+dTV+UCY8A9E79B9Yf/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711807787; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=p4yWR2jE1drMam6OIg84j1pNMI843XpHqUbHzG+tZj4=; b=CDr0GavgVMhyiC1qbriguqHaD+kvDgUgz6icNH8aOt5Bugf62c3AP5822ZQDI0cqoD6P3aJGDtK23cGGu2jR3XSm1AOAiAfSUYsYXYQH3lNg79g3nKmIMDapoi9HVwTQ55yPzLU9VjVZExvSROPdUXGFmcRuRJzNEpEFguHc5wk= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711807787570409.32411807453093; Sat, 30 Mar 2024 07:09:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqZOM-0001qA-D5; Sat, 30 Mar 2024 10:09:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <981eb1060336ee0e371369088c55f81f5a577ce8@kylie.crudebyte.com>) id 1rqZOL-0001pw-9D for qemu-devel@nongnu.org; Sat, 30 Mar 2024 10:09:05 -0400 Received: from kylie.crudebyte.com ([5.189.157.229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <981eb1060336ee0e371369088c55f81f5a577ce8@kylie.crudebyte.com>) id 1rqZOJ-0000KS-OZ for qemu-devel@nongnu.org; Sat, 30 Mar 2024 10:09:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=p4yWR2jE1drMam6OIg84j1pNMI843XpHqUbHzG+tZj4=; b=VnOry nrYHe8uS9xo4QczFv29vZTdhlhgxOnTtQdcJQTlc0Ck9MGf3g16O0pi9G+v3hYM4C0LOzhXqukK7l aKS7XJ89rTGb0P4cuglh00izgpjFLENmWLlZNYJr3uwB+kZe0NVr93fJp5Tvx9JN3Ey1S4+9mTw9p I+RTXuHypkFd0CA6Vgxr+mNLS9sup5g98w+JccfP4p0nM+NLTn6JTUU9yUmhsvLT40E4DppyCeqT/ Qw4ts6KOOHtBqlkGeA8WgsmqftUtA0v/AEyh8fPxQh+/4/dwy4sSWiM9qJcTLn5p0pTPgc8OGQ86c ppGAj6XgHuopqJNUnigmpb0mtHAIy1oGChx69F9LablJ09hjRxKAbYU7Rh0kMKmeJQb04qbYKE8i9 Gs0Lr3LMm/JRfWJlhKLo48zF3yq5EKy5cfOWv4GG+LxmuseHWc2Ug/dyxNsI5Y1nRC4sV6akwcJKY s2GMUuImmtBdMtdxQ+F/4PxXGDE9rb+59B2wwXaAkAcPWuVnRs25I971tYJ8cRhiTotkis0clCl0G 2Bz39nVNRj+Qz7TL8TLn5Rr0K7VLE9TkKr0HMh7NZ0lZGPhw7U3qehRBoOFzSKT42Y6V+K6AHvAtF 9viH+V2sMTov6xX4HK2C4j0BoyMtU8VrtXdSCCOmIt+mAdM3pvnM2jnAr5S4pY=; Message-Id: <981eb1060336ee0e371369088c55f81f5a577ce8.1711702001.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Sat, 30 Mar 2024 14:33:03 +0100 Subject: [PULL for-9.0 1/2] qtest/virtio-9p-test.c: create/remove temp dirs after each test To: qemu-devel@nongnu.org, Peter Maydell Cc: Greg Kurz , Daniel Henrique Barboza , Thomas Huth 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=5.189.157.229; envelope-from=981eb1060336ee0e371369088c55f81f5a577ce8@kylie.crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1711807790616100006 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Daniel Henrique Barboza The local 9p driver in virtio-9p-test.c its temporary dir right at the start of qos-test (via virtio_9p_create_local_test_dir()) and only deletes it after qos-test is finished (via virtio_9p_remove_local_test_dir()). This means that any qos-test machine that ends up running virtio-9p-test local tests more than once will end up re-using the same temp dir. This is what's happening in [1] after we introduced the riscv machine nodes: if we enable slow tests with the '-m slow' flag using qemu-system-riscv64, this is what happens: - a temp dir is created; - virtio-9p-device tests will run virtio-9p-test successfully; - virtio-9p-pci tests will run virtio-9p-test, and fail right at the first slow test at fs_create_dir() because the "01" file was already created by fs_create_dir() test when running with the virtio-9p-device. The root cause is that we're creating a single temporary dir, via the construct/destruct callbacks, and this temp dir is kept for the entire qos-test run. We can change each test to clean after themselves. This approach would make the 'create' tests obsolete since we would need to create and delete dirs/files/symlinks for the cleanup, turning them into the 'unlinkat' tests that comes right after. We chose a different approach that handles the root cause: do not use constructor/destructor to create the temp dir. Create one temp dir for each test, and remove it after the test is complete. This is the approach taken for other qtests like vhost-user-test.c where each test requires a setup() and a subsequent cleanup(), all of those instantiated in the .before callback. [1] https://mail.gnu.org/archive/html/qemu-devel/2024-03/msg05807.html Reported-by: Thomas Huth Signed-off-by: Daniel Henrique Barboza Message-Id: <20240327142011.805728-2-dbarboza@ventanamicro.com> Reviewed-by: Greg Kurz Reviewed-by: Christian Schoenebeck Tested-by: Thomas Huth Signed-off-by: Christian Schoenebeck --- tests/qtest/virtio-9p-test.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index 65e69491e5..0179b3a394 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -693,9 +693,20 @@ static void fs_unlinkat_hardlink(void *obj, void *data, g_assert(stat(real_file, &st_real) =3D=3D 0); } =20 +static void cleanup_9p_local_driver(void *data) +{ + /* remove previously created test dir when test is completed */ + virtio_9p_remove_local_test_dir(); +} + static void *assign_9p_local_driver(GString *cmd_line, void *arg) { + /* make sure test dir for the 'local' tests exists */ + virtio_9p_create_local_test_dir(); + virtio_9p_assign_local_driver(cmd_line, "security_model=3Dmapped-xattr= "); + + g_test_queue_destroy(cleanup_9p_local_driver, NULL); return arg; } =20 @@ -759,15 +770,3 @@ static void register_virtio_9p_test(void) } =20 libqos_init(register_virtio_9p_test); - -static void __attribute__((constructor)) construct_9p_test(void) -{ - /* make sure test dir for the 'local' tests exists */ - virtio_9p_create_local_test_dir(); -} - -static void __attribute__((destructor)) destruct_9p_test(void) -{ - /* remove previously created test dir when test suite completed */ - virtio_9p_remove_local_test_dir(); -} --=20 2.30.2 From nobody Sun May 19 15:30:29 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1711807795; cv=none; d=zohomail.com; s=zohoarc; b=OM2UDTAtfNtc63ksPczN0sSC0/4WORseEyBxQlQuWEU+PSbsiR4Al4NDBs+h+ihLAJCCmLU5bRvuypVmxDZNH/pk4054GVtoMdSoC3IDevVlfzURT0WhMr1TEJxol8rCVyH8gyUMfovOJXNDK/5jnLCp1dGZAA4HJW9lpqzfROY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711807795; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CKxpSnGumg2HQUjOvfXHdXAFz/Bc3upBTPoFzaGQN2o=; b=FNkta071wowVQPILnxyXLOjOceSw6jolta5SovUYJUfCR8UonvCDEG2oE61w+7nP/j0kYKn+TyhmXXlkpI85IikVyWF/zef0/erSPry1QTpREZeO11ceUgqwy21Q1GkT/UOpfIwhxWJeMvkM7YuF7Jm6h20tO8y65mOWtygDMic= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711807795888839.9533295447403; Sat, 30 Mar 2024 07:09:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqZOK-0001pf-8E; Sat, 30 Mar 2024 10:09:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqZOI-0001pW-Qw for qemu-devel@nongnu.org; Sat, 30 Mar 2024 10:09:02 -0400 Received: from kylie.crudebyte.com ([5.189.157.229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqZOH-0000I8-25 for qemu-devel@nongnu.org; Sat, 30 Mar 2024 10:09:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=CKxpSnGumg2HQUjOvfXHdXAFz/Bc3upBTPoFzaGQN2o=; b=UzMjv 282AtLVtYGXwZ8hLrbuFEGN/Y2qooLBORSPfDO+7OvPI1pkK5yrioJrL52UWWB9IXBcuksCdGu66B ye9OLMF3dYwZO2ErrBCSJG05qWmjiBcsYBSdTErpc7C8nblMkML5i4qTbhUspTsZVbs6CAsfFtAlA JnEU1O8PZvsOOMf1Oy9shoLN8sktKASwzvBmTtKW6sDJB/ur94RpFmEyLU3Liq70hVeU2iIWBJ2Tp Qo+FPN/DUI1TMZ9B4OAGn0hbsJMTNjIWT8umY/9TX/d658Y5QRMlmLfzLUjcTgX+8hwRsrBawCn4r /FZCNWz2SxidxdMZHDfvZpsRh2NsBLNHLPR68IB7dyXQfFLjMB+Q5kvV+6ZyUX90ZT7iBYQFCG0aK DIEU+mYrr3MxfCuE0IRl+7cj3Tc2oX5AiadCk4YpQ3sBJV5ORl5DEObAJa1iXzO0832LClLQGhKyL zdpQUrhnWKhs2jEFpAAPDP9aegG49f3KynoUXbdTP3q51/Gq4fmwSQcB18/IB/WRBHPHCuuRGGa5w DDIpajuq+kRplGRm9MTpx1gVQ1qAIk467P/InmPp89nuP9K7xSP7QKLb0yQdlGJnFW+NqJ7FYsI7m VrU0iyR/vAtCKnRxAi4dY8UHlZ0a54wHR6r0Grx+ou31a+FnuLgYtPlc4OwiV0=; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Sat, 30 Mar 2024 14:33:03 +0100 Subject: [PULL for-9.0 2/2] qtest/virtio-9p-test.c: remove g_test_slow() gate To: qemu-devel@nongnu.org, Peter Maydell Cc: Greg Kurz , Daniel Henrique Barboza , Thomas Huth 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=5.189.157.229; envelope-from=dcae75fba1084823d0fc87caa13f0ba6f32155f3@kylie.crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1711807797903100003 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Daniel Henrique Barboza Commit 558f5c42ef gated the local tests with g_test_slow() to skip them in 'make check'. The reported issue back then was this following CI problem: https://lists.nongnu.org/archive/html/qemu-devel/2020-11/msg05510.html This problem ended up being fixed after it was detected with the recently added risc-v machine nodes [1]. virtio-9p-test.c is now creating and removing temporary dirs for each test run, instead of creating a single dir for the entire qos-test scope. We're now able to run these tests with 'make check' in the CI, so let's go ahead and re-enable them. This reverts commit 558f5c42efded3e0d0b20a90bce2a9a14580d824. [1] https://mail.gnu.org/archive/html/qemu-devel/2024-03/msg05807.html Signed-off-by: Daniel Henrique Barboza Message-Id: <20240327142011.805728-3-dbarboza@ventanamicro.com> Reviewed-by: Greg Kurz Reviewed-by: Christian Schoenebeck Tested-by: Thomas Huth Signed-off-by: Christian Schoenebeck --- tests/qtest/virtio-9p-test.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index 0179b3a394..3c8cd235cf 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -746,15 +746,6 @@ static void register_virtio_9p_test(void) =20 =20 /* 9pfs test cases using the 'local' filesystem driver */ - - /* - * XXX: Until we are sure that these tests can run everywhere, - * keep them as "slow" so that they aren't run with "make check". - */ - if (!g_test_slow()) { - return; - } - opts.before =3D assign_9p_local_driver; qos_add_test("local/config", "virtio-9p", pci_config, &opts); qos_add_test("local/create_dir", "virtio-9p", fs_create_dir, &opts); --=20 2.30.2