5 from framework import VppTestCase, VppTestRunner
6 from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
9 class TestBihash(VppTestCase):
10 """ Bihash Test Cases """
14 super(TestBihash, cls).setUpClass()
17 def tearDownClass(cls):
18 super(TestBihash, cls).tearDownClass()
21 super(TestBihash, self).setUp()
24 super(TestBihash, self).tearDown()
26 def test_bihash_unittest(self):
27 """ Bihash Add/Del Test """
28 error = self.vapi.cli("test bihash careful 0 verbose 0")
31 self.logger.critical(error)
32 self.assertNotIn('failed', error)
34 def test_bihash_thread(self):
35 """ Bihash Thread Test """
37 error = self.vapi.cli("test bihash threads 2 nbuckets" +
38 " 64000 careful 0 verbose 0")
41 self.logger.critical(error)
42 self.assertNotIn('failed', error)
44 def test_bihash_vec64(self):
45 """ Bihash vec64 Test """
47 error = self.vapi.cli("test bihash vec64")
50 self.logger.critical(error)
51 self.assertNotIn('failed', error)
53 def test_bihash_coverage(self):
54 """ Improve Code Coverage """
56 error = self.vapi.cli("test bihash nitems 10 ncycles 3" +
57 "search 2 careful 1 verbose 2 non-random-keys")
60 self.logger.critical(error)
61 self.assertNotIn('failed', error)
64 if __name__ == '__main__':
65 unittest.main(testRunner=VppTestRunner)