blob: cfdec1fdbac82195aca0fea3e91313947d80e995 [file] [log] [blame]
Stevenb0598492018-10-24 21:15:45 -07001#!/usr/bin/env python
2
3import unittest
4
5from framework import VppTestCase, VppTestRunner
6from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
7
8
9class 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 Vinciguerra9a6dafd2019-03-06 15:11:28 -080038 self.assertNotIn("failed", error)
Stevenb0598492018-10-24 21:15:45 -070039
40if __name__ == '__main__':
41 unittest.main(testRunner=VppTestRunner)