diff --git a/capability/capability_test.go b/capability/capability_test.go index 50279dc..7357556 100644 --- a/capability/capability_test.go +++ b/capability/capability_test.go @@ -24,10 +24,13 @@ const ( ) func requirePCapSet(t *testing.T) { - pid, err := NewPid(0) + pid, err := NewPid2(0) if err != nil { t.Fatal(err) } + if err := pid.Load(); err != nil { + t.Fatal(err) + } if !pid.Get(EFFECTIVE, CAP_SETPCAP) { t.Skip("The test needs `CAP_SETPCAP`.") } @@ -114,7 +117,7 @@ func TestAmbientCapSet(t *testing.T) { capInheritable := []Cap{CAP_KILL, CAP_CHOWN} capAmbient := []Cap{CAP_KILL, CAP_CHOWN} - pid, err := newPid(0) + pid, err := NewPid2(0) if err != nil { t.Fatal(err) }