Skip to content

Commit

Permalink
Skip NetNsId tests unless root
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Senin authored and aboch committed Feb 21, 2020
1 parent 5f2fc86 commit c79a4b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions netns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
// then retrieves the ID.
// This does not do any namespace switching.
func TestNetNsIdByFd(t *testing.T) {
skipUnlessRoot(t)
// create a network namespace
ns, err := netns.New()
CheckErrorFail(t, err)
Expand Down Expand Up @@ -44,6 +45,7 @@ func TestNetNsIdByFd(t *testing.T) {
// Does the same as TestNetNsIdByFd, but we need to change namespaces so we
// actually have a pid in that namespace
func TestNetNsIdByPid(t *testing.T) {
skipUnlessRoot(t)
runtime.LockOSThread() // we need a constant OS thread
origNs, _ := netns.Get()

Expand Down

0 comments on commit c79a4b7

Please sign in to comment.