mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Remove _NoRandomSave tests.
We do not currently run random save tests. PiperOrigin-RevId: 368309921
This commit is contained in:
committed by
gVisor bot
parent
326394b79a
commit
e83cc06f1b
@@ -67,7 +67,7 @@ TEST_P(AllSocketPairTest, ListenDecreaseBacklog) {
|
||||
SyscallSucceeds());
|
||||
}
|
||||
|
||||
TEST_P(AllSocketPairTest, ListenBacklogSizes_NoRandomSave) {
|
||||
TEST_P(AllSocketPairTest, ListenBacklogSizes) {
|
||||
DisableSave ds;
|
||||
auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair());
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ void do_nothing_handler(int sig, siginfo_t* siginfo, void* arg) {}
|
||||
|
||||
// No random save as the test relies on alarm timing. Cooperative save tests
|
||||
// already cover the save between alarm and read.
|
||||
TEST(AlarmTest, Interrupt_NoRandomSave) {
|
||||
TEST(AlarmTest, Interrupt) {
|
||||
int pipe_fds[2];
|
||||
ASSERT_THAT(pipe(pipe_fds), SyscallSucceeds());
|
||||
|
||||
@@ -71,7 +71,7 @@ void inc_alarms_handler(int sig, siginfo_t* siginfo, void* arg) {
|
||||
|
||||
// No random save as the test relies on alarm timing. Cooperative save tests
|
||||
// already cover the save between alarm and read.
|
||||
TEST(AlarmTest, Restart_NoRandomSave) {
|
||||
TEST(AlarmTest, Restart) {
|
||||
alarms_received = 0;
|
||||
|
||||
int pipe_fds[2];
|
||||
@@ -114,7 +114,7 @@ TEST(AlarmTest, Restart_NoRandomSave) {
|
||||
|
||||
// No random save as the test relies on alarm timing. Cooperative save tests
|
||||
// already cover the save between alarm and pause.
|
||||
TEST(AlarmTest, SaSiginfo_NoRandomSave) {
|
||||
TEST(AlarmTest, SaSiginfo) {
|
||||
// Use a signal handler that interrupts but does nothing rather than using the
|
||||
// default terminate action.
|
||||
struct sigaction sa;
|
||||
@@ -134,7 +134,7 @@ TEST(AlarmTest, SaSiginfo_NoRandomSave) {
|
||||
|
||||
// No random save as the test relies on alarm timing. Cooperative save tests
|
||||
// already cover the save between alarm and pause.
|
||||
TEST(AlarmTest, SaInterrupt_NoRandomSave) {
|
||||
TEST(AlarmTest, SaInterrupt) {
|
||||
// Use a signal handler that interrupts but does nothing rather than using the
|
||||
// default terminate action.
|
||||
struct sigaction sa;
|
||||
|
||||
@@ -53,7 +53,7 @@ TEST(ChmodTest, ChmodDirSucceeds) {
|
||||
EXPECT_THAT(open(fileInDir.c_str(), O_RDONLY), SyscallFailsWithErrno(EACCES));
|
||||
}
|
||||
|
||||
TEST(ChmodTest, FchmodFileSucceeds_NoRandomSave) {
|
||||
TEST(ChmodTest, FchmodFileSucceeds) {
|
||||
// Drop capabilities that allow us to file directory permissions.
|
||||
ASSERT_NO_ERRNO(SetCapability(CAP_DAC_OVERRIDE, false));
|
||||
|
||||
@@ -70,7 +70,7 @@ TEST(ChmodTest, FchmodFileSucceeds_NoRandomSave) {
|
||||
EXPECT_THAT(open(file.path().c_str(), O_RDWR), SyscallFailsWithErrno(EACCES));
|
||||
}
|
||||
|
||||
TEST(ChmodTest, FchmodDirSucceeds_NoRandomSave) {
|
||||
TEST(ChmodTest, FchmodDirSucceeds) {
|
||||
// Drop capabilities that allow us to override file and directory permissions.
|
||||
ASSERT_NO_ERRNO(SetCapability(CAP_DAC_OVERRIDE, false));
|
||||
ASSERT_NO_ERRNO(SetCapability(CAP_DAC_READ_SEARCH, false));
|
||||
@@ -212,7 +212,7 @@ TEST(ChmodTest, FchmodatDir) {
|
||||
SyscallFailsWithErrno(EACCES));
|
||||
}
|
||||
|
||||
TEST(ChmodTest, ChmodDowngradeWritability_NoRandomSave) {
|
||||
TEST(ChmodTest, ChmodDowngradeWritability) {
|
||||
auto file = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateFileMode(0666));
|
||||
|
||||
int fd;
|
||||
@@ -238,7 +238,7 @@ TEST(ChmodTest, ChmodFileToNoPermissionsSucceeds) {
|
||||
SyscallFailsWithErrno(EACCES));
|
||||
}
|
||||
|
||||
TEST(ChmodTest, FchmodDowngradeWritability_NoRandomSave) {
|
||||
TEST(ChmodTest, FchmodDowngradeWritability) {
|
||||
auto file = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateFile());
|
||||
|
||||
int fd;
|
||||
@@ -252,7 +252,7 @@ TEST(ChmodTest, FchmodDowngradeWritability_NoRandomSave) {
|
||||
EXPECT_THAT(close(fd), SyscallSucceeds());
|
||||
}
|
||||
|
||||
TEST(ChmodTest, FchmodFileToNoPermissionsSucceeds_NoRandomSave) {
|
||||
TEST(ChmodTest, FchmodFileToNoPermissionsSucceeds) {
|
||||
// Drop capabilities that allow us to override file permissions.
|
||||
ASSERT_NO_ERRNO(SetCapability(CAP_DAC_OVERRIDE, false));
|
||||
ASSERT_NO_ERRNO(SetCapability(CAP_DAC_READ_SEARCH, false));
|
||||
|
||||
@@ -117,7 +117,7 @@ TEST(DevTest, ReadDevNull) {
|
||||
}
|
||||
|
||||
// Do not allow random save as it could lead to partial reads.
|
||||
TEST(DevTest, ReadDevZero_NoRandomSave) {
|
||||
TEST(DevTest, ReadDevZero) {
|
||||
const FileDescriptor fd =
|
||||
ASSERT_NO_ERRNO_AND_VALUE(Open("/dev/zero", O_RDONLY));
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ TEST(EpollTest, LastNonWritable) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(EpollTest, Timeout_NoRandomSave) {
|
||||
TEST(EpollTest, Timeout) {
|
||||
auto epollfd = ASSERT_NO_ERRNO_AND_VALUE(NewEpollFD());
|
||||
std::vector<FileDescriptor> eventfds;
|
||||
for (int i = 0; i < kFDsPerEpoll; i++) {
|
||||
@@ -290,7 +290,7 @@ TEST(EpollTest, Oneshot) {
|
||||
SyscallSucceedsWithValue(0));
|
||||
}
|
||||
|
||||
TEST(EpollTest, EdgeTriggered_NoRandomSave) {
|
||||
TEST(EpollTest, EdgeTriggered) {
|
||||
// Test edge-triggered entry: make it edge-triggered, first wait should
|
||||
// return it, second one should time out, make it writable again, third wait
|
||||
// should return it, fourth wait should timeout.
|
||||
|
||||
@@ -175,7 +175,7 @@ TEST(EventfdTest, SpliceFromPipePartialSucceeds) {
|
||||
}
|
||||
|
||||
// NotifyNonZero is inherently racy, so random save is disabled.
|
||||
TEST(EventfdTest, NotifyNonZero_NoRandomSave) {
|
||||
TEST(EventfdTest, NotifyNonZero) {
|
||||
// Waits will time out at 10 seconds.
|
||||
constexpr int kEpollTimeoutMs = 10000;
|
||||
// Create an eventfd descriptor.
|
||||
|
||||
@@ -205,7 +205,7 @@ TEST_F(FlockTest, TestSharedLockFailExclusiveHolderNonblocking) {
|
||||
|
||||
void trivial_handler(int signum) {}
|
||||
|
||||
TEST_F(FlockTest, TestSharedLockFailExclusiveHolderBlocking_NoRandomSave) {
|
||||
TEST_F(FlockTest, TestSharedLockFailExclusiveHolderBlocking) {
|
||||
const DisableSave ds; // Timing-related.
|
||||
|
||||
// This test will verify that a shared lock is denied while
|
||||
@@ -262,7 +262,7 @@ TEST_F(FlockTest, TestExclusiveLockFailExclusiveHolderNonblocking) {
|
||||
ASSERT_THAT(flock(test_file_fd_.get(), LOCK_UN), SyscallSucceedsWithValue(0));
|
||||
}
|
||||
|
||||
TEST_F(FlockTest, TestExclusiveLockFailExclusiveHolderBlocking_NoRandomSave) {
|
||||
TEST_F(FlockTest, TestExclusiveLockFailExclusiveHolderBlocking) {
|
||||
const DisableSave ds; // Timing-related.
|
||||
|
||||
// This test will verify that an exclusive lock is denied while
|
||||
@@ -499,7 +499,7 @@ TEST_F(FlockTest, TestDupFdFollowedByLock) {
|
||||
// NOTE: These blocking tests are not perfect. Unfortunately it's very hard to
|
||||
// determine if a thread was actually blocked in the kernel so we're forced
|
||||
// to use timing.
|
||||
TEST_F(FlockTest, BlockingLockNoBlockingForSharedLocks_NoRandomSave) {
|
||||
TEST_F(FlockTest, BlockingLockNoBlockingForSharedLocks) {
|
||||
// This test will verify that although LOCK_NB isn't specified
|
||||
// two different fds can obtain shared locks without blocking.
|
||||
ASSERT_THAT(flock(test_file_fd_.get(), LOCK_SH), SyscallSucceeds());
|
||||
@@ -539,7 +539,7 @@ TEST_F(FlockTest, BlockingLockNoBlockingForSharedLocks_NoRandomSave) {
|
||||
EXPECT_THAT(flock(test_file_fd_.get(), LOCK_UN), SyscallSucceeds());
|
||||
}
|
||||
|
||||
TEST_F(FlockTest, BlockingLockFirstSharedSecondExclusive_NoRandomSave) {
|
||||
TEST_F(FlockTest, BlockingLockFirstSharedSecondExclusive) {
|
||||
// This test will verify that if someone holds a shared lock any attempt to
|
||||
// obtain an exclusive lock will result in blocking.
|
||||
ASSERT_THAT(flock(test_file_fd_.get(), LOCK_SH), SyscallSucceeds());
|
||||
@@ -576,7 +576,7 @@ TEST_F(FlockTest, BlockingLockFirstSharedSecondExclusive_NoRandomSave) {
|
||||
EXPECT_THAT(flock(test_file_fd_.get(), LOCK_UN), SyscallSucceeds());
|
||||
}
|
||||
|
||||
TEST_F(FlockTest, BlockingLockFirstExclusiveSecondShared_NoRandomSave) {
|
||||
TEST_F(FlockTest, BlockingLockFirstExclusiveSecondShared) {
|
||||
// This test will verify that if someone holds an exclusive lock any attempt
|
||||
// to obtain a shared lock will result in blocking.
|
||||
ASSERT_THAT(flock(test_file_fd_.get(), LOCK_EX), SyscallSucceeds());
|
||||
@@ -613,7 +613,7 @@ TEST_F(FlockTest, BlockingLockFirstExclusiveSecondShared_NoRandomSave) {
|
||||
EXPECT_THAT(flock(test_file_fd_.get(), LOCK_UN), SyscallSucceeds());
|
||||
}
|
||||
|
||||
TEST_F(FlockTest, BlockingLockFirstExclusiveSecondExclusive_NoRandomSave) {
|
||||
TEST_F(FlockTest, BlockingLockFirstExclusiveSecondExclusive) {
|
||||
// This test will verify that if someone holds an exclusive lock any attempt
|
||||
// to obtain another exclusive lock will result in blocking.
|
||||
ASSERT_THAT(flock(test_file_fd_.get(), LOCK_EX), SyscallSucceeds());
|
||||
|
||||
@@ -220,7 +220,7 @@ TEST_P(PrivateAndSharedFutexTest, Wait_ZeroBitset) {
|
||||
SyscallFailsWithErrno(EINVAL));
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, Wake1_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, Wake1) {
|
||||
constexpr int kInitialValue = 1;
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(kInitialValue);
|
||||
|
||||
@@ -240,7 +240,7 @@ TEST_P(PrivateAndSharedFutexTest, Wake1_NoRandomSave) {
|
||||
EXPECT_THAT(futex_wake(IsPrivate(), &a, 1), SyscallSucceedsWithValue(1));
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, Wake0_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, Wake0) {
|
||||
constexpr int kInitialValue = 1;
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(kInitialValue);
|
||||
|
||||
@@ -261,7 +261,7 @@ TEST_P(PrivateAndSharedFutexTest, Wake0_NoRandomSave) {
|
||||
EXPECT_THAT(futex_wake(IsPrivate(), &a, 0), SyscallSucceedsWithValue(1));
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeAll_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeAll) {
|
||||
constexpr int kInitialValue = 1;
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(kInitialValue);
|
||||
|
||||
@@ -282,7 +282,7 @@ TEST_P(PrivateAndSharedFutexTest, WakeAll_NoRandomSave) {
|
||||
SyscallSucceedsWithValue(kThreads));
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeSome_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeSome) {
|
||||
constexpr int kInitialValue = 1;
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(kInitialValue);
|
||||
|
||||
@@ -331,7 +331,7 @@ TEST_P(PrivateAndSharedFutexTest, WakeSome_NoRandomSave) {
|
||||
EXPECT_EQ(timedout, kThreads - kWokenThreads);
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, WaitBitset_Wake_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, WaitBitset_Wake) {
|
||||
constexpr int kInitialValue = 1;
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(kInitialValue);
|
||||
|
||||
@@ -346,7 +346,7 @@ TEST_P(PrivateAndSharedFutexTest, WaitBitset_Wake_NoRandomSave) {
|
||||
EXPECT_THAT(futex_wake(IsPrivate(), &a, 1), SyscallSucceedsWithValue(1));
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, Wait_WakeBitset_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, Wait_WakeBitset) {
|
||||
constexpr int kInitialValue = 1;
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(kInitialValue);
|
||||
|
||||
@@ -361,7 +361,7 @@ TEST_P(PrivateAndSharedFutexTest, Wait_WakeBitset_NoRandomSave) {
|
||||
SyscallSucceedsWithValue(1));
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, WaitBitset_WakeBitsetMatch_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, WaitBitset_WakeBitsetMatch) {
|
||||
constexpr int kInitialValue = 1;
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(kInitialValue);
|
||||
|
||||
@@ -379,7 +379,7 @@ TEST_P(PrivateAndSharedFutexTest, WaitBitset_WakeBitsetMatch_NoRandomSave) {
|
||||
SyscallSucceedsWithValue(1));
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, WaitBitset_WakeBitsetNoMatch_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, WaitBitset_WakeBitsetNoMatch) {
|
||||
constexpr int kInitialValue = 1;
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(kInitialValue);
|
||||
|
||||
@@ -401,7 +401,7 @@ TEST_P(PrivateAndSharedFutexTest, WaitBitset_WakeBitsetNoMatch_NoRandomSave) {
|
||||
SyscallSucceedsWithValue(0));
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeOpCondSuccess_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeOpCondSuccess) {
|
||||
constexpr int kInitialValue = 1;
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(kInitialValue);
|
||||
std::atomic<int> b = ATOMIC_VAR_INIT(kInitialValue);
|
||||
@@ -428,7 +428,7 @@ TEST_P(PrivateAndSharedFutexTest, WakeOpCondSuccess_NoRandomSave) {
|
||||
EXPECT_EQ(b, kInitialValue + 2);
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeOpCondFailure_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeOpCondFailure) {
|
||||
constexpr int kInitialValue = 1;
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(kInitialValue);
|
||||
std::atomic<int> b = ATOMIC_VAR_INIT(kInitialValue);
|
||||
@@ -457,7 +457,7 @@ TEST_P(PrivateAndSharedFutexTest, WakeOpCondFailure_NoRandomSave) {
|
||||
EXPECT_EQ(b, kInitialValue + 2);
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, NoWakeInterprocessPrivateAnon_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, NoWakeInterprocessPrivateAnon) {
|
||||
auto const mapping = ASSERT_NO_ERRNO_AND_VALUE(
|
||||
MmapAnon(kPageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE));
|
||||
auto const ptr = static_cast<std::atomic<int>*>(mapping.ptr());
|
||||
@@ -484,7 +484,7 @@ TEST_P(PrivateAndSharedFutexTest, NoWakeInterprocessPrivateAnon_NoRandomSave) {
|
||||
<< " status " << status;
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeAfterCOWBreak_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeAfterCOWBreak) {
|
||||
// Use a futex on a non-stack mapping so we can be sure that the child process
|
||||
// below isn't the one that breaks copy-on-write.
|
||||
auto const mapping = ASSERT_NO_ERRNO_AND_VALUE(
|
||||
@@ -520,7 +520,7 @@ TEST_P(PrivateAndSharedFutexTest, WakeAfterCOWBreak_NoRandomSave) {
|
||||
EXPECT_THAT(futex_wake(IsPrivate(), ptr, 1), SyscallSucceedsWithValue(1));
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeWrongKind_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, WakeWrongKind) {
|
||||
constexpr int kInitialValue = 1;
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(kInitialValue);
|
||||
|
||||
@@ -584,7 +584,7 @@ TEST(PrivateFutexTest, WakeOp0Xor) {
|
||||
EXPECT_EQ(a, 0b0110);
|
||||
}
|
||||
|
||||
TEST(SharedFutexTest, WakeInterprocessSharedAnon_NoRandomSave) {
|
||||
TEST(SharedFutexTest, WakeInterprocessSharedAnon) {
|
||||
auto const mapping = ASSERT_NO_ERRNO_AND_VALUE(
|
||||
MmapAnon(kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED));
|
||||
auto const ptr = static_cast<std::atomic<int>*>(mapping.ptr());
|
||||
@@ -615,7 +615,7 @@ TEST(SharedFutexTest, WakeInterprocessSharedAnon_NoRandomSave) {
|
||||
<< " status " << status;
|
||||
}
|
||||
|
||||
TEST(SharedFutexTest, WakeInterprocessFile_NoRandomSave) {
|
||||
TEST(SharedFutexTest, WakeInterprocessFile) {
|
||||
auto const file = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateFile());
|
||||
ASSERT_THAT(truncate(file.path().c_str(), kPageSize), SyscallSucceeds());
|
||||
auto const fd = ASSERT_NO_ERRNO_AND_VALUE(Open(file.path(), O_RDWR));
|
||||
@@ -661,7 +661,7 @@ TEST_P(PrivateAndSharedFutexTest, PIBasic) {
|
||||
EXPECT_THAT(futex_unlock_pi(IsPrivate(), &a), SyscallFailsWithErrno(EPERM));
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, PIConcurrency_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, PIConcurrency) {
|
||||
DisableSave ds; // Too many syscalls.
|
||||
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(0);
|
||||
@@ -717,7 +717,7 @@ TEST_P(PrivateAndSharedFutexTest, PITryLock) {
|
||||
ASSERT_THAT(futex_unlock_pi(IsPrivate(), &a), SyscallSucceeds());
|
||||
}
|
||||
|
||||
TEST_P(PrivateAndSharedFutexTest, PITryLockConcurrency_NoRandomSave) {
|
||||
TEST_P(PrivateAndSharedFutexTest, PITryLockConcurrency) {
|
||||
DisableSave ds; // Too many syscalls.
|
||||
|
||||
std::atomic<int> a = ATOMIC_VAR_INIT(0);
|
||||
|
||||
@@ -1156,7 +1156,7 @@ TEST(Inotify, ZeroLengthReadWriteDoesNotGenerateEvent) {
|
||||
EXPECT_TRUE(events.empty());
|
||||
}
|
||||
|
||||
TEST(Inotify, ChmodGeneratesAttribEvent_NoRandomSave) {
|
||||
TEST(Inotify, ChmodGeneratesAttribEvent) {
|
||||
const TempPath root = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateDir());
|
||||
const TempPath file1 =
|
||||
ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateFileIn(root.path()));
|
||||
@@ -1999,7 +1999,7 @@ TEST(Inotify, Exec) {
|
||||
//
|
||||
// We need to disable S/R because there are filesystems where we cannot re-open
|
||||
// fds to an unlinked file across S/R, e.g. gofer-backed filesytems.
|
||||
TEST(Inotify, IncludeUnlinkedFile_NoRandomSave) {
|
||||
TEST(Inotify, IncludeUnlinkedFile) {
|
||||
const DisableSave ds;
|
||||
|
||||
const TempPath dir = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateDir());
|
||||
@@ -2052,7 +2052,7 @@ TEST(Inotify, IncludeUnlinkedFile_NoRandomSave) {
|
||||
//
|
||||
// We need to disable S/R because there are filesystems where we cannot re-open
|
||||
// fds to an unlinked file across S/R, e.g. gofer-backed filesytems.
|
||||
TEST(Inotify, ExcludeUnlink_NoRandomSave) {
|
||||
TEST(Inotify, ExcludeUnlink) {
|
||||
const DisableSave ds;
|
||||
// TODO(gvisor.dev/issue/1624): This test fails on VFS1.
|
||||
SKIP_IF(IsRunningWithVFS1());
|
||||
@@ -2093,7 +2093,7 @@ TEST(Inotify, ExcludeUnlink_NoRandomSave) {
|
||||
|
||||
// We need to disable S/R because there are filesystems where we cannot re-open
|
||||
// fds to an unlinked file across S/R, e.g. gofer-backed filesytems.
|
||||
TEST(Inotify, ExcludeUnlinkDirectory_NoRandomSave) {
|
||||
TEST(Inotify, ExcludeUnlinkDirectory) {
|
||||
// TODO(gvisor.dev/issue/1624): This test fails on VFS1. Remove once VFS1 is
|
||||
// deleted.
|
||||
SKIP_IF(IsRunningWithVFS1());
|
||||
@@ -2138,7 +2138,7 @@ TEST(Inotify, ExcludeUnlinkDirectory_NoRandomSave) {
|
||||
//
|
||||
// We need to disable S/R because there are filesystems where we cannot re-open
|
||||
// fds to an unlinked file across S/R, e.g. gofer-backed filesytems.
|
||||
TEST(Inotify, ExcludeUnlinkMultipleChildren_NoRandomSave) {
|
||||
TEST(Inotify, ExcludeUnlinkMultipleChildren) {
|
||||
// Inotify does not work properly with hard links in gofer and overlay fs.
|
||||
SKIP_IF(IsRunningOnGvisor() &&
|
||||
!ASSERT_NO_ERRNO_AND_VALUE(IsTmpfs(GetAbsoluteTestTmpdir())));
|
||||
@@ -2184,7 +2184,7 @@ TEST(Inotify, ExcludeUnlinkMultipleChildren_NoRandomSave) {
|
||||
//
|
||||
// We need to disable S/R because there are filesystems where we cannot re-open
|
||||
// fds to an unlinked file across S/R, e.g. gofer-backed filesytems.
|
||||
TEST(Inotify, ExcludeUnlinkInodeEvents_NoRandomSave) {
|
||||
TEST(Inotify, ExcludeUnlinkInodeEvents) {
|
||||
// TODO(gvisor.dev/issue/1624): Fails on VFS1.
|
||||
SKIP_IF(IsRunningWithVFS1());
|
||||
|
||||
@@ -2284,7 +2284,7 @@ TEST(Inotify, OneShot) {
|
||||
// This test helps verify that the lock order of filesystem and inotify locks
|
||||
// is respected when inotify instances and watch targets are concurrently being
|
||||
// destroyed.
|
||||
TEST(InotifyTest, InotifyAndTargetDestructionDoNotDeadlock_NoRandomSave) {
|
||||
TEST(InotifyTest, InotifyAndTargetDestructionDoNotDeadlock) {
|
||||
const DisableSave ds; // Too many syscalls.
|
||||
|
||||
// A file descriptor protected by a mutex. This ensures that while a
|
||||
@@ -2350,7 +2350,7 @@ TEST(InotifyTest, InotifyAndTargetDestructionDoNotDeadlock_NoRandomSave) {
|
||||
// This test helps verify that the lock order of filesystem and inotify locks
|
||||
// is respected when adding/removing watches occurs concurrently with the
|
||||
// removal of their targets.
|
||||
TEST(InotifyTest, AddRemoveUnlinkDoNotDeadlock_NoRandomSave) {
|
||||
TEST(InotifyTest, AddRemoveUnlinkDoNotDeadlock) {
|
||||
const DisableSave ds; // Too many syscalls.
|
||||
|
||||
// Set up inotify instances.
|
||||
@@ -2405,7 +2405,7 @@ TEST(InotifyTest, AddRemoveUnlinkDoNotDeadlock_NoRandomSave) {
|
||||
// This test helps verify that the lock order of filesystem and inotify locks
|
||||
// is respected when many inotify events and filesystem operations occur
|
||||
// simultaneously.
|
||||
TEST(InotifyTest, NotifyNoDeadlock_NoRandomSave) {
|
||||
TEST(InotifyTest, NotifyNoDeadlock) {
|
||||
const DisableSave ds; // Too many syscalls.
|
||||
|
||||
const TempPath parent = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateDir());
|
||||
|
||||
@@ -215,7 +215,7 @@ int TestSIGALRMToMainThread() {
|
||||
|
||||
// Random save/restore is disabled as it introduces additional latency and
|
||||
// unpredictable distribution patterns.
|
||||
TEST(ItimerTest, DeliversSIGALRMToMainThread_NoRandomSave) {
|
||||
TEST(ItimerTest, DeliversSIGALRMToMainThread) {
|
||||
pid_t child;
|
||||
int execve_errno;
|
||||
auto kill = ASSERT_NO_ERRNO_AND_VALUE(
|
||||
@@ -266,7 +266,7 @@ int TestSIGPROFFairness(absl::Duration sleep) {
|
||||
|
||||
// Random save/restore is disabled as it introduces additional latency and
|
||||
// unpredictable distribution patterns.
|
||||
TEST(ItimerTest, DeliversSIGPROFToThreadsRoughlyFairlyActive_NoRandomSave) {
|
||||
TEST(ItimerTest, DeliversSIGPROFToThreadsRoughlyFairlyActive) {
|
||||
// On the KVM and ptrace platforms, switches between sentry and application
|
||||
// context are sometimes extremely slow, causing the itimer to send SIGPROF to
|
||||
// a thread that either already has one pending or has had SIGPROF delivered,
|
||||
@@ -301,7 +301,7 @@ TEST(ItimerTest, DeliversSIGPROFToThreadsRoughlyFairlyActive_NoRandomSave) {
|
||||
|
||||
// Random save/restore is disabled as it introduces additional latency and
|
||||
// unpredictable distribution patterns.
|
||||
TEST(ItimerTest, DeliversSIGPROFToThreadsRoughlyFairlyIdle_NoRandomSave) {
|
||||
TEST(ItimerTest, DeliversSIGPROFToThreadsRoughlyFairlyIdle) {
|
||||
// See comment in DeliversSIGPROFToThreadsRoughlyFairlyActive.
|
||||
const auto gvisor_platform = GvisorPlatform();
|
||||
SKIP_IF(gvisor_platform == Platform::kKVM ||
|
||||
|
||||
@@ -431,7 +431,7 @@ TEST_F(OpenTest, CanTruncateReadOnly) {
|
||||
|
||||
// If we don't have read permission on the file, opening with
|
||||
// O_TRUNC should fail.
|
||||
TEST_F(OpenTest, CanTruncateReadOnlyNoWritePermission_NoRandomSave) {
|
||||
TEST_F(OpenTest, CanTruncateReadOnlyNoWritePermission) {
|
||||
// Drop capabilities that allow us to override file permissions.
|
||||
ASSERT_NO_ERRNO(SetCapability(CAP_DAC_OVERRIDE, false));
|
||||
|
||||
@@ -452,7 +452,7 @@ TEST_F(OpenTest, CanTruncateReadOnlyNoWritePermission_NoRandomSave) {
|
||||
|
||||
// If we don't have read permission but have write permission, opening O_WRONLY
|
||||
// and O_TRUNC should succeed.
|
||||
TEST_F(OpenTest, CanTruncateWriteOnlyNoReadPermission_NoRandomSave) {
|
||||
TEST_F(OpenTest, CanTruncateWriteOnlyNoReadPermission) {
|
||||
const DisableSave ds; // Permissions are dropped.
|
||||
|
||||
EXPECT_THAT(fchmod(test_file_fd_.get(), S_IWUSR | S_IWGRP),
|
||||
|
||||
@@ -52,7 +52,7 @@ TEST(CreateTest, CreateAtFile) {
|
||||
EXPECT_THAT(close(fd), SyscallSucceeds());
|
||||
}
|
||||
|
||||
TEST(CreateTest, HonorsUmask_NoRandomSave) {
|
||||
TEST(CreateTest, HonorsUmask) {
|
||||
const DisableSave ds; // file cannot be re-opened as writable.
|
||||
auto dir = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateDir());
|
||||
TempUmask mask(0222);
|
||||
@@ -119,7 +119,7 @@ TEST(CreateTest, OpenCreateROThenRW) {
|
||||
EXPECT_THAT(WriteFd(fd2.get(), &c, 1), SyscallSucceedsWithValue(1));
|
||||
}
|
||||
|
||||
TEST(CreateTest, ChmodReadToWriteBetweenOpens_NoRandomSave) {
|
||||
TEST(CreateTest, ChmodReadToWriteBetweenOpens) {
|
||||
// Make sure we don't have CAP_DAC_OVERRIDE, since that allows the user to
|
||||
// override file read/write permissions. CAP_DAC_READ_SEARCH needs to be
|
||||
// cleared for the same reason.
|
||||
@@ -149,7 +149,7 @@ TEST(CreateTest, ChmodReadToWriteBetweenOpens_NoRandomSave) {
|
||||
EXPECT_EQ(c, 'x');
|
||||
}
|
||||
|
||||
TEST(CreateTest, ChmodWriteToReadBetweenOpens_NoRandomSave) {
|
||||
TEST(CreateTest, ChmodWriteToReadBetweenOpens) {
|
||||
// Make sure we don't have CAP_DAC_OVERRIDE, since that allows the user to
|
||||
// override file read/write permissions.
|
||||
ASSERT_NO_ERRNO(SetCapability(CAP_DAC_OVERRIDE, false));
|
||||
@@ -177,7 +177,7 @@ TEST(CreateTest, ChmodWriteToReadBetweenOpens_NoRandomSave) {
|
||||
EXPECT_EQ(c, 'x');
|
||||
}
|
||||
|
||||
TEST(CreateTest, CreateWithReadFlagNotAllowedByMode_NoRandomSave) {
|
||||
TEST(CreateTest, CreateWithReadFlagNotAllowedByMode) {
|
||||
// The only time we can open a file with flags forbidden by its permissions
|
||||
// is when we are creating the file. We cannot re-open with the same flags,
|
||||
// so we cannot restore an fd obtained from such an operation.
|
||||
@@ -204,7 +204,7 @@ TEST(CreateTest, CreateWithReadFlagNotAllowedByMode_NoRandomSave) {
|
||||
EXPECT_EQ(c, 'x');
|
||||
}
|
||||
|
||||
TEST(CreateTest, CreateWithWriteFlagNotAllowedByMode_NoRandomSave) {
|
||||
TEST(CreateTest, CreateWithWriteFlagNotAllowedByMode) {
|
||||
// The only time we can open a file with flags forbidden by its permissions
|
||||
// is when we are creating the file. We cannot re-open with the same flags,
|
||||
// so we cannot restore an fd obtained from such an operation.
|
||||
|
||||
@@ -320,7 +320,7 @@ PosixErrorOr<sockaddr_storage> InetLoopbackAddr(int family) {
|
||||
// EFAULT. It also verifies that passing a buffer which is made up of 2
|
||||
// pages one valid and one guard page succeeds as long as the write is
|
||||
// for exactly the size of 1 page.
|
||||
TEST_F(PartialBadBufferTest, SendMsgTCP_NoRandomSave) {
|
||||
TEST_F(PartialBadBufferTest, SendMsgTCP) {
|
||||
// FIXME(b/171436815): Netstack save/restore is broken.
|
||||
const DisableSave ds;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace {
|
||||
//
|
||||
// We disable both random/cooperative S/R for this test as it makes way too many
|
||||
// syscalls.
|
||||
TEST(PingSocket, ICMPPortExhaustion_NoRandomSave) {
|
||||
TEST(PingSocket, ICMPPortExhaustion) {
|
||||
DisableSave ds;
|
||||
|
||||
{
|
||||
|
||||
@@ -399,7 +399,7 @@ TEST_P(PipeTest, BlockPartialWriteClosed) {
|
||||
t.Join();
|
||||
}
|
||||
|
||||
TEST_P(PipeTest, ReadFromClosedFd_NoRandomSave) {
|
||||
TEST_P(PipeTest, ReadFromClosedFd) {
|
||||
SKIP_IF(!CreateBlocking());
|
||||
|
||||
absl::Notification notify;
|
||||
|
||||
@@ -57,7 +57,7 @@ TEST_F(PollTest, ZeroTimeout) {
|
||||
|
||||
// If random S/R interrupts the poll, SIGALRM may be delivered before poll
|
||||
// restarts, causing the poll to hang forever.
|
||||
TEST_F(PollTest, NegativeTimeout_NoRandomSave) {
|
||||
TEST_F(PollTest, NegativeTimeout) {
|
||||
// Negative timeout mean wait forever so set a timer.
|
||||
SetTimer(absl::Milliseconds(100));
|
||||
EXPECT_THAT(poll(nullptr, 0, -1), SyscallFailsWithErrno(EINTR));
|
||||
|
||||
@@ -76,7 +76,7 @@ TEST_F(PpollTest, ZeroTimeout) {
|
||||
|
||||
// If random S/R interrupts the ppoll, SIGALRM may be delivered before ppoll
|
||||
// restarts, causing the ppoll to hang forever.
|
||||
TEST_F(PpollTest, NoTimeout_NoRandomSave) {
|
||||
TEST_F(PpollTest, NoTimeout) {
|
||||
// When there's no timeout, ppoll may never return so set a timer.
|
||||
SetTimer(absl::Milliseconds(100));
|
||||
// See that we get interrupted by the timer.
|
||||
|
||||
@@ -144,7 +144,7 @@ TEST_F(Pread64Test, Overflow) {
|
||||
SyscallFailsWithErrno(EINVAL));
|
||||
}
|
||||
|
||||
TEST(Pread64TestNoTempFile, CantReadSocketPair_NoRandomSave) {
|
||||
TEST(Pread64TestNoTempFile, CantReadSocketPair) {
|
||||
int sock_fds[2];
|
||||
EXPECT_THAT(socketpair(AF_UNIX, SOCK_STREAM, 0, sock_fds), SyscallSucceeds());
|
||||
|
||||
|
||||
@@ -1629,7 +1629,7 @@ TEST(ProcPidStatusTest, StateRunning) {
|
||||
IsPosixErrorOkAndHolds(Contains(Pair("State", "R (running)"))));
|
||||
}
|
||||
|
||||
TEST(ProcPidStatusTest, StateSleeping_NoRandomSave) {
|
||||
TEST(ProcPidStatusTest, StateSleeping) {
|
||||
// Starts a child process that blocks and checks that State is sleeping.
|
||||
auto res = WithSubprocess(
|
||||
[&](int pid) -> PosixError {
|
||||
|
||||
@@ -189,7 +189,7 @@ PosixErrorOr<uint64_t> GetSNMPMetricFromProc(const std::string snmp,
|
||||
EINVAL, absl::StrCat("failed to find ", type, "/", item, " in:", snmp));
|
||||
}
|
||||
|
||||
TEST(ProcNetSnmp, TcpReset_NoRandomSave) {
|
||||
TEST(ProcNetSnmp, TcpReset) {
|
||||
// TODO(gvisor.dev/issue/866): epsocket metrics are not savable.
|
||||
DisableSave ds;
|
||||
|
||||
@@ -231,7 +231,7 @@ TEST(ProcNetSnmp, TcpReset_NoRandomSave) {
|
||||
EXPECT_EQ(oldAttemptFails, newAttemptFails - 1);
|
||||
}
|
||||
|
||||
TEST(ProcNetSnmp, TcpEstab_NoRandomSave) {
|
||||
TEST(ProcNetSnmp, TcpEstab) {
|
||||
// TODO(gvisor.dev/issue/866): epsocket metrics are not savable.
|
||||
DisableSave ds;
|
||||
|
||||
@@ -325,7 +325,7 @@ TEST(ProcNetSnmp, TcpEstab_NoRandomSave) {
|
||||
EXPECT_EQ(oldEstabResets, newEstabResets - 2);
|
||||
}
|
||||
|
||||
TEST(ProcNetSnmp, UdpNoPorts_NoRandomSave) {
|
||||
TEST(ProcNetSnmp, UdpNoPorts) {
|
||||
// TODO(gvisor.dev/issue/866): epsocket metrics are not savable.
|
||||
DisableSave ds;
|
||||
|
||||
@@ -359,7 +359,7 @@ TEST(ProcNetSnmp, UdpNoPorts_NoRandomSave) {
|
||||
EXPECT_EQ(oldNoPorts, newNoPorts - 1);
|
||||
}
|
||||
|
||||
TEST(ProcNetSnmp, UdpIn_NoRandomSave) {
|
||||
TEST(ProcNetSnmp, UdpIn) {
|
||||
// TODO(gvisor.dev/issue/866): epsocket metrics are not savable.
|
||||
const DisableSave ds;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user