Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jun 2019 17:17:01 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r349149 - projects/fuse2/tests/sys/fs/fusefs
Message-ID:  <201906171717.x5HHH1j2014713@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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";



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906171717.x5HHH1j2014713>