Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 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 | |
juraj.linkes | 8e26f6d | 2018-09-19 14:59:43 +0200 | [diff] [blame] | 9 | class TestBihash(VppTestCase): |
Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 10 | """ Bihash Test Cases """ |
| 11 | |
| 12 | @classmethod |
| 13 | def setUpClass(cls): |
juraj.linkes | 8e26f6d | 2018-09-19 14:59:43 +0200 | [diff] [blame] | 14 | super(TestBihash, cls).setUpClass() |
Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 15 | |
| 16 | def setUp(self): |
juraj.linkes | 8e26f6d | 2018-09-19 14:59:43 +0200 | [diff] [blame] | 17 | super(TestBihash, self).setUp() |
Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 18 | |
| 19 | def tearDown(self): |
juraj.linkes | 8e26f6d | 2018-09-19 14:59:43 +0200 | [diff] [blame] | 20 | super(TestBihash, self).tearDown() |
Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 21 | |
| 22 | def test_bihash_unittest(self): |
| 23 | """ Bihash Add/Del Test """ |
| 24 | error = self.vapi.cli("test bihash ") |
| 25 | |
| 26 | if error: |
| 27 | self.logger.critical(error) |
Paul Vinciguerra | 9a6dafd | 2019-03-06 15:11:28 -0800 | [diff] [blame] | 28 | self.assertNotIn('failed', error) |
Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 29 | |
| 30 | def test_bihash_thread(self): |
| 31 | """ Bihash Thread Test """ |
| 32 | |
| 33 | error = self.vapi.cli("test bihash threads 2 nbuckets 64000") |
| 34 | |
| 35 | if error: |
| 36 | self.logger.critical(error) |
Paul Vinciguerra | 9a6dafd | 2019-03-06 15:11:28 -0800 | [diff] [blame] | 37 | self.assertNotIn('failed', error) |
Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 38 | |
| 39 | if __name__ == '__main__': |
| 40 | unittest.main(testRunner=VppTestRunner) |