summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/dev.cc
diff options
context:
space:
mode:
authorRidwan Sharif <ridwanmsharif@google.com>2020-06-09 12:35:39 -0400
committerRidwan Sharif <ridwanmsharif@google.com>2020-07-23 17:13:24 -0400
commit3e0e3b9b11fee58835a0a492d66e72b354459e27 (patch)
treeb34c4e927c51f6ba074bde5f1c451a36c5b8f0c6 /test/syscalls/linux/dev.cc
parent15da310efaad5574ca7b0fe03cb76919fdffc5ce (diff)
Added stub FUSE filesystem
Allow FUSE filesystems to be mounted using libfuse. The appropriate flags and mount options are parsed and understood by fusefs.
Diffstat (limited to 'test/syscalls/linux/dev.cc')
-rw-r--r--test/syscalls/linux/dev.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/syscalls/linux/dev.cc b/test/syscalls/linux/dev.cc
index 6fa16208e..69e8b76d3 100644
--- a/test/syscalls/linux/dev.cc
+++ b/test/syscalls/linux/dev.cc
@@ -161,6 +161,18 @@ TEST(DevTest, OpenDevFuse) {
ASSERT_NO_ERRNO_AND_VALUE(Open("/dev/fuse", O_RDONLY));
}
+TEST(DevTest, ReadDevFuseWithoutMount) {
+ // Note(gvisor.dev/issue/3076) This won't work in the sentry until the new
+ // device registration is complete.
+ SKIP_IF(IsRunningWithVFS1() || IsRunningOnGvisor());
+
+ const FileDescriptor fd =
+ ASSERT_NO_ERRNO_AND_VALUE(Open("/dev/fuse", O_RDONLY));
+
+ std::vector<char> buf(1);
+ EXPECT_THAT(ReadFd(fd.get(), buf.data(), sizeof(buf)), SyscallFailsWithErrno(EPERM));
+}
+
} // namespace
} // namespace testing