From nobody Mon Feb 9 19:10:42 2026 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=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1647339893; cv=none; d=zohomail.com; s=zohoarc; b=bkaYcn3K9Q4gnhi0fNH9BVq6rVEBQnLrCPPs8nCz6hYpF2NYw4L48zRE8xblxqINTj+qDjALsDGck8PYqON29+tjVoESG8rs742RgDBMTfSSBEtBKN+ZvK/GAtOygwFppSbPxMnDemOOsqVnKLdSdbiqhwjbvxDYol0uPYtflIE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647339893; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=QcPvQB5Np+omQPMUL4Wk5kc4YffCR5KElek87QyXqz8=; b=isVtCtmYIVo+0V/rOqhZbA3ANCdBgVcA36uOdHKkHUeJ4/NzDpVm0jrgAudihcQxE2PtNWfOk4mhQ+wl1Tk/xtI529t9JJIVWaz7DjeDCkEziZ+k4DB1bjEML3b2h1/qcuYocAMvoMCV5pJ9JB1WWk27xA6CqAxL7HTHQVvq7IM= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647339893483335.08963148520047; Tue, 15 Mar 2022 03:24:53 -0700 (PDT) Received: from localhost ([::1]:46868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU4MG-0000vy-Fx for importer@patchew.org; Tue, 15 Mar 2022 06:24:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <1f5aa50ace3ba3861ea31e8888367518282065a6@lizzy.crudebyte.com>) id 1nU4KG-0006WR-Lh for qemu-devel@nongnu.org; Tue, 15 Mar 2022 06:22:48 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:51837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <1f5aa50ace3ba3861ea31e8888367518282065a6@lizzy.crudebyte.com>) id 1nU4KF-0004FW-3c for qemu-devel@nongnu.org; Tue, 15 Mar 2022 06:22:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=QcPvQB5Np+omQPMUL4Wk5kc4YffCR5KElek87QyXqz8=; b=jkqFg wv0dpnskaUK6Wh7HD4HmT2usJ/0c1ftpnn0xa/V+6UoTg8y81/mHSJdvgnMUkgqhyqoNgykarR6Vm NdM2F5YQe/baYom/xbRS4cGHdG4xGDKv/2asO7vkN/AWMukzBeFoNDNLON40X+IFL90Ufs0boVWP3 ymREP2QCzkc7pE1cepVrI4w9PppypTICW31w1OzKuWrESmu3sgj4wR7kxSuLLLkV7ElYMLb5aRN8E 6cpqLrTTo7lcdMJtsjxdz7DRrWFygORz2yobMh2ComIltlK3uUmFZhs7URG2x9kvDEZGXIpIFqQCa 8GwIr7CQGV3vDQSl3iNWMv67+XpgA==; Message-Id: <1f5aa50ace3ba3861ea31e8888367518282065a6.1647339025.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Tue, 15 Mar 2022 11:08:30 +0100 Subject: [PATCH v4 1/7] tests/9pfs: walk to non-existent dir To: qemu-devel@nongnu.org Cc: Greg Kurz 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: none client-ip=91.194.90.13; envelope-from=1f5aa50ace3ba3861ea31e8888367518282065a6@lizzy.crudebyte.com; helo=lizzy.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1647339895785100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Expect ENOENT Rlerror response when trying to walk to a non-existent directory. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Based-on: --- tests/qtest/virtio-9p-test.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index 01ca076afe..22bdd74bc1 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -606,6 +606,25 @@ static uint32_t do_walk(QVirtio9P *v9p, const char *pa= th) return fid; } =20 +/* utility function: walk to requested dir and expect passed error respons= e */ +static void do_walk_expect_error(QVirtio9P *v9p, const char *path, uint32_= t err) +{ + char **wnames; + P9Req *req; + uint32_t _err; + const uint32_t fid =3D genfid(); + + int nwnames =3D split(path, "/", &wnames); + + req =3D v9fs_twalk(v9p, 0, fid, nwnames, wnames, 0); + v9fs_req_wait_for_reply(req, NULL); + v9fs_rlerror(req, &_err); + + g_assert_cmpint(_err, =3D=3D, err); + + split_free(&wnames); +} + static void fs_version(void *obj, void *data, QGuestAllocator *t_alloc) { alloc =3D t_alloc; @@ -974,6 +993,15 @@ static void fs_walk_no_slash(void *obj, void *data, QG= uestAllocator *t_alloc) g_free(wnames[0]); } =20 +static void fs_walk_nonexistent(void *obj, void *data, QGuestAllocator *t_= alloc) +{ + QVirtio9P *v9p =3D obj; + alloc =3D t_alloc; + + do_attach(v9p); + do_walk_expect_error(v9p, "non-existent", ENOENT); +} + static void fs_walk_dotdot(void *obj, void *data, QGuestAllocator *t_alloc) { QVirtio9P *v9p =3D obj; @@ -1409,6 +1437,8 @@ static void register_virtio_9p_test(void) &opts); qos_add_test("synth/walk/dotdot_from_root", "virtio-9p", fs_walk_dotdot, &opts); + qos_add_test("synth/walk/non_existent", "virtio-9p", fs_walk_nonexiste= nt, + &opts); qos_add_test("synth/lopen/basic", "virtio-9p", fs_lopen, &opts); qos_add_test("synth/write/basic", "virtio-9p", fs_write, &opts); qos_add_test("synth/flush/success", "virtio-9p", fs_flush_success, --=20 2.30.2