MAP: Convert from DPO to input feature.
[vpp.git] / test / test_string.py
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")
38                 self.assertEqual(error.find("failed"), -1)
39
40 if __name__ == '__main__':
41     unittest.main(testRunner=VppTestRunner)