Dave Barach | 37b4454 | 2020-04-27 18:38:36 -0400 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | import unittest |
| 4 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 5 | from framework import VppTestCase, VppTestRunner |
Dave Barach | 37b4454 | 2020-04-27 18:38:36 -0400 | [diff] [blame] | 6 | |
| 7 | |
| 8 | class TestVppinfra(VppTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame^] | 9 | """Vppinfra Unit Test Cases""" |
| 10 | |
Klement Sekera | 8d81502 | 2021-03-15 16:58:10 +0100 | [diff] [blame] | 11 | vpp_worker_count = 1 |
Dave Barach | 37b4454 | 2020-04-27 18:38:36 -0400 | [diff] [blame] | 12 | |
| 13 | @classmethod |
| 14 | def setUpClass(cls): |
| 15 | super(TestVppinfra, cls).setUpClass() |
| 16 | |
| 17 | @classmethod |
| 18 | def tearDownClass(cls): |
| 19 | super(TestVppinfra, cls).tearDownClass() |
| 20 | |
| 21 | def setUp(self): |
| 22 | super(TestVppinfra, self).setUp() |
| 23 | |
| 24 | def tearDown(self): |
| 25 | super(TestVppinfra, self).tearDown() |
| 26 | |
| 27 | def test_bitmap_unittest(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame^] | 28 | """Bitmap Code Coverage Test""" |
Dave Barach | 37b4454 | 2020-04-27 18:38:36 -0400 | [diff] [blame] | 29 | cmds = ["test bitmap"] |
| 30 | |
| 31 | for cmd in cmds: |
| 32 | r = self.vapi.cli_return_response(cmd) |
| 33 | if r.retval != 0: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame^] | 34 | if hasattr(r, "reply"): |
Dave Barach | 37b4454 | 2020-04-27 18:38:36 -0400 | [diff] [blame] | 35 | self.logger.info(cmd + " FAIL reply " + r.reply) |
| 36 | else: |
| 37 | self.logger.info(cmd + " FAIL retval " + str(r.retval)) |
| 38 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame^] | 39 | |
| 40 | if __name__ == "__main__": |
Dave Barach | 37b4454 | 2020-04-27 18:38:36 -0400 | [diff] [blame] | 41 | unittest.main(testRunner=VppTestRunner) |