nat: fix broken test 39/27639/2
authorKlement Sekera <ksekera@cisco.com>
Mon, 22 Jun 2020 13:15:41 +0000 (13:15 +0000)
committerOle Trøan <otroan@employees.org>
Tue, 23 Jun 2020 07:13:05 +0000 (07:13 +0000)
Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I04952865b7e2b447763d0b67d120c3d933177646

src/plugins/nat/test/test_nat.py

index e996373..640e803 100644 (file)
@@ -1389,6 +1389,19 @@ class MethodHolder(VppTestCase):
 class TestNAT44(MethodHolder):
     """ NAT44 Test Cases """
 
+    max_translations = 10240
+    max_users = 10240
+
+    @classmethod
+    def setUpConstants(cls):
+        super(TestNAT44, cls).setUpConstants()
+        cls.vpp_cmdline.extend([
+            "nat", "{",
+            "max translations per thread %d" % cls.max_translations,
+            "max users per thread %d" % cls.max_users,
+            "}"
+        ])
+
     @classmethod
     def setUpClass(cls):
         super(TestNAT44, cls).setUpClass()
@@ -2785,8 +2798,7 @@ class TestNAT44(MethodHolder):
             sw_if_index=self.pg1.sw_if_index,
             is_add=1)
 
-        nat44_config = self.vapi.nat_show_config()
-        max_sessions = 10 * nat44_config.translation_buckets
+        max_sessions = self.max_translations
 
         pkts = []
         for i in range(0, max_sessions):