From 6fa772a88eb10bdd521ab25ff8a7045e703becb7 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Mon, 17 Jun 2019 17:17:01 +0000 Subject: fusefs: skip the Write.mmap test when mmap is not available fusefs doesn't not allow mmap when data caching is disabled. Sponsored by: The FreeBSD Foundation --- tests/sys/fs/fusefs/write.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/sys/fs/fusefs/write.cc b/tests/sys/fs/fusefs/write.cc index 983c93d38eb0b..a35cf0d9ae8a8 100644 --- a/tests/sys/fs/fusefs/write.cc +++ b/tests/sys/fs/fusefs/write.cc @@ -92,6 +92,23 @@ void expect_write(uint64_t ino, uint64_t offset, uint64_t isize, }; +class WriteCacheable: public Write { +public: +virtual void SetUp() { + const char *node = "vfs.fusefs.data_cache_mode"; + int val = 0; + size_t size = sizeof(val); + + FuseTest::SetUp(); + + ASSERT_EQ(0, sysctlbyname(node, &val, &size, NULL, 0)) + << strerror(errno); + if (val == 0) + GTEST_SKIP() << + "fusefs data caching must be enabled for this test"; +} +}; + sig_atomic_t Write::s_sigxfsz = 0; class Write_7_8: public FuseTest { @@ -483,8 +500,7 @@ TEST_F(Write, rlimit_fsize) * write, then it must set the FUSE_WRITE_CACHE bit */ /* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236378 */ -// TODO: check vfs.fusefs.mmap_enable -TEST_F(Write, mmap) +TEST_F(WriteCacheable, mmap) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; -- cgit v1.3