summaryrefslogtreecommitdiffstats
path: root/test/test_bihash.py
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-07-23 18:00:54 -0400
committerFlorin Coras <florin.coras@gmail.com>2018-07-24 16:45:53 +0000
commit8b5dc4fd5e6698870ca33f50079b7277aa11f24e (patch)
tree84ab955cbd72b92359e1e695b3478c4a872e6ae6 /test/test_bihash.py
parent16782368979b3af7918e54b6998c0b14dbb16da2 (diff)
Create a unit-test plugin
Move the tcp unit test to the plugin Add a bihash unit test and a "make test" program to call it Adjust framework.py to load the plugin, which is disabled by default Change-Id: Ic229d386a56a9d28dbd54974f231149053ca8f93 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'test/test_bihash.py')
-rw-r--r--test/test_bihash.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/test_bihash.py b/test/test_bihash.py
new file mode 100644
index 00000000000..a5cf065735f
--- /dev/null
+++ b/test/test_bihash.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+
+import unittest
+
+from framework import VppTestCase, VppTestRunner
+from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
+
+
+class TestTCP(VppTestCase):
+ """ Bihash Test Cases """
+
+ @classmethod
+ def setUpClass(cls):
+ super(TestTCP, cls).setUpClass()
+
+ def setUp(self):
+ super(TestTCP, self).setUp()
+
+ def tearDown(self):
+ super(TestTCP, self).tearDown()
+
+ def test_bihash_unittest(self):
+ """ Bihash Add/Del Test """
+ error = self.vapi.cli("test bihash ")
+
+ if error:
+ self.logger.critical(error)
+ self.assertEqual(error.find("failed"), -1)
+
+ def test_bihash_thread(self):
+ """ Bihash Thread Test """
+
+ error = self.vapi.cli("test bihash threads 2 nbuckets 64000")
+
+ if error:
+ self.logger.critical(error)
+ self.assertEqual(error.find("failed"), -1)
+
+if __name__ == '__main__':
+ unittest.main(testRunner=VppTestRunner)