summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-12-02 09:24:52 -0800
committergVisor bot <gvisor-bot@google.com>2020-12-02 09:28:14 -0800
commit496851d27b58bbb15ee863de0d8a106dd23b8050 (patch)
treec5707ec4f44f3f5779b2b4f61be70cfcd1fe18d1 /test
parentf156fb6531918f62c1a14363af97240588948202 (diff)
Skip CanKillAllPIDs when running natively.
This is quite disruptive to run in some environments. PiperOrigin-RevId: 345247206
Diffstat (limited to 'test')
-rw-r--r--test/syscalls/linux/kill.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/syscalls/linux/kill.cc b/test/syscalls/linux/kill.cc
index db29bd59c..5d1735853 100644
--- a/test/syscalls/linux/kill.cc
+++ b/test/syscalls/linux/kill.cc
@@ -58,6 +58,12 @@ void SigHandler(int sig, siginfo_t* info, void* context) { _exit(0); }
// If pid equals -1, then sig is sent to every process for which the calling
// process has permission to send signals, except for process 1 (init).
TEST(KillTest, CanKillAllPIDs) {
+ // If we're not running inside the sandbox, then we skip this test
+ // as our namespace may contain may more processes that cannot tolerate
+ // the signal below. We also cannot reliably create a new pid namespace
+ // for ourselves and test the same functionality.
+ SKIP_IF(!IsRunningOnGvisor());
+
int pipe_fds[2];
ASSERT_THAT(pipe(pipe_fds), SyscallSucceeds());
FileDescriptor read_fd(pipe_fds[0]);