Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Fixes integration tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Mrunal Patel <mrunalp@gmail.com> (github: mrunalp)
  • Loading branch information
mrunalp committed Jan 5, 2015
1 parent dd5e8e0 commit 95746d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion integration/execin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -124,14 +125,21 @@ 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() {
buffers := newStdBuffers()
_, 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()
Expand Down
2 changes: 1 addition & 1 deletion integration/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 95746d1

Please sign in to comment.