summaryrefslogtreecommitdiffhomepage
path: root/runsc/test/integration/exec_test.go
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2018-10-08 20:47:47 -0700
committerShentubot <shentubot@google.com>2018-10-08 20:48:54 -0700
commitae5122eb87b5b453d51b70cffe2a253333af9eb4 (patch)
treecaf0bbe4cfb6695d85d0b9f681dae64992d2b149 /runsc/test/integration/exec_test.go
parentb8048f75daa2ec13059162cb421236f99e5e4a0e (diff)
Job control signals must be sent to all processes in the FG process group.
We were previously only sending to the originator of the process group. Integration test was changed to test this behavior. It fails without the corresponding code change. PiperOrigin-RevId: 216297263 Change-Id: I7e41cfd6bdd067f4b9dc215e28f555fb5088916f
Diffstat (limited to 'runsc/test/integration/exec_test.go')
-rw-r--r--runsc/test/integration/exec_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/runsc/test/integration/exec_test.go b/runsc/test/integration/exec_test.go
index 014254aab..d08140ad3 100644
--- a/runsc/test/integration/exec_test.go
+++ b/runsc/test/integration/exec_test.go
@@ -81,16 +81,17 @@ func TestExecJobControl(t *testing.T) {
}
defer ptmx.Close()
- // Call "sleep 100" in the shell.
- if _, err := ptmx.Write([]byte("sleep 100\n")); err != nil {
+ // Call "sleep 100 | cat" in the shell. We pipe to cat so that there
+ // will be two processes in the foreground process group.
+ if _, err := ptmx.Write([]byte("sleep 100 | cat\n")); err != nil {
t.Fatalf("error writing to pty: %v", err)
}
// Give shell a few seconds to start executing the sleep.
time.Sleep(2 * time.Second)
- // Send a ^C to the pty, which should kill sleep, but not the shell.
- // \x03 is ASCII "end of text", which is the same as ^C.
+ // Send a ^C to the pty, which should kill sleep and cat, but not the
+ // shell. \x03 is ASCII "end of text", which is the same as ^C.
if _, err := ptmx.Write([]byte{'\x03'}); err != nil {
t.Fatalf("error writing to pty: %v", err)
}