blob: e2256042e60f305ff3044aa02e33f46ed44f24fe [file] [log] [blame]
Dave Barach8b5dc4f2018-07-23 18:00:54 -04001#!/usr/bin/env python
2
3import unittest
4
5from framework import VppTestCase, VppTestRunner
6from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
7
8
juraj.linkes8e26f6d2018-09-19 14:59:43 +02009class TestBihash(VppTestCase):
Dave Barach8b5dc4f2018-07-23 18:00:54 -040010 """ Bihash Test Cases """
11
12 @classmethod
13 def setUpClass(cls):
juraj.linkes8e26f6d2018-09-19 14:59:43 +020014 super(TestBihash, cls).setUpClass()
Dave Barach8b5dc4f2018-07-23 18:00:54 -040015
Paul Vinciguerra7f9b7f92019-03-12 19:23:27 -070016 @classmethod
17 def tearDownClass(cls):
18 super(TestBihash, cls).tearDownClass()
19
Dave Barach8b5dc4f2018-07-23 18:00:54 -040020 def setUp(self):
juraj.linkes8e26f6d2018-09-19 14:59:43 +020021 super(TestBihash, self).setUp()
Dave Barach8b5dc4f2018-07-23 18:00:54 -040022
23 def tearDown(self):
juraj.linkes8e26f6d2018-09-19 14:59:43 +020024 super(TestBihash, self).tearDown()
Dave Barach8b5dc4f2018-07-23 18:00:54 -040025
26 def test_bihash_unittest(self):
27 """ Bihash Add/Del Test """
28 error = self.vapi.cli("test bihash ")
29
30 if error:
31 self.logger.critical(error)
Paul Vinciguerra9a6dafd2019-03-06 15:11:28 -080032 self.assertNotIn('failed', error)
Dave Barach8b5dc4f2018-07-23 18:00:54 -040033
34 def test_bihash_thread(self):
35 """ Bihash Thread Test """
36
37 error = self.vapi.cli("test bihash threads 2 nbuckets 64000")
38
39 if error:
40 self.logger.critical(error)
Paul Vinciguerra9a6dafd2019-03-06 15:11:28 -080041 self.assertNotIn('failed', error)
Dave Barach8b5dc4f2018-07-23 18:00:54 -040042
43if __name__ == '__main__':
44 unittest.main(testRunner=VppTestRunner)