This can happen in an unprivileged container where it looks like we are
root, but we don't have NET_RAW privileges.
import sys
import subprocess as subp
+import socket
from testlib import check, util
from testlib.log import log
util.require_root()
util.require_command("ip", "link")
+try:
+ s = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.IPPROTO_IP)
+ print("Success!")
+except PermissionError:
+ log.info("This test requires raw socket privileges")
+ sys.exit(77)
+
FAKE_DEV = "cqhqdr7knaLzYeMSdy"
IP_NETNS = "10.198.96.1"