diff --git a/tstest/integration/nat/nat_test.go b/tstest/integration/nat/nat_test.go index b50c0da8a..453a74cf1 100644 --- a/tstest/integration/nat/nat_test.go +++ b/tstest/integration/nat/nat_test.go @@ -102,6 +102,13 @@ func easy(c *vnet.Config) *vnet.Node { fmt.Sprintf("192.168.%d.1/24", n), vnet.EasyNAT)) } +func easyAF(c *vnet.Config) *vnet.Node { + n := c.NumNodes() + 1 + return c.AddNode(c.AddNetwork( + fmt.Sprintf("2.%d.%d.%d", n, n, n), // public IP + fmt.Sprintf("192.168.%d.1/24", n), vnet.EasyAFNAT)) +} + func sameLAN(c *vnet.Config) *vnet.Node { nw := c.FirstNetwork() if nw == nil { @@ -391,6 +398,11 @@ func TestEasyHard(t *testing.T) { nt.runTest(easy, hard) } +func TestEasyAFHard(t *testing.T) { + nt := newNatTest(t) + nt.runTest(easyAF, hard) +} + func TestEasyHardPMP(t *testing.T) { nt := newNatTest(t) nt.runTest(easy, hardPMP) @@ -430,6 +442,7 @@ func TestGrid(t *testing.T) { } types := []nodeType{ {"easy", easy}, + {"easyAF", easyAF}, {"hard", hard}, {"easyPMP", easyPMP}, {"hardPMP", hardPMP}, @@ -483,10 +496,13 @@ func TestGrid(t *testing.T) { pf := func(format string, args ...any) { fmt.Fprintf(&hb, format, args...) } + rewrite := func(s string) string { + return strings.ReplaceAll(s, "PMP", "+pm") + } pf("
") for _, a := range types { - pf(" | %s | ", a.name) + pf("%s | ", rewrite(a.name)) } pf("
%s | ", a.name) + pf("||
%s | ", rewrite(a.name)) for _, b := range types { key := a.name + "-" + b.name key2 := b.name + "-" + a.name @@ -509,7 +525,14 @@ func TestGrid(t *testing.T) { } pf("