1
0
mirror of https://github.com/opencontainers/runc.git synced 2025-08-01 05:06:52 +03:00

tests: fix all the things

This fixes all of the tests that were broken as part of the console
rewrite. This includes fixing the integration tests that used TTY
handling inside libcontainer, as well as the bats integration tests that
needed to be rewritten to use recvtty (as they rely on detached
containers that are running).

This patch is part of the console rewrite patchset.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
Aleksa Sarai
2016-09-06 22:40:01 +10:00
parent bda3055055
commit 972c176ae4
20 changed files with 91 additions and 65 deletions

View File

@ -247,8 +247,6 @@ func TestExecInError(t *testing.T) {
}
}
// XXX: This test will fail.
/*
func TestExecInTTY(t *testing.T) {
if testing.Short() {
return
@ -281,15 +279,15 @@ func TestExecInTTY(t *testing.T) {
Args: []string{"ps"},
Env: standardEnvironment,
}
console, err := ps.NewConsole(0, 0)
err = container.Run(ps)
ok(t, err)
console, err := ps.GetConsole()
copy := make(chan struct{})
go func() {
io.Copy(&stdout, console)
close(copy)
}()
ok(t, err)
err = container.Run(ps)
ok(t, err)
select {
case <-time.After(5 * time.Second):
t.Fatal("Waiting for copy timed out")
@ -308,7 +306,6 @@ func TestExecInTTY(t *testing.T) {
t.Fatalf("unexpected carriage-return in output")
}
}
*/
func TestExecInEnvironment(t *testing.T) {
if testing.Short() {