2018-07-23 18:00:54 -04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
from framework import VppTestCase, VppTestRunner
|
|
|
|
from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
|
|
|
|
|
|
|
|
|
2018-09-19 14:59:43 +02:00
|
|
|
class TestBihash(VppTestCase):
|
2018-07-23 18:00:54 -04:00
|
|
|
""" Bihash Test Cases """
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def setUpClass(cls):
|
2018-09-19 14:59:43 +02:00
|
|
|
super(TestBihash, cls).setUpClass()
|
2018-07-23 18:00:54 -04:00
|
|
|
|
|
|
|
def setUp(self):
|
2018-09-19 14:59:43 +02:00
|
|
|
super(TestBihash, self).setUp()
|
2018-07-23 18:00:54 -04:00
|
|
|
|
|
|
|
def tearDown(self):
|
2018-09-19 14:59:43 +02:00
|
|
|
super(TestBihash, self).tearDown()
|
2018-07-23 18:00:54 -04:00
|
|
|
|
|
|
|
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)
|