aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/test
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2019-11-05 14:14:08 +0100
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-11-18 13:19:19 +0000
commit59aed0eed41e0b2441cb3f2929a3c0cd20ace4c5 (patch)
treeabcecb167841004a7de5a37bc3475308a705bd75 /src/plugins/nat/test
parentd451cbd0bdf7467ac8cb34f9658f92a5333852b0 (diff)
nat: NAT udp counter & unit test fixes
Ticket: VPP-1798 Type: fix Change-Id: I42f02d5824575720e95b9fc99cfa864252221a82 Signed-off-by: Filip Varga <fivarga@cisco.com> (cherry picked from commit 5854b43de4c04a7c52b0cf03cd548c9cac86c325)
Diffstat (limited to 'src/plugins/nat/test')
-rw-r--r--src/plugins/nat/test/test_nat.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/plugins/nat/test/test_nat.py b/src/plugins/nat/test/test_nat.py
index 60559f448d4..f2b1dbf79ac 100644
--- a/src/plugins/nat/test/test_nat.py
+++ b/src/plugins/nat/test/test_nat.py
@@ -243,7 +243,7 @@ class MethodHolder(VppTestCase):
p = (Ether(dst=in_if.local_mac, src=in_if.remote_mac) /
IP(src=in_if.remote_ip4, dst=dst_ip, ttl=ttl) /
TCP(sport=self.tcp_port_in, dport=20))
- pkts.append(p)
+ pkts.extend([p, p])
# UDP
p = (Ether(dst=in_if.local_mac, src=in_if.remote_mac) /
@@ -407,7 +407,7 @@ class MethodHolder(VppTestCase):
p = (Ether(dst=out_if.local_mac, src=out_if.remote_mac) /
IP(src=out_if.remote_ip4, dst=dst_ip, ttl=ttl) /
TCP(dport=tcp_port, sport=20))
- pkts.append(p)
+ pkts.extend([p, p])
# UDP
p = (Ether(dst=out_if.local_mac, src=out_if.remote_mac) /
@@ -1574,7 +1574,7 @@ class TestNAT44(MethodHolder):
err = self.statistics.get_err_counter(
'/err/nat44-in2out-slowpath/TCP packets')
- self.assertEqual(err - tcpn, 1)
+ self.assertEqual(err - tcpn, 2)
err = self.statistics.get_err_counter(
'/err/nat44-in2out-slowpath/UDP packets')
self.assertEqual(err - udpn, 1)
@@ -1583,7 +1583,7 @@ class TestNAT44(MethodHolder):
self.assertEqual(err - icmpn, 1)
err = self.statistics.get_err_counter(
'/err/nat44-in2out-slowpath/good in2out packets processed')
- self.assertEqual(err - totaln, 3)
+ self.assertEqual(err - totaln, 4)
# out2in
tcpn = self.statistics.get_err_counter('/err/nat44-out2in/TCP packets')
@@ -1601,14 +1601,14 @@ class TestNAT44(MethodHolder):
self.verify_capture_in(capture, self.pg0)
err = self.statistics.get_err_counter('/err/nat44-out2in/TCP packets')
- self.assertEqual(err - tcpn, 1)
+ self.assertEqual(err - tcpn, 2)
err = self.statistics.get_err_counter('/err/nat44-out2in/UDP packets')
self.assertEqual(err - udpn, 1)
err = self.statistics.get_err_counter('/err/nat44-out2in/ICMP packets')
self.assertEqual(err - icmpn, 1)
err = self.statistics.get_err_counter(
'/err/nat44-out2in/good out2in packets processed')
- self.assertEqual(err - totaln, 3)
+ self.assertEqual(err - totaln, 4)
users = self.statistics.get_counter('/nat44/total-users')
self.assertEqual(users[0][0], 1)
@@ -4732,7 +4732,7 @@ class TestNAT44EndpointDependent(MethodHolder):
err = self.statistics.get_err_counter(
'/err/nat44-ed-in2out-slowpath/TCP packets')
- self.assertEqual(err - tcpn, 1)
+ self.assertEqual(err - tcpn, 2)
err = self.statistics.get_err_counter(
'/err/nat44-ed-in2out-slowpath/UDP packets')
self.assertEqual(err - udpn, 1)
@@ -4741,7 +4741,7 @@ class TestNAT44EndpointDependent(MethodHolder):
self.assertEqual(err - icmpn, 1)
err = self.statistics.get_err_counter(
'/err/nat44-ed-in2out-slowpath/good in2out packets processed')
- self.assertEqual(err - totaln, 3)
+ self.assertEqual(err - totaln, 4)
# out2in
tcpn = self.statistics.get_err_counter(
@@ -4762,7 +4762,7 @@ class TestNAT44EndpointDependent(MethodHolder):
err = self.statistics.get_err_counter(
'/err/nat44-ed-out2in/TCP packets')
- self.assertEqual(err - tcpn, 1)
+ self.assertEqual(err - tcpn, 2)
err = self.statistics.get_err_counter(
'/err/nat44-ed-out2in/UDP packets')
self.assertEqual(err - udpn, 1)
@@ -4771,7 +4771,7 @@ class TestNAT44EndpointDependent(MethodHolder):
self.assertEqual(err - icmpn, 1)
err = self.statistics.get_err_counter(
'/err/nat44-ed-out2in/good out2in packets processed')
- self.assertEqual(err - totaln, 2)
+ self.assertEqual(err - totaln, 3)
users = self.statistics.get_counter('/nat44/total-users')
self.assertEqual(users[0][0], 1)
@@ -4828,7 +4828,7 @@ class TestNAT44EndpointDependent(MethodHolder):
err = self.statistics.get_err_counter(
'/err/nat44-ed-in2out-slowpath/TCP packets')
- self.assertEqual(err - tcpn, 1)
+ self.assertEqual(err - tcpn, 2)
err = self.statistics.get_err_counter(
'/err/nat44-ed-in2out-slowpath/UDP packets')
self.assertEqual(err - udpn, 1)
@@ -4837,7 +4837,7 @@ class TestNAT44EndpointDependent(MethodHolder):
self.assertEqual(err - icmpn, 1)
err = self.statistics.get_err_counter(
'/err/nat44-ed-in2out-slowpath/good in2out packets processed')
- self.assertEqual(err - totaln, 3)
+ self.assertEqual(err - totaln, 4)
# out2in
tcpn = self.statistics.get_err_counter(
@@ -4858,7 +4858,7 @@ class TestNAT44EndpointDependent(MethodHolder):
err = self.statistics.get_err_counter(
'/err/nat44-ed-out2in/TCP packets')
- self.assertEqual(err - tcpn, 1)
+ self.assertEqual(err - tcpn, 2)
err = self.statistics.get_err_counter(
'/err/nat44-ed-out2in/UDP packets')
self.assertEqual(err - udpn, 1)
@@ -4867,7 +4867,7 @@ class TestNAT44EndpointDependent(MethodHolder):
self.assertEqual(err - icmpn, 1)
err = self.statistics.get_err_counter(
'/err/nat44-ed-out2in/good out2in packets processed')
- self.assertEqual(err - totaln, 2)
+ self.assertEqual(err - totaln, 3)
users = self.statistics.get_counter('/nat44/total-users')
self.assertEqual(users[0][0], 1)
@@ -8039,14 +8039,14 @@ class TestNAT64(MethodHolder):
self.verify_capture_in_ip6(capture, ip[IPv6].src, self.pg0.remote_ip6)
err = self.statistics.get_err_counter('/err/nat64-out2in/TCP packets')
- self.assertEqual(err - tcpn, 1)
+ self.assertEqual(err - tcpn, 2)
err = self.statistics.get_err_counter('/err/nat64-out2in/UDP packets')
self.assertEqual(err - udpn, 1)
err = self.statistics.get_err_counter('/err/nat64-out2in/ICMP packets')
self.assertEqual(err - icmpn, 1)
err = self.statistics.get_err_counter(
'/err/nat64-out2in/good out2in packets processed')
- self.assertEqual(err - totaln, 3)
+ self.assertEqual(err - totaln, 4)
bibs = self.statistics.get_counter('/nat64/total-bibs')
self.assertEqual(bibs[0][0], 3)