summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/mkdir.cc
diff options
context:
space:
mode:
authorAyush Ranjan <ayushranjan@google.com>2020-09-08 17:54:13 -0700
committergVisor bot <gvisor-bot@google.com>2020-09-08 17:56:22 -0700
commitbca4d99a4bdeab0f7ef15ba39e64a54ce5b4485d (patch)
treeb3a65aad836353a054b359e4cc2141f0801959de /test/syscalls/linux/mkdir.cc
parenta17d083f3b6a5dbd122144d731fdda088974c39c (diff)
[vfs] overlayfs: Fix socket tests.
- BindSocketThenOpen test was expecting the incorrect error when opening a socket. Fixed that. - VirtualFilesystem.BindEndpointAt should not require pop.Path.Begin.Ok() because the filesystem implementations do not need to walk to the parent dentry. This check also exists for MknodAt, MkdirAt, RmdirAt, SymlinkAt and UnlinkAt but those filesystem implementations also need to walk to the parent denty. So that check is valid. Added some syscall tests to test this. PiperOrigin-RevId: 330625220
Diffstat (limited to 'test/syscalls/linux/mkdir.cc')
-rw-r--r--test/syscalls/linux/mkdir.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/syscalls/linux/mkdir.cc b/test/syscalls/linux/mkdir.cc
index 4036a9275..27758203d 100644
--- a/test/syscalls/linux/mkdir.cc
+++ b/test/syscalls/linux/mkdir.cc
@@ -82,6 +82,13 @@ TEST_F(MkdirTest, FailsOnDirWithoutWritePerms) {
SyscallFailsWithErrno(EACCES));
}
+TEST_F(MkdirTest, MkdirAtEmptyPath) {
+ ASSERT_THAT(mkdir(dirname_.c_str(), 0777), SyscallSucceeds());
+ auto fd =
+ ASSERT_NO_ERRNO_AND_VALUE(Open(dirname_, O_RDONLY | O_DIRECTORY, 0666));
+ EXPECT_THAT(mkdirat(fd.get(), "", 0777), SyscallFailsWithErrno(ENOENT));
+}
+
} // namespace
} // namespace testing