From owner-dev-commits-src-all@freebsd.org Fri Jan 1 17:20:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07F554CE983; Fri, 1 Jan 2021 17:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D6sGT6sTZz3MJ8; Fri, 1 Jan 2021 17:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA24D264DE; Fri, 1 Jan 2021 17:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 101HK1dJ090089; Fri, 1 Jan 2021 17:20:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 101HK10L090087; Fri, 1 Jan 2021 17:20:01 GMT (envelope-from git) Date: Fri, 1 Jan 2021 17:20:01 GMT Message-Id: <202101011720.101HK10L090087@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: ae39db74066a - main - fusefs: fix an expectation in one of the tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae39db74066a0ff1682c1c841be030099d9d4557 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jan 2021 17:20:02 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=ae39db74066a0ff1682c1c841be030099d9d4557 commit ae39db74066a0ff1682c1c841be030099d9d4557 Author: Alan Somers AuthorDate: 2020-12-29 17:48:34 +0000 Commit: Alan Somers CommitDate: 2021-01-01 17:18:22 +0000 fusefs: fix an expectation in one of the tests An order-of-operations problem caused an expectation intended for FUSE_READ to instead match FUSE_ACCESS. Surprisingly, only one test case was affected. MFC after: 2 weeks Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D27818 --- tests/sys/fs/fusefs/utils.cc | 4 ++-- tests/sys/fs/fusefs/write.cc | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/sys/fs/fusefs/utils.cc b/tests/sys/fs/fusefs/utils.cc index 7e9b97c2f228..4b59f6e26e12 100644 --- a/tests/sys/fs/fusefs/utils.cc +++ b/tests/sys/fs/fusefs/utils.cc @@ -376,10 +376,10 @@ void FuseTest::expect_read(uint64_t ino, uint64_t offset, uint64_t isize, in.body.read.fh == FH && in.body.read.offset == offset && in.body.read.size == isize && - flags == -1 ? + (flags == -1 ? (in.body.read.flags == O_RDONLY || in.body.read.flags == O_RDWR) - : in.body.read.flags == (uint32_t)flags); + : in.body.read.flags == (uint32_t)flags)); }, Eq(true)), _) ).WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { diff --git a/tests/sys/fs/fusefs/write.cc b/tests/sys/fs/fusefs/write.cc index 78d82805470f..7529b76847d7 100644 --- a/tests/sys/fs/fusefs/write.cc +++ b/tests/sys/fs/fusefs/write.cc @@ -508,7 +508,7 @@ TEST_F(Write, eof_during_rmw) const char *INITIAL = "XXXXXXXXXX"; uint64_t ino = 42; uint64_t offset = 1; - ssize_t bufsize = strlen(CONTENTS); + ssize_t bufsize = strlen(CONTENTS) + 1; off_t orig_fsize = 10; off_t truncated_fsize = 5; off_t final_fsize = bufsize; @@ -517,8 +517,6 @@ TEST_F(Write, eof_during_rmw) FuseTest::expect_lookup(RELPATH, ino, S_IFREG | 0644, orig_fsize, 1); expect_open(ino, 0, 1); expect_read(ino, 0, orig_fsize, truncated_fsize, INITIAL, O_RDWR); - expect_getattr(ino, truncated_fsize); - expect_read(ino, 0, final_fsize, final_fsize, INITIAL, O_RDWR); maybe_expect_write(ino, offset, bufsize, CONTENTS); fd = open(FULLPATH, O_RDWR);