ip: Replace Sematics for Interface IP addresses
[vpp.git] / test / test_string.py
1 #!/usr/bin/env python3
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     @classmethod
17     def tearDownClass(cls):
18         super(TestString, cls).tearDownClass()
19
20     def setUp(self):
21         super(TestString, self).setUp()
22
23     def tearDown(self):
24         super(TestString, self).tearDown()
25
26     def test_string_unittest(self):
27         """ String unit tests """
28         names = ["memcpy_s",
29                  "clib_memcmp", "clib_memcpy", "clib_memset",
30                  "clib_strcat", "clib_strcmp", "clib_strcpy",
31                  "clib_strncat", "clib_strncmp", "clib_strncpy",
32                  "clib_strnlen", "clib_strstr", "clib_strtok",
33                  "memcmp_s", "memcpy_s", "memset_s ",
34                  "strcat_s", "strcmp_s", "strcpy_s",
35                  "strncat_s", "strncmp_s", "strncpy_s",
36                  "strnlen_s", "strstr_s", "strtok_s"]
37
38         for name in names:
39             error = self.vapi.cli("test string " + name)
40             if error.find("failed") != -1:
41                 self.logger.critical("FAILURE in the " + name + " test")
42                 self.assertNotIn("failed", error)
43
44 if __name__ == '__main__':
45     unittest.main(testRunner=VppTestRunner)