cnat: fix snat ip v6 tests 31/28631/4
authorMathiasRaoul <mathias.raoul@gmail.com>
Tue, 1 Sep 2020 14:30:02 +0000 (14:30 +0000)
committerBenoît Ganne <bganne@cisco.com>
Fri, 4 Sep 2020 16:57:22 +0000 (16:57 +0000)
Type: fix

Change-Id: I9e102e0028274cc084e59c106d1cd4be174b1205
Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
src/plugins/cnat/test/test_cnat.py

index 18e3baa..7a5dc7f 100644 (file)
@@ -460,7 +460,7 @@ class TestCNatSourceNAT(VppTestCase):
             i.admin_down()
         super(TestCNatSourceNAT, self).tearDown()
 
-    def cnat_create_translation(self, srcNatAddr, interface, isV6=False):
+    def cnat_set_snat_address(self, srcNatAddr, interface, isV6=False):
         t1 = VppCNATSourceNat(self, srcNatAddr)
         t1.add_vpp_config()
         cnat_arc_name = "ip6-unicast" if isV6 else "ip4-unicast"
@@ -487,7 +487,7 @@ class TestCNatSourceNAT(VppTestCase):
         self.pg1.configure_ipv6_neighbors()
 
         self.vapi.cli("test cnat scanner on")
-        t1 = self.cnat_create_translation(srcNatAddr, self.pg0)
+        t1 = self.cnat_set_snat_address(srcNatAddr, self.pg0, isV6)
 
         for nbr, remote_host in enumerate(self.pg1.remote_hosts):
             # from pods to outside network
@@ -582,10 +582,10 @@ class TestCNatSourceNAT(VppTestCase):
                     rx[ip_class].src,
                     srcNatAddr)
 
-    def test_cnat6_sourcenat(self):
-        # """ CNat Source Nat ipv6 """
-        self.cnat_test_sourcenat(self.pg2.remote_hosts[0].ip6, TCP, True)
-        self.cnat_test_sourcenat(self.pg2.remote_hosts[0].ip6, UDP, True)
+    def test_cnat6_sourcenat(self):
+        # """ CNat Source Nat ipv6 """
+        self.cnat_test_sourcenat(self.pg2.remote_hosts[0].ip6, TCP, True)
+        self.cnat_test_sourcenat(self.pg2.remote_hosts[0].ip6, UDP, True)
 
     def test_cnat4_sourcenat(self):
         # """ CNat Source Nat ipv4 """