ip: allow addrs from the same prefix on intf
[vpp.git] / test / test_bihash.py
1 #!/usr/bin/env python
2
3 import unittest
4
5 from framework import VppTestCase, VppTestRunner
6 from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
7
8
9 class TestBihash(VppTestCase):
10     """ Bihash Test Cases """
11
12     @classmethod
13     def setUpClass(cls):
14         super(TestBihash, cls).setUpClass()
15
16     @classmethod
17     def tearDownClass(cls):
18         super(TestBihash, cls).tearDownClass()
19
20     def setUp(self):
21         super(TestBihash, self).setUp()
22
23     def tearDown(self):
24         super(TestBihash, self).tearDown()
25
26     def test_bihash_unittest(self):
27         """ Bihash Add/Del Test """
28         error = self.vapi.cli("test bihash careful 0 verbose 0")
29
30         if error:
31             self.logger.critical(error)
32             self.assertNotIn('failed', error)
33
34     def test_bihash_thread(self):
35         """ Bihash Thread Test """
36
37         error = self.vapi.cli("test bihash threads 2 nbuckets" +
38                               " 64000 careful 0 verbose 0")
39
40         if error:
41             self.logger.critical(error)
42             self.assertNotIn('failed', error)
43
44     def test_bihash_vec64(self):
45         """ Bihash vec64 Test """
46
47         error = self.vapi.cli("test bihash vec64")
48
49         if error:
50             self.logger.critical(error)
51             self.assertNotIn('failed', error)
52
53     def test_bihash_coverage(self):
54         """ Improve Code Coverage """
55
56         error = self.vapi.cli("test bihash nitems 10 ncycles 3" +
57                               "search 2 careful 1 verbose 2 non-random-keys")
58
59         if error:
60             self.logger.critical(error)
61             self.assertNotIn('failed', error)
62
63
64 if __name__ == '__main__':
65     unittest.main(testRunner=VppTestRunner)