Remove invalid test case.

The next test case is perfectly valid, which creates a test directory
with appropriate permissions and ensures that you can't create a file.

This test case assumes that the root directory has certain permissions.
In this case, we may have EROFS instead of a permission error, but it's
perfectly plausible that no error occurs at all. The test is not valid.

PiperOrigin-RevId: 345764412
This commit is contained in:
Adin Scannell
2020-12-04 15:11:55 -08:00
committed by gVisor bot
parent 216abfb6df
commit 7a1de8583d
-8
View File
@@ -112,14 +112,6 @@ TEST(CreateTest, CreatFileWithOTruncAndReadOnly) {
ASSERT_THAT(close(dirfd), SyscallSucceeds());
}
TEST(CreateTest, CreateFailsOnUnpermittedDir) {
// Make sure we don't have CAP_DAC_OVERRIDE, since that allows the user to
// always override directory permissions.
ASSERT_NO_ERRNO(SetCapability(CAP_DAC_OVERRIDE, false));
ASSERT_THAT(open("/foo", O_CREAT | O_RDWR, 0644),
SyscallFailsWithErrno(EACCES));
}
TEST(CreateTest, CreateFailsOnDirWithoutWritePerms) {
// Make sure we don't have CAP_DAC_OVERRIDE, since that allows the user to
// always override directory permissions.