From 95746d13f8c706df2a06075f9b4ed922d936e5ce Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Mon, 5 Jan 2015 16:19:19 -0500 Subject: [PATCH] Fixes integration tests. Signed-off-by: Mrunal Patel (github: mrunalp) --- integration/execin_test.go | 10 +++++++++- integration/utils_test.go | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/integration/execin_test.go b/integration/execin_test.go index 86d9c5c26..648f52be2 100644 --- a/integration/execin_test.go +++ b/integration/execin_test.go @@ -115,6 +115,7 @@ func TestExecInRlimit(t *testing.T) { func startLongRunningContainer(config *libcontainer.Config) (*exec.Cmd, string, chan error) { containerErr := make(chan error, 1) containerCmd := &exec.Cmd{} + setupContainerCmd := &exec.Cmd{} var statePath string createCmd := func(container *libcontainer.Config, console, dataPath, init string, @@ -124,6 +125,13 @@ func startLongRunningContainer(config *libcontainer.Config) (*exec.Cmd, string, return containerCmd } + setupCmd := func(container *libcontainer.Config, console, dataPath, init string) *exec.Cmd { + setupContainerCmd = namespaces.DefaultSetupCommand(container, console, dataPath, init) + statePath = dataPath + return setupContainerCmd + } + + var containerStart sync.WaitGroup containerStart.Add(1) go func() { @@ -131,7 +139,7 @@ func startLongRunningContainer(config *libcontainer.Config) (*exec.Cmd, string, _, err := namespaces.Exec(config, buffers.Stdin, buffers.Stdout, buffers.Stderr, "", config.RootFs, []string{"sleep", "10"}, - createCmd, containerStart.Done) + createCmd, setupCmd, containerStart.Done) containerErr <- err }() containerStart.Wait() diff --git a/integration/utils_test.go b/integration/utils_test.go index 6393fb998..cf14b6185 100644 --- a/integration/utils_test.go +++ b/integration/utils_test.go @@ -90,6 +90,6 @@ func runContainer(config *libcontainer.Config, console string, args ...string) ( buffers = newStdBuffers() exitCode, err = namespaces.Exec(config, buffers.Stdin, buffers.Stdout, buffers.Stderr, - console, config.RootFs, args, namespaces.DefaultCreateCommand, nil) + console, config.RootFs, args, namespaces.DefaultCreateCommand, namespaces.DefaultSetupCommand, nil) return }