.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
@@ -18,6 +18,7 @@ import (
|
||||
"gvisor.dev/gvisor/pkg/tcpip/checksum"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/header"
|
||||
"tailscale.com/net/stun"
|
||||
"tailscale.com/tstest"
|
||||
)
|
||||
|
||||
type xdpAction uint32
|
||||
@@ -271,6 +272,7 @@ func getIPv6STUNBindingResp() []byte {
|
||||
}
|
||||
|
||||
func TestXDP(t *testing.T) {
|
||||
tstest.RequireRoot(t)
|
||||
ipv4STUNBindingReqTX := getIPv4STUNBindingReq(nil)
|
||||
ipv6STUNBindingReqTX := getIPv6STUNBindingReq(nil)
|
||||
|
||||
@@ -957,10 +959,6 @@ func TestXDP(t *testing.T) {
|
||||
server, err := NewSTUNServer(&STUNServerConfig{DeviceName: "fake", DstPort: defaultSTUNPort},
|
||||
&noAttachOption{})
|
||||
if err != nil {
|
||||
if errors.Is(err, unix.EPERM) {
|
||||
// TODO(jwhited): get this running
|
||||
t.Skip("skipping due to EPERM error; test requires elevated privileges")
|
||||
}
|
||||
t.Fatalf("error constructing STUN server: %v", err)
|
||||
}
|
||||
defer server.Close()
|
||||
|
||||
Reference in New Issue
Block a user