summaryrefslogtreecommitdiffstats
path: root/test/test_ip6.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-05-14 13:25:49 -0400
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2019-05-16 20:32:41 -0400
commit4271c971919bb8defa3ca54f4a362676cd57bfb2 (patch)
tree12fbe708b49f04dc5c088a2deefba0c451d95b64 /test/test_ip6.py
parentba65ca496af5766932a762bb99a758dbfcb580ec (diff)
tests: refactor. Replace literal constant w/ named constant.
* change literal packet count vlaues from 65 to a named constant of 67. (This value was recommended to exercise single, dual, and quad loops) Change-Id: Ieb1738dddacb8b6ea7fa25883032ac01a98399e1 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/test_ip6.py')
-rw-r--r--test/test_ip6.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/test_ip6.py b/test/test_ip6.py
index 6c959a2712c..7c9df465707 100644
--- a/test/test_ip6.py
+++ b/test/test_ip6.py
@@ -36,6 +36,8 @@ try:
except NameError:
text_type = str
+NUM_PKTS = 67
+
class TestIPv6ND(VppTestCase):
def validate_ra(self, intf, rx, dst_ip=None):
@@ -1308,6 +1310,7 @@ class TestIPv6RDControlPlane(TestIPv6ND):
# check FIB still contains the SLAAC address
addresses = set(self.get_interface_addresses(fib, self.pg0))
new_addresses = addresses.difference(initial_addresses)
+
self.assertEqual(len(new_addresses), 1)
prefix = list(new_addresses)[0][:8] + '\0\0\0\0\0\0\0\0'
self.assertEqual(inet_ntop(AF_INET6, prefix), '1::')
@@ -1760,7 +1763,7 @@ class TestIP6LoadBalance(VppTestCase):
src_ip_pkts = []
src_mpls_pkts = []
- for ii in range(65):
+ for ii in range(NUM_PKTS):
port_ip_hdr = (
IPv6(dst="3000::1", src="3000:1::1") /
inet6.UDP(sport=1234, dport=1234 + ii) /
@@ -2267,7 +2270,7 @@ class TestIP6Input(VppTestCase):
inet6.UDP(sport=1234, dport=1234) /
Raw('\xa5' * 100))
- rx = self.send_and_expect(self.pg0, p_version * 65, self.pg0)
+ rx = self.send_and_expect(self.pg0, p_version * NUM_PKTS, self.pg0)
rx = rx[0]
icmp = rx[ICMPv6TimeExceeded]
@@ -2306,7 +2309,7 @@ class TestIP6Input(VppTestCase):
l4 /
Raw('\xa5' * 100))
- self.send_and_assert_no_replies(self.pg0, p_version * 65,
+ self.send_and_assert_no_replies(self.pg0, p_version * NUM_PKTS,
remark=msg or "",
timeout=timeout)