blob: c599cf1d3b82849459f77ce9c6cb6fdf045dc343 [file] [log] [blame]
Renato Botelho do Coutoead1e532019-10-31 13:31:07 -05001#!/usr/bin/env python3
Stevenb0598492018-10-24 21:15:45 -07002
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
Paul Vinciguerra7f9b7f92019-03-12 19:23:27 -070016 @classmethod
17 def tearDownClass(cls):
18 super(TestString, cls).tearDownClass()
19
Stevenb0598492018-10-24 21:15:45 -070020 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",
Steven Luong51ddd382021-11-03 15:33:21 -070030 "clib_strcmp", "clib_strncmp", "clib_strncpy",
31 "clib_strnlen", "clib_strtok",
Stevenb0598492018-10-24 21:15:45 -070032 "memcmp_s", "memcpy_s", "memset_s ",
33 "strcat_s", "strcmp_s", "strcpy_s",
34 "strncat_s", "strncmp_s", "strncpy_s",
BenoƮt Gannef3ae9e32020-07-20 18:07:49 +020035 "strnlen_s", "strstr_s", "strtok_s", "clib_count_equal"]
Stevenb0598492018-10-24 21:15:45 -070036
37 for name in names:
38 error = self.vapi.cli("test string " + name)
39 if error.find("failed") != -1:
40 self.logger.critical("FAILURE in the " + name + " test")
Paul Vinciguerra9a6dafd2019-03-06 15:11:28 -080041 self.assertNotIn("failed", error)
Stevenb0598492018-10-24 21:15:45 -070042
Steven Luong51ddd382021-11-03 15:33:21 -070043
Stevenb0598492018-10-24 21:15:45 -070044if __name__ == '__main__':
45 unittest.main(testRunner=VppTestRunner)