diff --git a/tstest/integration/nat/nat_test.go b/tstest/integration/nat/nat_test.go index df855d117..419f47e98 100644 --- a/tstest/integration/nat/nat_test.go +++ b/tstest/integration/nat/nat_test.go @@ -99,6 +99,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 { @@ -388,6 +395,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) @@ -427,6 +439,7 @@ func TestGrid(t *testing.T) { } types := []nodeType{ {"easy", easy}, + {"easyAF", easyAF}, {"hard", hard}, {"easyPMP", easyPMP}, {"hardPMP", hardPMP}, @@ -480,10 +493,13 @@ func TestGrid(t *testing.T) { pf := func(format string, args ...interface{}) { 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 @@ -506,7 +522,14 @@ func TestGrid(t *testing.T) { } pf("