summaryrefslogtreecommitdiffhomepage
path: root/runsc
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-02-24 11:47:27 -0800
committergVisor bot <gvisor-bot@google.com>2021-02-24 11:47:27 -0800
commit8f6274404a87aa6adb2c8f322b9ee7aae2589fba (patch)
tree817907f6d65ecbf124a4ee58231567f1ca2ba3bd /runsc
parent055073f11813a7b675cb19aa6c540a667cd746a5 (diff)
parent306a9477daa7b57ef62133bcf3f2f5966e26ffca (diff)
Merge pull request #5519 from dqminh:runsc-ps-pids
PiperOrigin-RevId: 359334029
Diffstat (limited to 'runsc')
-rw-r--r--runsc/container/multi_container_test.go27
1 files changed, 14 insertions, 13 deletions
diff --git a/runsc/container/multi_container_test.go b/runsc/container/multi_container_test.go
index 17aef2121..b434cdb23 100644
--- a/runsc/container/multi_container_test.go
+++ b/runsc/container/multi_container_test.go
@@ -203,7 +203,7 @@ func TestMultiPIDNS(t *testing.T) {
t.Errorf("failed to wait for sleep to start: %v", err)
}
expectedPL = []*control.Process{
- newProcessBuilder().PID(1).Cmd("sleep").Process(),
+ newProcessBuilder().PID(2).Cmd("sleep").Process(),
}
if err := waitForProcessList(containers[1], expectedPL); err != nil {
t.Errorf("failed to wait for sleep to start: %v", err)
@@ -291,16 +291,18 @@ func TestMultiPIDNSPath(t *testing.T) {
if err := waitForProcessList(containers[0], expectedPL); err != nil {
t.Errorf("failed to wait for sleep to start: %v", err)
}
- if err := waitForProcessList(containers[2], expectedPL); err != nil {
- t.Errorf("failed to wait for sleep to start: %v", err)
- }
-
expectedPL = []*control.Process{
newProcessBuilder().PID(2).PPID(0).Cmd("sleep").Process(),
}
if err := waitForProcessList(containers[1], expectedPL); err != nil {
t.Errorf("failed to wait for sleep to start: %v", err)
}
+ expectedPL = []*control.Process{
+ newProcessBuilder().PID(3).PPID(0).Cmd("sleep").Process(),
+ }
+ if err := waitForProcessList(containers[2], expectedPL); err != nil {
+ t.Errorf("failed to wait for sleep to start: %v", err)
+ }
// Root container runs in the root PID namespace and can see all
// processes.
@@ -371,14 +373,13 @@ func TestMultiPIDNSKill(t *testing.T) {
const processes = 3
testSpecs, ids := createSpecs(cmd, cmd)
- // TODO: Uncomment after https://github.com/google/gvisor/pull/5519.
- //testSpecs[1].Linux = &specs.Linux{
- // Namespaces: []specs.LinuxNamespace{
- // {
- // Type: "pid",
- // },
- // },
- //}
+ testSpecs[1].Linux = &specs.Linux{
+ Namespaces: []specs.LinuxNamespace{
+ {
+ Type: "pid",
+ },
+ },
+ }
containers, cleanup, err := startContainers(conf, testSpecs, ids)
if err != nil {