Documentation ¶
Overview ¶
Package testutil contains helper functions used for testing conntrack
Index ¶
- func AddNS(tb testing.TB) string
- func SetupCrossNsDNAT(tb testing.TB) (ns string)
- func SetupCrossNsDNAT6(t *testing.T) (ns string)
- func SetupCrossNsDNATWithPorts(tb testing.TB, dport int, redirPort int) (ns string)
- func SetupDNAT(t *testing.T)
- func SetupDNAT6(t *testing.T)
- func SetupSNAT(t *testing.T) string
- func SetupVeth6Pair(t *testing.T) (ns string)
- func SetupVethPair(tb testing.TB) (ns string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupCrossNsDNAT ¶
SetupCrossNsDNAT sets up a network namespace, a veth pair, and a NAT rule in the specified network namespace. Redirecting port 80 to 8080 within the namespace.
func SetupCrossNsDNAT6 ¶
SetupCrossNsDNAT6 sets up a network namespace, along with two IPv6 addresses fd00::1 and fd00::2 to be used for namespace aware tests. fd00::2 is within the specified namespace, while fd00::1 is a peer in the root namespace.
func SetupCrossNsDNATWithPorts ¶
SetupCrossNsDNATWithPorts sets up a network namespace, a veth pair, and a NAT rule in the specified network namespace. Redirecting `dport` to `redirPort` within the namespace.
func SetupDNAT ¶
SetupDNAT sets up a NAT translation from: * 2.2.2.2 to 1.1.1.1 (OUTPUT Chain) * 3.3.3.3 to 1.1.1.1 (PREROUTING Chain)
func SetupDNAT6 ¶
SetupDNAT6 sets up a NAT translation from fd00::2 to fd00::1
func SetupVeth6Pair ¶
SetupVeth6Pair sets up a network namespace, along with two IPv6 addresses fd00::1 and fd00::2 to be used for namespace aware tests. fd00::2 is within the specified namespace, while fd00::1 is a peer in the root namespace.
func SetupVethPair ¶
SetupVethPair sets up a network namespace, along with two IP addresses 2.2.2.3 and 2.2.2.4 to be used for namespace aware tests. 2.2.2.4 is within the specified namespace, while 2.2.2.3 is a peer in the root namespace.
Types ¶
This section is empty.