svn commit: r349149 - projects/fuse2/tests/sys/fs/fusefs

Alan Somers asomers at FreeBSD.org
Mon Jun 17 17:17:02 UTC 2019


Author: asomers
Date: Mon Jun 17 17:17:01 2019
New Revision: 349149
URL: https://svnweb.freebsd.org/changeset/base/349149

Log:
  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

Modified:
  projects/fuse2/tests/sys/fs/fusefs/write.cc

Modified: projects/fuse2/tests/sys/fs/fusefs/write.cc
==============================================================================
--- projects/fuse2/tests/sys/fs/fusefs/write.cc	Mon Jun 17 16:57:44 2019	(r349148)
+++ projects/fuse2/tests/sys/fs/fusefs/write.cc	Mon Jun 17 17:17:01 2019	(r349149)
@@ -92,6 +92,23 @@ void expect_write(uint64_t ino, uint64_t offset, uint6
 
 };
 
+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";


More information about the svn-src-projects mailing list