Merge pull request #700 from marcosnils/tests_fix
Fix hanging tests when run without root
This commit is contained in:
commit
ed03709656
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue