Fix hanging tests when run without root

Fixes #692

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
This commit is contained in:
Marcos Lilljedahl 2016-03-27 01:53:01 -03:00
parent 519529febe
commit 61ffdc0661
1 changed files with 3 additions and 3 deletions

View File

@ -60,6 +60,9 @@ func TestNsenterValidPaths(t *testing.T) {
decoder := json.NewDecoder(parent)
var pid *pid
if err := cmd.Wait(); err != nil {
t.Fatalf("nsenter exits with a non-zero exit status")
}
if err := decoder.Decode(&pid); err != nil {
dir, _ := ioutil.ReadDir(fmt.Sprintf("/proc/%d/ns", os.Getpid()))
for _, d := range dir {
@ -68,9 +71,6 @@ func TestNsenterValidPaths(t *testing.T) {
t.Fatalf("%v", err)
}
if err := cmd.Wait(); err != nil {
t.Fatalf("nsenter exits with a non-zero exit status")
}
p, err := os.FindProcess(pid.Pid)
if err != nil {
t.Fatalf("%v", err)