.github, tool/listpkgs: automatically find tests which use tstest.RequireRoot
Updates tailscale/corp#40007 Change-Id: I677d3d9e276cb6633a14ac07e4b58ea08e52fac4 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
ca5db865b4
commit
cf59a6fb23
@@ -10,7 +10,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/netip"
|
||||
"os"
|
||||
"runtime"
|
||||
"slices"
|
||||
"strings"
|
||||
@@ -522,10 +521,7 @@ func TestAddMatchSubnetRouteMarkRuleAccept(t *testing.T) {
|
||||
|
||||
func newSysConn(t *testing.T) *nftables.Conn {
|
||||
t.Helper()
|
||||
if os.Geteuid() != 0 {
|
||||
t.Skip(t.Name(), " requires privileges to create a namespace in order to run")
|
||||
return nil
|
||||
}
|
||||
tstest.RequireRoot(t)
|
||||
|
||||
runtime.LockOSThread()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user