Steven | b059849 | 2018-10-24 21:15:45 -0700 | [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 | |
| 9 | class TestString(VppTestCase): |
| 10 | """ String Test Cases """ |
| 11 | |
| 12 | @classmethod |
| 13 | def setUpClass(cls): |
| 14 | super(TestString, cls).setUpClass() |
| 15 | |
| 16 | def setUp(self): |
| 17 | super(TestString, self).setUp() |
| 18 | |
| 19 | def tearDown(self): |
| 20 | super(TestString, self).tearDown() |
| 21 | |
| 22 | def test_string_unittest(self): |
| 23 | """ String unit tests """ |
| 24 | names = ["memcpy_s", |
| 25 | "clib_memcmp", "clib_memcpy", "clib_memset", |
| 26 | "clib_strcat", "clib_strcmp", "clib_strcpy", |
| 27 | "clib_strncat", "clib_strncmp", "clib_strncpy", |
| 28 | "clib_strnlen", "clib_strstr", "clib_strtok", |
| 29 | "memcmp_s", "memcpy_s", "memset_s ", |
| 30 | "strcat_s", "strcmp_s", "strcpy_s", |
| 31 | "strncat_s", "strncmp_s", "strncpy_s", |
| 32 | "strnlen_s", "strstr_s", "strtok_s"] |
| 33 | |
| 34 | for name in names: |
| 35 | error = self.vapi.cli("test string " + name) |
| 36 | if error.find("failed") != -1: |
| 37 | self.logger.critical("FAILURE in the " + name + " test") |
Paul Vinciguerra | 9a6dafd | 2019-03-06 15:11:28 -0800 | [diff] [blame] | 38 | self.assertNotIn("failed", error) |
Steven | b059849 | 2018-10-24 21:15:45 -0700 | [diff] [blame] | 39 | |
| 40 | if __name__ == '__main__': |
| 41 | unittest.main(testRunner=VppTestRunner) |