Ole Troan | 72d8758 | 2019-05-10 12:01:10 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | """CLI functional tests""" |
| 3 | |
| 4 | import unittest |
| 5 | from framework import VppTestCase, VppTestRunner |
| 6 | |
| 7 | |
| 8 | class TestCLI(VppTestCase): |
| 9 | """ CLI Test Case """ |
| 10 | maxDiff = None |
| 11 | |
| 12 | @classmethod |
| 13 | def setUpClass(cls): |
| 14 | super(TestCLI, cls).setUpClass() |
| 15 | |
| 16 | @classmethod |
| 17 | def tearDownClass(cls): |
| 18 | super(TestCLI, cls).tearDownClass() |
| 19 | |
| 20 | def setUp(self): |
| 21 | super(TestCLI, self).setUp() |
| 22 | |
| 23 | def tearDown(self): |
| 24 | super(TestCLI, self).tearDown() |
| 25 | |
| 26 | def test_cli_retval(self): |
| 27 | """ CLI inband retval """ |
| 28 | rv = self.vapi.papi.cli_inband(cmd='this command does not exist') |
| 29 | self.assertNotEqual(rv.retval, 0) |
| 30 | |
| 31 | rv = self.vapi.papi.cli_inband(cmd='show version') |
| 32 | self.assertEqual(rv.retval, 0) |
| 33 | |
| 34 | |
| 35 | if __name__ == '__main__': |
| 36 | unittest.main(testRunner=VppTestRunner) |