fusefs: fix the tests for nondefault values of vfs.maxbcachebuf
Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
0d3a88d76c
commit
6ca3b02b1b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/fuse2/; revision=349384
@ -163,7 +163,7 @@ TEST_F(AioRead, async_read_disabled)
|
|||||||
ssize_t bufsize = 50;
|
ssize_t bufsize = 50;
|
||||||
char buf0[bufsize], buf1[bufsize];
|
char buf0[bufsize], buf1[bufsize];
|
||||||
off_t off0 = 0;
|
off_t off0 = 0;
|
||||||
off_t off1 = 65536;
|
off_t off1 = m_maxbcachebuf;
|
||||||
struct aiocb iocb0, iocb1;
|
struct aiocb iocb0, iocb1;
|
||||||
volatile sig_atomic_t read_count = 0;
|
volatile sig_atomic_t read_count = 0;
|
||||||
|
|
||||||
@ -243,13 +243,14 @@ TEST_F(AsyncRead, async_read)
|
|||||||
ssize_t bufsize = 50;
|
ssize_t bufsize = 50;
|
||||||
char buf0[bufsize], buf1[bufsize];
|
char buf0[bufsize], buf1[bufsize];
|
||||||
off_t off0 = 0;
|
off_t off0 = 0;
|
||||||
off_t off1 = 65536;
|
off_t off1 = m_maxbcachebuf;
|
||||||
|
off_t fsize = 2 * m_maxbcachebuf;
|
||||||
struct aiocb iocb0, iocb1;
|
struct aiocb iocb0, iocb1;
|
||||||
sem_t sem;
|
sem_t sem;
|
||||||
|
|
||||||
ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno);
|
ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno);
|
||||||
|
|
||||||
expect_lookup(RELPATH, ino, 131072);
|
expect_lookup(RELPATH, ino, fsize);
|
||||||
expect_open(ino, 0, 1);
|
expect_open(ino, 0, 1);
|
||||||
EXPECT_CALL(*m_mock, process(
|
EXPECT_CALL(*m_mock, process(
|
||||||
ResultOf([=](auto in) {
|
ResultOf([=](auto in) {
|
||||||
|
@ -235,10 +235,13 @@ public:
|
|||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
if (MAXPHYS < 2 * DFLTPHYS)
|
if (MAXPHYS < 2 * DFLTPHYS)
|
||||||
GTEST_SKIP() << "MAXPHYS must be at least twice DFLTPHYS"
|
GTEST_SKIP() << "MAXPHYS must be at least twice DFLTPHYS"
|
||||||
<< "for this test";
|
<< " for this test";
|
||||||
m_async = true;
|
m_async = true;
|
||||||
m_maxwrite = MAXPHYS;
|
m_maxwrite = MAXPHYS;
|
||||||
WriteBack::SetUp();
|
WriteBack::SetUp();
|
||||||
|
if (MAXPHYS < 2 * m_maxbcachebuf)
|
||||||
|
GTEST_SKIP() << "MAXPHYS must be at least twice maxbcachebuf"
|
||||||
|
<< " for this test";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -619,7 +622,7 @@ TEST_F(WriteThrough, pwrite)
|
|||||||
const char RELPATH[] = "some_file.txt";
|
const char RELPATH[] = "some_file.txt";
|
||||||
const char *CONTENTS = "abcdefgh";
|
const char *CONTENTS = "abcdefgh";
|
||||||
uint64_t ino = 42;
|
uint64_t ino = 42;
|
||||||
uint64_t offset = 65536;
|
uint64_t offset = m_maxbcachebuf;
|
||||||
int fd;
|
int fd;
|
||||||
ssize_t bufsize = strlen(CONTENTS);
|
ssize_t bufsize = strlen(CONTENTS);
|
||||||
|
|
||||||
@ -767,8 +770,8 @@ TEST_F(WriteCluster, clustering)
|
|||||||
uint64_t ino = 42;
|
uint64_t ino = 42;
|
||||||
int i, fd;
|
int i, fd;
|
||||||
void *wbuf, *wbuf2x;
|
void *wbuf, *wbuf2x;
|
||||||
ssize_t bufsize = 65536;
|
ssize_t bufsize = m_maxbcachebuf;
|
||||||
off_t filesize = 327680;
|
off_t filesize = 5 * bufsize;
|
||||||
|
|
||||||
wbuf = malloc(bufsize);
|
wbuf = malloc(bufsize);
|
||||||
ASSERT_NE(NULL, wbuf) << strerror(errno);
|
ASSERT_NE(NULL, wbuf) << strerror(errno);
|
||||||
@ -814,8 +817,8 @@ TEST_F(WriteCluster, DISABLED_cluster_write_err)
|
|||||||
uint64_t ino = 42;
|
uint64_t ino = 42;
|
||||||
int i, fd;
|
int i, fd;
|
||||||
void *wbuf;
|
void *wbuf;
|
||||||
ssize_t bufsize = 65536;
|
ssize_t bufsize = m_maxbcachebuf;
|
||||||
off_t filesize = 262144;
|
off_t filesize = 4 * bufsize;
|
||||||
|
|
||||||
wbuf = malloc(bufsize);
|
wbuf = malloc(bufsize);
|
||||||
ASSERT_NE(NULL, wbuf) << strerror(errno);
|
ASSERT_NE(NULL, wbuf) << strerror(errno);
|
||||||
|
Loading…
Reference in New Issue
Block a user