aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_nat.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-11-24 23:19:53 -0800
committerDamjan Marion <dmarion@me.com>2018-11-26 19:53:39 +0000
commit3d2df215bf1de516ffbd8ee3815091ca3c3a492f (patch)
treed347eb7afe8911db4d819786a0f031fa4c7bb2ea /test/test_nat.py
parent6221927e9bad39c2856e844f8bc38947cb447f73 (diff)
Python3 tests: Fix asserts.
Use assert(Not)Equal() Use assert{Greater,Less}[Equal] Change-Id: I7c14570b8dce463ee13a67e9c1f10beb1a0308a8 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/test_nat.py')
-rw-r--r--test/test_nat.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test_nat.py b/test/test_nat.py
index cf5cc63cc50..59d98d94569 100644
--- a/test/test_nat.py
+++ b/test/test_nat.py
@@ -2111,7 +2111,7 @@ class TestNAT44(MethodHolder):
# general user and session dump verifications
users = self.vapi.nat44_user_dump()
- self.assertTrue(len(users) >= 3)
+ self.assertGreaterEqual(len(users), 3)
addresses = self.vapi.nat44_address_dump()
self.assertEqual(len(addresses), 1)
for user in users:
@@ -2127,7 +2127,7 @@ class TestNAT44(MethodHolder):
# pg4 session dump
sessions = self.vapi.nat44_user_session_dump(self.pg4.remote_ip4n, 10)
- self.assertTrue(len(sessions) >= 4)
+ self.assertGreaterEqual(len(sessions), 4)
for session in sessions:
self.assertFalse(session.is_static)
self.assertEqual(session.inside_ip_address[0:4],
@@ -2137,7 +2137,7 @@ class TestNAT44(MethodHolder):
# pg6 session dump
sessions = self.vapi.nat44_user_session_dump(self.pg6.remote_ip4n, 20)
- self.assertTrue(len(sessions) >= 3)
+ self.assertGreaterEqual(len(sessions), 3)
for session in sessions:
self.assertTrue(session.is_static)
self.assertEqual(session.inside_ip_address[0:4],
@@ -4146,7 +4146,7 @@ class TestNAT44EndpointDependent(MethodHolder):
server1_n += 1
else:
server2_n += 1
- self.assertTrue(server1_n > server2_n)
+ self.assertGreater(server1_n, server2_n)
def test_static_lb_2(self):
""" NAT44 local service load balancing (asymmetrical rule) """