diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-07-23 16:34:09 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-23 16:34:09 -0700 |
commit | 5e34ee68c93888eba3d56a2b713dbeebf406efa3 (patch) | |
tree | 85cd3b1bc8854d893e74e12788fe02ecbe8e7675 /test/syscalls/linux/dev.cc | |
parent | 8fed97794edcbaa7069dbd39604030e4fbb6891c (diff) | |
parent | 2f78c487f17e12dfee08214311c500073cb03fde (diff) |
Merge pull request #3024 from ridwanmsharif:ridwanmsharif/fuse-stub-impl
PiperOrigin-RevId: 322890087
Diffstat (limited to 'test/syscalls/linux/dev.cc')
-rw-r--r-- | test/syscalls/linux/dev.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/syscalls/linux/dev.cc b/test/syscalls/linux/dev.cc index 6fa16208e..1d0d584cd 100644 --- a/test/syscalls/linux/dev.cc +++ b/test/syscalls/linux/dev.cc @@ -161,6 +161,19 @@ 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 |