mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: skip TestUnshare if kernel does not support net namespace
Fixes #16056. Change-Id: Ic3343914742713851b8ae969b101521f25e85e7b Reviewed-on: https://go-review.googlesource.com/24132 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
0ec62565f9
commit
48cc3c4b58
1 changed files with 6 additions and 0 deletions
|
|
@ -155,6 +155,12 @@ func TestUnshare(t *testing.T) {
|
|||
}
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := os.Stat("/proc/self/ns/net"); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
t.Skip("kernel doesn't support net namespace")
|
||||
}
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cmd := exec.Command("cat", path)
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue