Merge pull request #992 from xiekeyang/master

move util function
This commit is contained in:
Daniel, Dao Quang Minh 2016-08-19 15:56:40 +01:00 committed by GitHub
commit 84c344d260
2 changed files with 11 additions and 11 deletions

View File

@ -199,17 +199,6 @@ func testRlimit(t *testing.T, userns bool) {
}
}
func newTestRoot() (string, error) {
dir, err := ioutil.TempDir("", "libcontainer")
if err != nil {
return "", err
}
if err := os.MkdirAll(dir, 0700); err != nil {
return "", err
}
return dir, nil
}
func TestEnter(t *testing.T) {
if testing.Short() {
return

View File

@ -65,6 +65,17 @@ func waitProcess(p *libcontainer.Process, t *testing.T) {
}
}
func newTestRoot() (string, error) {
dir, err := ioutil.TempDir("", "libcontainer")
if err != nil {
return "", err
}
if err := os.MkdirAll(dir, 0700); err != nil {
return "", err
}
return dir, nil
}
// newRootfs creates a new tmp directory and copies the busybox root filesystem
func newRootfs() (string, error) {
dir, err := ioutil.TempDir("", "")