aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-11-22 00:12:15 -0800
committerOle Trøan <otroan@employees.org>2018-11-23 11:08:25 +0000
commit7f8a8dba96a78a0c67756df0b2fabaab313c3f2d (patch)
treeaf9eb2d7b4b64bd13f42ad77edb8ae01b20d2ce9 /test
parentffba3c377c679a69fd9507bc8f8bc3acf8258d1e (diff)
NAT44: improve expired sessions reuse (VPP-1503)
Change-Id: Iab506f127136c94a641df31ded108016de26260b Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_nat.py19
1 files changed, 2 insertions, 17 deletions
diff --git a/test/test_nat.py b/test/test_nat.py
index 524301f302d..cf5cc63cc50 100644
--- a/test/test_nat.py
+++ b/test/test_nat.py
@@ -5658,7 +5658,7 @@ class TestNAT44EndpointDependent(MethodHolder):
pkts = []
for i in range(0, max_sessions):
- src = "10.10.%u.%u" % ((i & 0xFF00) >> 8, i & 0xFF)
+ src = "10.11.%u.%u" % ((i & 0xFF00) >> 8, i & 0xFF)
p = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
IP(src=src, dst=self.pg1.remote_ip4) /
ICMP(id=1026, type='echo-request'))
@@ -5683,8 +5683,6 @@ class TestNAT44EndpointDependent(MethodHolder):
is_inside=0)
self.vapi.nat_set_timeouts(tcp_transitory=5)
- nat44_config = self.vapi.nat_show_config()
-
self.initiate_tcp_session(self.pg0, self.pg1)
p = (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) /
IP(src=self.pg0.remote_ip4, dst=self.pg1.remote_ip4) /
@@ -5695,18 +5693,6 @@ class TestNAT44EndpointDependent(MethodHolder):
self.pg_start()
self.pg1.get_capture(1)
- pkts_num = nat44_config.max_translations_per_user - 1
- pkts = []
- for i in range(0, pkts_num):
- p = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
- IP(src=self.pg0.remote_ip4, dst=self.pg1.remote_ip4) /
- UDP(sport=1025 + i, dport=53))
- pkts.append(p)
- self.pg0.add_stream(pkts)
- self.pg_enable_capture(self.pg_interfaces)
- self.pg_start()
- self.pg1.get_capture(pkts_num)
-
sleep(6)
p = (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) /
@@ -5722,8 +5708,7 @@ class TestNAT44EndpointDependent(MethodHolder):
users = self.vapi.nat44_user_dump()
self.assertEqual(len(users), 1)
self.assertEqual(users[0].ip_address, self.pg0.remote_ip4n)
- self.assertEqual(users[0].nsessions,
- nat44_config.max_translations_per_user)
+ self.assertEqual(users[0].nsessions, 1)
@unittest.skipUnless(running_extended_tests(), "part of extended tests")
def test_session_limit_per_user(self):