summaryrefslogtreecommitdiffstats
path: root/test/test_bier.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_bier.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_bier.py')
-rw-r--r--test/test_bier.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test_bier.py b/test/test_bier.py
index cd2d4c03af9..b8130ce93f2 100644
--- a/test/test_bier.py
+++ b/test/test_bier.py
@@ -20,6 +20,8 @@ from scapy.layers.inet6 import IPv6
from scapy.contrib.mpls import MPLS
from scapy.contrib.bier import BIER, BIERLength, BIFT
+NUM_PKTS = 67
+
class TestBFIB(VppTestCase):
""" BIER FIB Test Case """
@@ -642,7 +644,7 @@ class TestBier(VppTestCase):
UDP(sport=1234, dport=1234) /
Raw(scapy.compat.chb(5) * 32))
- rx = self.send_and_expect(self.pg0, p*65, self.pg1)
+ rx = self.send_and_expect(self.pg0, p*NUM_PKTS, self.pg1)
self.assertEqual(rx[0][IP].src, "1.1.1.1")
self.assertEqual(rx[0][IP].dst, "232.1.1.1")
@@ -653,7 +655,7 @@ class TestBier(VppTestCase):
UDP(sport=1234, dport=1234) /
Raw(scapy.compat.chb(5) * 512))
- rx = self.send_and_expect(self.pg0, p*65, self.pg1)
+ rx = self.send_and_expect(self.pg0, p*NUM_PKTS, self.pg1)
self.assertEqual(rx[0][IP].src, "1.1.1.1")
self.assertEqual(rx[0][IP].dst, "232.1.1.2")