MCPcopy Create free account
hub / github.com/SamNet-dev/snix / mustBeRoot

Function mustBeRoot

platform/linux/nfqueue_integration_test.go:24–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22)
23
24func mustBeRoot(t *testing.T) {
25 t.Helper()
26 // iptables listing requires root on this system.
27 if err := exec.Command("iptables", "-t", "mangle", "-L", "-n").Run(); err != nil {
28 t.Skipf("skipping: no root / iptables: %v", err)
29 }
30}
31
32// safeScope uses a deliberately unused IP+port so installed rules can't
33// interfere with real traffic. 198.51.100.0/24 is TEST-NET-2 (RFC 5737).

Callers 3

TestDoubleCloseIsSafeFunction · 0.85
TestRawSocketAvailableFunction · 0.85

Calls 1

RunMethod · 0.80

Tested by

no test coverage detected