From 2828806fb015bbbec0f4a48670d1eb048f21099a Mon Sep 17 00:00:00 2001 From: Ridwan Sharif Date: Tue, 23 Jun 2020 14:25:38 -0400 Subject: Test that the fuse device can be opened --- test/syscalls/linux/dev.cc | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'test/syscalls/linux') diff --git a/test/syscalls/linux/dev.cc b/test/syscalls/linux/dev.cc index 6be173c14..3c88c4cbd 100644 --- a/test/syscalls/linux/dev.cc +++ b/test/syscalls/linux/dev.cc @@ -146,34 +146,21 @@ TEST(DevTest, WriteDevFull) { EXPECT_THAT(WriteFd(fd.get(), "a", 1), SyscallFailsWithErrno(ENOSPC)); } -TEST(DevTest, ReadDevFuse) { - SKIP_IF(IsRunningWithVFS1()); - - const FileDescriptor fd = - ASSERT_NO_ERRNO_AND_VALUE(Open("/dev/fuse", O_RDONLY)); - std::vector buf(1); - EXPECT_THAT(ReadFd(fd.get(), buf.data(), sizeof(buf)), SyscallFailsWithErrno(ENOSYS)); -} - -TEST(DevTest, WriteDevFuse) { - SKIP_IF(IsRunningWithVFS1()); - - const FileDescriptor fd = - ASSERT_NO_ERRNO_AND_VALUE(Open("/dev/fuse", O_WRONLY)); - const char* testStr = "test"; - EXPECT_THAT(WriteFd(fd.get(), testStr, sizeof(testStr)), SyscallFailsWithErrno(ENOSYS)); -} - TEST(DevTest, TTYExists) { - // Run test if running on VFS1 or on Linux. - SKIP_IF(!IsRunningWithVFS1() && IsRunningOnGvisor()); - struct stat statbuf = {}; ASSERT_THAT(stat("/dev/tty", &statbuf), SyscallSucceeds()); // Check that it's a character device with rw-rw-rw- permissions. EXPECT_EQ(statbuf.st_mode, S_IFCHR | 0666); } +TEST(DevTest, OpenDevFuse) { + // Note(gvisor.dev/issue/3076) This won't work in the sentry until the new + // device registration is complete. + SKIP_IF(IsRunningWithVFS1() || IsRunningOnGvisor()); + + ASSERT_NO_ERRNO_AND_VALUE(Open("/dev/fuse", O_RDONLY)); +} + } // namespace } // namespace testing -- cgit v1.2.3