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
This commit is contained in:
Alan Somers 2020-12-29 10:48:34 -07:00 committed by Alan Somers
parent 1d010cd31c
commit ae39db7406
2 changed files with 3 additions and 5 deletions

View File

@ -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) {

View File

@ -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);