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 | |
Paul Vinciguerra | 7f9b7f9 | 2019-03-12 19:23:27 -0700 | [diff] [blame] | 16 | @classmethod |
| 17 | def tearDownClass(cls): |
| 18 | super(TestBihash, cls).tearDownClass() |
| 19 | |
Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 20 | def setUp(self): |
juraj.linkes | 8e26f6d | 2018-09-19 14:59:43 +0200 | [diff] [blame] | 21 | super(TestBihash, self).setUp() |
Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 22 | |
| 23 | def tearDown(self): |
juraj.linkes | 8e26f6d | 2018-09-19 14:59:43 +0200 | [diff] [blame] | 24 | super(TestBihash, self).tearDown() |
Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 25 | |
| 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 Vinciguerra | 9a6dafd | 2019-03-06 15:11:28 -0800 | [diff] [blame] | 32 | self.assertNotIn('failed', error) |
Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 33 | |
| 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 Vinciguerra | 9a6dafd | 2019-03-06 15:11:28 -0800 | [diff] [blame] | 41 | self.assertNotIn('failed', error) |
Dave Barach | 8b5dc4f | 2018-07-23 18:00:54 -0400 | [diff] [blame] | 42 | |
| 43 | if __name__ == '__main__': |
| 44 | unittest.main(testRunner=VppTestRunner) |