diff --git a/CMakeLists.txt b/CMakeLists.txt index c2ce922d0a19404dd47601651da9360861796fca..e867cde46e6d97a187d053bb109dc378d1e22143 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,7 @@ configure_file( # parse .proto files include(cmake/protoc.cmake) -# llt and coverage +# unit test and coverage SET(CMAKE_VERBOSE_MAKEFILE OFF) IF(ENABLE_COVERAGE) MESSAGE(STATUS "Enable coverage compile option") @@ -72,11 +72,11 @@ IF(CMAKE_BUILD_TYPE STREQUAL Debug) ENDIF() add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src) -OPTION(ENABLE_LLT "llt switch" OFF) -IF(ENABLE_LLT) +OPTION(ENABLE_UT "ut switch" OFF) +IF(ENABLE_UT) enable_testing() add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test) -ENDIF(ENABLE_LLT) +ENDIF(ENABLE_UT) # install all files install(FILES ${CMAKE_BINARY_DIR}/conf/isulad.pc diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 36aa6d14a4e172bfb3caae906fdea8f4b2bd237a..1384f0caf6459ba56285b098cef1515cfc96a4c3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -project(iSulad_LLT) +project(iSulad_UT) function(gmock_find_library _name) find_library(${_name} diff --git a/test/cmd/CMakeLists.txt b/test/cmd/CMakeLists.txt index 69dac71eb7b5b77ae5bca21defad07e94566ba02..2d4cc7518f910a00fde6056c246ef19b391f50ad 100644 --- a/test/cmd/CMakeLists.txt +++ b/test/cmd/CMakeLists.txt @@ -1,4 +1,4 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(isula) add_subdirectory(isulad-shim) diff --git a/test/cmd/isula/CMakeLists.txt b/test/cmd/isula/CMakeLists.txt index b921c1c543636a0636129e10696b04ffda3210f1..e30dfc6ffc2978317bf4fc89c47ab8e426d95f61 100644 --- a/test/cmd/isula/CMakeLists.txt +++ b/test/cmd/isula/CMakeLists.txt @@ -1,4 +1,4 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(infomation) add_subdirectory(extend) diff --git a/test/cmd/isula/extend/CMakeLists.txt b/test/cmd/isula/extend/CMakeLists.txt index 6546ebc5d04949a7d35e796fc09d70d952da2622..d9a75580ae7ea51ad898abfeb53917ad5ab9074c 100644 --- a/test/cmd/isula/extend/CMakeLists.txt +++ b/test/cmd/isula/extend/CMakeLists.txt @@ -1,4 +1,4 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(pause) add_subdirectory(resume) diff --git a/test/cmd/isula/extend/pause/CMakeLists.txt b/test/cmd/isula/extend/pause/CMakeLists.txt index 389ec4dbd3d75be67192da7c0a4f10904d2a6d66..90fe8e351abe3f6913ad27db8004d022766b9f67 100644 --- a/test/cmd/isula/extend/pause/CMakeLists.txt +++ b/test/cmd/isula/extend/pause/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE pause_llt) +SET(EXE pause_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/cutils/utils_string.c @@ -27,7 +27,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/cmd/isula/extend/pause.c # ${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/LcrcConnectMock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/grpc_client_mock.cc - pause_llt.cc) + pause_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/cmd/isula/extend/pause/pause_llt.cc b/test/cmd/isula/extend/pause/pause_ut.cpp similarity index 100% rename from test/cmd/isula/extend/pause/pause_llt.cc rename to test/cmd/isula/extend/pause/pause_ut.cpp diff --git a/test/cmd/isula/extend/resume/CMakeLists.txt b/test/cmd/isula/extend/resume/CMakeLists.txt index 787b3554edabce1bfcc9e877d6c0d87f0d170c5b..c3fa7ec77b6e9207cd084df55e7db5567504fa6c 100644 --- a/test/cmd/isula/extend/resume/CMakeLists.txt +++ b/test/cmd/isula/extend/resume/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE resume_llt) +SET(EXE resume_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/cutils/utils_string.c @@ -27,7 +27,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/cmd/isula/extend/resume.c # ${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/LcrcConnectMock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/grpc_client_mock.cc - resume_llt.cc) + resume_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/cmd/isula/extend/resume/resume_llt.cc b/test/cmd/isula/extend/resume/resume_ut.cpp similarity index 100% rename from test/cmd/isula/extend/resume/resume_llt.cc rename to test/cmd/isula/extend/resume/resume_ut.cpp diff --git a/test/cmd/isula/infomation/CMakeLists.txt b/test/cmd/isula/infomation/CMakeLists.txt index 80e0fb750909aefe8e66a700d1b4c4c72531551c..47caa6d0dd49d8c6223bf7193b4a354bc6395509 100644 --- a/test/cmd/isula/infomation/CMakeLists.txt +++ b/test/cmd/isula/infomation/CMakeLists.txt @@ -1,4 +1,4 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(ps) add_subdirectory(info) diff --git a/test/cmd/isula/infomation/info/CMakeLists.txt b/test/cmd/isula/infomation/info/CMakeLists.txt index 497d98a61f5973da46a2e02cb024cb94f5db8906..6cca0bc45e6559cda07035df90e03bbdf3ebbfc2 100644 --- a/test/cmd/isula/infomation/info/CMakeLists.txt +++ b/test/cmd/isula/infomation/info/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE info_llt) +SET(EXE info_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/cutils/utils_string.c @@ -27,7 +27,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/connect/client/isula_connect.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/cmd/isula/information/info.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/grpc_client_mock.cc - info_llt.cc) + info_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/cmd/isula/infomation/info/info_llt.cc b/test/cmd/isula/infomation/info/info_ut.cpp similarity index 100% rename from test/cmd/isula/infomation/info/info_llt.cc rename to test/cmd/isula/infomation/info/info_ut.cpp diff --git a/test/cmd/isula/infomation/ps/CMakeLists.txt b/test/cmd/isula/infomation/ps/CMakeLists.txt index f514b24ba8d3ffca1deb8302fbaf4725f4ab7c5b..275fbdb883ebada1b67bf78eda1fe637343be422 100644 --- a/test/cmd/isula/infomation/ps/CMakeLists.txt +++ b/test/cmd/isula/infomation/ps/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE ps_llt) +SET(EXE ps_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/cutils/utils_string.c @@ -26,7 +26,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/connect/client/isula_connect.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/cmd/isula/information/ps.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/grpc_client_mock.cc - ps_llt.cc) + ps_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/cmd/isula/infomation/ps/ps_llt.cc b/test/cmd/isula/infomation/ps/ps_ut.cpp similarity index 99% rename from test/cmd/isula/infomation/ps/ps_llt.cc rename to test/cmd/isula/infomation/ps/ps_ut.cpp index e5e863b9c79ec450e57d7e5cc1bf50489e21e95e..643d8fa658755a6c4201a0c5fa1fff6de3bb11cc 100644 --- a/test/cmd/isula/infomation/ps/ps_llt.cc +++ b/test/cmd/isula/infomation/ps/ps_ut.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved. - * Description: ps llt + * Description: ps unit test * Author: wujing * Create: 2019-12-19 */ diff --git a/test/cmd/isulad-shim/CMakeLists.txt b/test/cmd/isulad-shim/CMakeLists.txt index 92b6575741ce1577ad9c981b61047cde1dc0f675..c720beb4ce0f9464d1811f93e7517eb820c6ec85 100644 --- a/test/cmd/isulad-shim/CMakeLists.txt +++ b/test/cmd/isulad-shim/CMakeLists.txt @@ -1,12 +1,12 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE isulad-shim_llt) +SET(EXE isulad-shim_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/isulad-shim/process.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/isulad-shim/common.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/isulad-shim/terminal.c - isulad-shim_llt.cc) + isulad-shim_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/cmd/isulad-shim/isulad-shim_llt.cc b/test/cmd/isulad-shim/isulad-shim_ut.cpp similarity index 98% rename from test/cmd/isulad-shim/isulad-shim_llt.cc rename to test/cmd/isulad-shim/isulad-shim_ut.cpp index 6406291d336865e3cf5a85361a0028b7f09b14b5..e5a983af30894e671a46f04e7c3a26c4f1cc3941 100644 --- a/test/cmd/isulad-shim/isulad-shim_llt.cc +++ b/test/cmd/isulad-shim/isulad-shim_ut.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * Description: isulad-shim llt + * Description: isulad-shim unit test * Author: leizhongkai * Create: 2020-02-25 */ diff --git a/test/cutils/CMakeLists.txt b/test/cutils/CMakeLists.txt index de832f9ebd33fbcb19504e0997d6533737a502e5..83fc92be00967925ecbf329430c830d30d13e8a5 100644 --- a/test/cutils/CMakeLists.txt +++ b/test/cutils/CMakeLists.txt @@ -1,4 +1,4 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(utils_string) add_subdirectory(utils_convert) diff --git a/test/cutils/utils_array/CMakeLists.txt b/test/cutils/utils_array/CMakeLists.txt index 7973eb8cda4358829efa16ce673de189e411c171..157642663013692d4d8f10cfc08625a6fccf65b8 100644 --- a/test/cutils/utils_array/CMakeLists.txt +++ b/test/cutils/utils_array/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE utils_array_llt) +SET(EXE utils_array_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cutils/utils_string.c @@ -14,7 +14,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/map/map.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/map/rb_tree.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cutils/path.c - utils_array_llt.cc) + utils_array_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/cutils/utils_array/utils_array_llt.cc b/test/cutils/utils_array/utils_array_ut.cpp similarity index 99% rename from test/cutils/utils_array/utils_array_llt.cc rename to test/cutils/utils_array/utils_array_ut.cpp index 4f74f55db1b70f67e7c53eae97d99cd1fe9682c2..93847429b94400f4af46c69c49f92c83e2ec0f31 100644 --- a/test/cutils/utils_array/utils_array_llt.cc +++ b/test/cutils/utils_array/utils_array_ut.cpp @@ -8,7 +8,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: utils_array llt + * Description: utils_array unit test * Author: tanyifeng * Create: 2019-09-24 */ diff --git a/test/cutils/utils_convert/CMakeLists.txt b/test/cutils/utils_convert/CMakeLists.txt index 50ecae02930c343acb9d7f4bc0469417ee8b9ff8..ae9d5feba611f88902dccd0d1af7b35254dab2ff 100644 --- a/test/cutils/utils_convert/CMakeLists.txt +++ b/test/cutils/utils_convert/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE utils_convert_llt) +SET(EXE utils_convert_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cutils/utils_string.c @@ -14,7 +14,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cutils/path.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/map/map.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/map/rb_tree.c - utils_convert_llt.cc) + utils_convert_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/cutils/utils_convert/utils_convert_llt.cc b/test/cutils/utils_convert/utils_convert_ut.cpp similarity index 99% rename from test/cutils/utils_convert/utils_convert_llt.cc rename to test/cutils/utils_convert/utils_convert_ut.cpp index 617a52fb6a2914d3907dea9c11cbf0dd79444fc8..a351ef5210ce370cfab3d6f4dd12629b87717dbb 100644 --- a/test/cutils/utils_convert/utils_convert_llt.cc +++ b/test/cutils/utils_convert/utils_convert_ut.cpp @@ -8,7 +8,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: utils_convert llt + * Description: utils_convert unit test * Author: tanyifeng * Create: 2019-07-08 */ diff --git a/test/cutils/utils_string/CMakeLists.txt b/test/cutils/utils_string/CMakeLists.txt index 562a50ece328343f19567998f22e09ea3bf24359..e43ec2e3a90c49768b3a7c683c34394ec0d4f3a9 100644 --- a/test/cutils/utils_string/CMakeLists.txt +++ b/test/cutils/utils_string/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE utils_string_llt) +SET(EXE utils_string_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cutils/utils_string.c @@ -14,7 +14,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/map/map.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/map/rb_tree.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cutils/path.c - utils_string_llt.cc) + utils_string_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/cutils/utils_string/utils_string_llt.cc b/test/cutils/utils_string/utils_string_ut.cpp similarity index 96% rename from test/cutils/utils_string/utils_string_llt.cc rename to test/cutils/utils_string/utils_string_ut.cpp index 207809b4b9fb26539b6f5dbd4e72ff51c9df0383..1d5b6e4677f812d33d0db645cd050baba1173377 100644 --- a/test/cutils/utils_string/utils_string_llt.cc +++ b/test/cutils/utils_string/utils_string_ut.cpp @@ -8,7 +8,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: utils_string llt + * Description: utils_string unit test * Author: tanyifeng * Create: 2019-07-08 */ @@ -27,7 +27,7 @@ extern "C" { DEFINE_WRAPPER(calloc, void *, (size_t nmemb, size_t size), (nmemb, size)); } -TEST(utils_string_llt, test_strings_count) +TEST(utils_string_ut, test_strings_count) { ASSERT_EQ(strings_count("aaaaaaaaaaaaaaaaaaaa", 'a'), 20); ASSERT_EQ(strings_count("a", 'a'), 1); @@ -35,7 +35,7 @@ TEST(utils_string_llt, test_strings_count) ASSERT_EQ(strings_count(nullptr, 'c'), 0); } -TEST(utils_string_llt, test_strings_contains_any) +TEST(utils_string_ut, test_strings_contains_any) { ASSERT_EQ(strings_contains_any("1234567890abcdefgh!@", "ijklmnopq#123456789"), true); ASSERT_EQ(strings_contains_any("1234567890abcdefgh!@", "ijklmnopqrstuvw)(*x&-"), false); @@ -47,7 +47,7 @@ TEST(utils_string_llt, test_strings_contains_any) } -TEST(utils_string_llt, test_strings_to_lower) +TEST(utils_string_ut, test_strings_to_lower) { char *result = nullptr; @@ -86,7 +86,7 @@ TEST(utils_string_llt, test_strings_to_lower) MOCK_CLEAR(util_strdup_s); } -TEST(utils_string_llt, test_strings_to_upper) +TEST(utils_string_ut, test_strings_to_upper) { char *result = nullptr; @@ -125,7 +125,7 @@ TEST(utils_string_llt, test_strings_to_upper) } -TEST(utils_string_llt, test_strings_in_slice) +TEST(utils_string_ut, test_strings_in_slice) { const char *array_long[] = { "abcd", "1234", nullptr, "", "&^%abc" }; size_t array_long_len = sizeof(array_long) / sizeof(array_long[0]); @@ -143,7 +143,7 @@ TEST(utils_string_llt, test_strings_in_slice) ASSERT_FALSE(strings_in_slice(nullptr, 0, nullptr)); } -TEST(utils_string_llt, test_util_parse_byte_size_string) +TEST(utils_string_ut, test_util_parse_byte_size_string) { int64_t converted = 0; int ret; @@ -279,7 +279,7 @@ TEST(utils_string_llt, test_util_parse_byte_size_string) MOCK_CLEAR(util_strdup_s); } -TEST(utils_string_llt, test_util_string_split_multi) +TEST(utils_string_ut, test_util_string_split_multi) { char **result = nullptr; @@ -363,7 +363,7 @@ TEST(utils_string_llt, test_util_string_split_multi) MOCK_CLEAR(calloc); } -TEST(utils_string_llt, test_util_string_split) +TEST(utils_string_ut, test_util_string_split) { char **result = nullptr; @@ -437,7 +437,7 @@ TEST(utils_string_llt, test_util_string_split) MOCK_CLEAR(calloc); } -TEST(utils_string_llt, test_str_skip_str) +TEST(utils_string_ut, test_str_skip_str) { const char *str = "abcdefghij1234567890"; const char *substr = "abcdefgh"; @@ -465,7 +465,7 @@ TEST(utils_string_llt, test_str_skip_str) ASSERT_STREQ(result, nullptr); } -TEST(utils_string_llt, test_util_string_delchar) +TEST(utils_string_ut, test_util_string_delchar) { char *result = nullptr; @@ -490,7 +490,7 @@ TEST(utils_string_llt, test_util_string_delchar) MOCK_CLEAR(util_strdup_s); } -TEST(utils_string_llt, test_util_trim_newline) +TEST(utils_string_ut, test_util_trim_newline) { char s_all[ ] = { '\n', '\n', '\n', '\n', '\0' }; char s_tail[ ] = { '\n', 'a', '\n', 'b', '\n', '\0' }; @@ -514,7 +514,7 @@ TEST(utils_string_llt, test_util_trim_newline) ASSERT_STREQ(s_nullptr, nullptr); } -TEST(utils_string_llt, test_util_trim_space) +TEST(utils_string_ut, test_util_trim_space) { char s_all[ ] = { '\f', '\n', '\r', '\t', '\v', ' ', '\0' }; char s_head[ ] = { '\f', '\n', '\r', 'a', 'b', 'c', '\0' }; @@ -551,7 +551,7 @@ TEST(utils_string_llt, test_util_trim_space) ASSERT_STREQ(result, nullptr); } -TEST(utils_string_llt, test_util_trim_quotation) +TEST(utils_string_ut, test_util_trim_quotation) { char s_all[ ] = { '"', '"', '"', '\n', '"', '\0' }; char s_head[ ] = { '"', '"', 'a', 'b', 'c', '\0' }; @@ -592,7 +592,7 @@ TEST(utils_string_llt, test_util_trim_quotation) ASSERT_STREQ(result, nullptr); } -TEST(utils_string_llt, test_str_array_dup) +TEST(utils_string_ut, test_str_array_dup) { const char *array_long[] = { "abcd", "1234", nullptr, "", "&^%abc" }; size_t array_long_len = sizeof(array_long) / sizeof(array_long[0]); @@ -627,7 +627,7 @@ TEST(utils_string_llt, test_str_array_dup) ASSERT_EQ(result, nullptr); } -TEST(utils_string_llt, test_util_string_join) +TEST(utils_string_ut, test_util_string_join) { const char *array_long[] = { "abcd", "1234", "5678", "", "&^%abc" }; size_t array_long_len = sizeof(array_long) / sizeof(array_long[0]); @@ -662,7 +662,7 @@ TEST(utils_string_llt, test_util_string_join) ASSERT_STREQ(result, nullptr); } -TEST(utils_string_llt, test_util_string_append) +TEST(utils_string_ut, test_util_string_append) { char *result = nullptr; @@ -707,7 +707,7 @@ TEST(utils_string_llt, test_util_string_append) MOCK_CLEAR(calloc); } -TEST(utils_string_llt, test_dup_array_of_strings) +TEST(utils_string_ut, test_dup_array_of_strings) { const char *array_long[] = { "abcd", "1234", nullptr, "", "&^%abc" }; size_t array_long_len = sizeof(array_long) / sizeof(array_long[0]); @@ -757,7 +757,7 @@ TEST(utils_string_llt, test_dup_array_of_strings) MOCK_CLEAR(calloc); } -TEST(utils_string_llt, test_parse_percent_string) +TEST(utils_string_ut, test_parse_percent_string) { long converted = 0; int ret = 0; diff --git a/test/image/CMakeLists.txt b/test/image/CMakeLists.txt index b82d2b00ca0a027daaf5567d5b6825db784e00cd..cfda2b0a5f9700bfb7275b7fcb4e375ab640fb5f 100644 --- a/test/image/CMakeLists.txt +++ b/test/image/CMakeLists.txt @@ -1,3 +1,3 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(oci) diff --git a/test/image/oci/CMakeLists.txt b/test/image/oci/CMakeLists.txt index 78cd9c43d05b9106e15cd94061290f7a9058e825..cc58cbfedf1c3bb14430c07bcddb62c8c1878344 100644 --- a/test/image/oci/CMakeLists.txt +++ b/test/image/oci/CMakeLists.txt @@ -1,3 +1,3 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(oci_config_merge) diff --git a/test/image/oci/oci_config_merge/CMakeLists.txt b/test/image/oci/oci_config_merge/CMakeLists.txt index b0ae332aa9ef2756ee9d0e9adac77991a499c7f1..83c2442229f2ad7128097724e9ca870c3cd58ec9 100644 --- a/test/image/oci/oci_config_merge/CMakeLists.txt +++ b/test/image/oci/oci_config_merge/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE oci_config_merge_llt) +SET(EXE oci_config_merge_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/image/oci/oci_config_merge.c @@ -22,13 +22,13 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/services/execution/spec/sysinfo.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/cmd/commander.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/cmd/isulad/arguments.c - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../test/image/oci/oci_llt_common.cc + ${CMAKE_CURRENT_SOURCE_DIR}/../../../../test/image/oci/oci_ut_common.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../../test/mocks/containers_store_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../../test/mocks/namespace_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../../test/mocks/container_unix_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/services/execution/spec/specs_mount.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../test/mocks/selinux_label_mock.cc - oci_config_merge_llt.cc) + oci_config_merge_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/image/oci/oci_config_merge/oci_config_merge_llt.cc b/test/image/oci/oci_config_merge/oci_config_merge_ut.cpp similarity index 99% rename from test/image/oci/oci_config_merge/oci_config_merge_llt.cc rename to test/image/oci/oci_config_merge/oci_config_merge_ut.cpp index d7f7b72bb28e320aca374948173087c367ce8779..f9a902e6c90c2674a819e068e3a437fc0d61d2b3 100644 --- a/test/image/oci/oci_config_merge/oci_config_merge_llt.cc +++ b/test/image/oci/oci_config_merge/oci_config_merge_ut.cpp @@ -8,7 +8,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: oci_config_merge llt + * Description: oci_config_merge unit test * Author: wangfengtu * Create: 2019-08-20 */ @@ -21,7 +21,7 @@ #include "isula_libutils/imagetool_image.h" #include "isula_libutils/container_config.h" #include "oci_config_merge.h" -#include "oci_llt_common.h" +#include "oci_ut_common.h" #define IMAGETOOL_IMAGE_FILE "image/oci/oci_config_merge/imagetool_image.json" #define OCI_RUNTIME_SPEC_FILE "image/oci/oci_config_merge/oci_runtime_spec.json" @@ -68,7 +68,7 @@ void *util_smart_calloc_s_fail(size_t size, size_t len) } } -TEST(oci_config_merge_llt, test_oci_image_merge_config) +TEST(oci_config_merge_ut, test_oci_image_merge_config) { char *imagetool_image_file = NULL; imagetool_image *tool_image = NULL; diff --git a/test/image/oci/oci_llt_common.cc b/test/image/oci/oci_ut_common.cpp similarity index 96% rename from test/image/oci/oci_llt_common.cc rename to test/image/oci/oci_ut_common.cpp index 2a66eed07c85afa2e7af2587d588f08a6e2f9e6c..c3924cd4b92a7e2383b7663804a24fbf4e654789 100644 --- a/test/image/oci/oci_llt_common.cc +++ b/test/image/oci/oci_ut_common.cpp @@ -8,7 +8,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: oci_rootfs_remove llt + * Description: oci_rootfs_remove unit test * Author: wangfengtu * Create: 2019-08-29 */ @@ -18,7 +18,7 @@ #include #include #include "utils.h" -#include "oci_llt_common.h" +#include "oci_ut_common.h" int execvp_success(const char *file, char * const argv[]) { diff --git a/test/image/oci/oci_llt_common.h b/test/image/oci/oci_ut_common.h similarity index 95% rename from test/image/oci/oci_llt_common.h rename to test/image/oci/oci_ut_common.h index 7394b124f37347d75a24256cfd92a1616a705fcd..e891bfc97c98060db344be94ee5c59e1c1eb4cca 100644 --- a/test/image/oci/oci_llt_common.h +++ b/test/image/oci/oci_ut_common.h @@ -8,24 +8,24 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: oci_rootfs_remove llt + * Description: oci_rootfs_remove unit test * Author: wangfengtu * Create: 2019-08-29 */ -#ifndef __OCI_LLT_COMMON_H -#define __OCI_LLT_COMMON_H +#ifndef __OCI_UT_COMMON_H +#define __OCI_UT_COMMON_H #include #include #include "utils.h" -#include "oci_llt_common.h" +#include "oci_ut_common.h" #ifdef __cplusplus extern "C" { #endif -#define DECLARE_OCI_LLT_COMMON_WRAPPER \ +#define DECLARE_OCI_UT_COMMON_WRAPPER \ extern "C" {\ DECLARE_WRAPPER_V(conf_get_graph_rootpath, char *, ());\ DEFINE_WRAPPER_V(conf_get_graph_rootpath, char *, (), ());\ diff --git a/test/path/CMakeLists.txt b/test/path/CMakeLists.txt index 979becb0f50cf8ad18976d8b38dc4bfcc03be5b1..eb22818c86960f03a4f1fea8c40982109ac0cea1 100644 --- a/test/path/CMakeLists.txt +++ b/test/path/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE path_llt) +SET(EXE path_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../src/cutils/utils.c @@ -14,7 +14,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../src/cutils/utils_regex.c ${CMAKE_CURRENT_SOURCE_DIR}/../../src/cutils/utils_verify.c ${CMAKE_CURRENT_SOURCE_DIR}/../../src/sha256/sha256.c - path_llt.cc) + path_ut.cpp) target_include_directories(${EXE} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include diff --git a/test/path/path_llt.cc b/test/path/path_ut.cpp similarity index 93% rename from test/path/path_llt.cc rename to test/path/path_ut.cpp index 1738306475605a061e4b82d77d5cc544d829fec8..afd164ab90e9a2fddf511ef25307522649fcb392 100644 --- a/test/path/path_llt.cc +++ b/test/path/path_ut.cpp @@ -8,7 +8,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: path llt + * Description: path unit test * Author: jikui * Create: 2019-08-22 */ @@ -87,7 +87,7 @@ static ssize_t readlink_specify(const char *path, char *buf, size_t bufsize) return linkpath_length; } -TEST(path_llt, test_cleanpath) +TEST(path_ut, test_cleanpath) { char *result = nullptr; std::string str; @@ -123,7 +123,7 @@ TEST(path_llt, test_cleanpath) ASSERT_STREQ(result, nullptr); } -TEST(path_llt, test_specify_current_dir) +TEST(path_ut, test_specify_current_dir) { ASSERT_FALSE(specify_current_dir(nullptr)); ASSERT_TRUE(specify_current_dir("")); @@ -135,7 +135,7 @@ TEST(path_llt, test_specify_current_dir) ASSERT_FALSE(specify_current_dir("home")); } -TEST(path_llt, test_follow_symlink_in_scope) +TEST(path_ut, test_follow_symlink_in_scope) { std::string fullpath, rootpath; char *res = nullptr; @@ -173,22 +173,22 @@ TEST(path_llt, test_follow_symlink_in_scope) free(res); res = nullptr; - fullpath = "/tmp/just_for_llt/link"; + fullpath = "/tmp/just_for_ut/link"; rootpath = "/tmp"; - const char *path = "/tmp/just_for_llt"; + const char *path = "/tmp/just_for_ut"; const char *path_file = "./testdir/test/../file"; - const char *path_link = "/tmp/just_for_llt/link"; + const char *path_link = "/tmp/just_for_ut/link"; ASSERT_EQ(create_tmp_symbolic_link(path, path_file, path_link), 0); MOCK_SET_V(readlink, readlink_specify); res = follow_symlink_in_scope(fullpath.c_str(), rootpath.c_str()); - ASSERT_STREQ(res, "/tmp/just_for_llt/dir/file"); + ASSERT_STREQ(res, "/tmp/just_for_ut/dir/file"); MOCK_CLEAR(readlink); - ASSERT_EQ(util_recursive_rmdir("/tmp/just_for_llt", 0), 0); + ASSERT_EQ(util_recursive_rmdir("/tmp/just_for_ut", 0), 0); free(res); res = nullptr; } -TEST(path_llt, test_split_dir_and_base_name) +TEST(path_ut, test_split_dir_and_base_name) { char *dir = nullptr; char *base = nullptr; @@ -226,7 +226,7 @@ TEST(path_llt, test_split_dir_and_base_name) base = nullptr; } -TEST(path_llt, test_filepath_split) +TEST(path_ut, test_filepath_split) { char *dir = nullptr; char *base = nullptr; @@ -272,7 +272,7 @@ TEST(path_llt, test_filepath_split) base = nullptr; } -TEST(path_llt, test_get_resource_path) +TEST(path_ut, test_get_resource_path) { char *res = nullptr; @@ -307,7 +307,7 @@ TEST(path_llt, test_get_resource_path) res = nullptr; } -TEST(path_llt, test_resolve_path) +TEST(path_ut, test_resolve_path) { std::string rootpath, path; char *resolvedpath = nullptr; @@ -336,7 +336,7 @@ TEST(path_llt, test_resolve_path) abspath = nullptr; } -TEST(path_llt, test_has_trailing_path_separator) +TEST(path_ut, test_has_trailing_path_separator) { ASSERT_FALSE(has_trailing_path_separator(nullptr)); ASSERT_FALSE(has_trailing_path_separator("")); @@ -344,7 +344,7 @@ TEST(path_llt, test_has_trailing_path_separator) ASSERT_FALSE(has_trailing_path_separator("/home")); } -TEST(path_llt, test_preserve_trailing_dot_or_separator) +TEST(path_ut, test_preserve_trailing_dot_or_separator) { std::string cleanedpath, originalpath; char *res = nullptr; diff --git a/test/runtime/CMakeLists.txt b/test/runtime/CMakeLists.txt index 3d6b5df442e2f6cd16dd1fe4b643c9a857988e3c..b00535cf3fd8bce8b6e074461d8cfc3079a02943 100644 --- a/test/runtime/CMakeLists.txt +++ b/test/runtime/CMakeLists.txt @@ -1,4 +1,4 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(lcr) add_subdirectory(isula) diff --git a/test/runtime/isula/CMakeLists.txt b/test/runtime/isula/CMakeLists.txt index cb7e626db93769f37018221ea6a20a024a9ba683..ba608dfad215ace07a69545e9a70b6941d1f4bbb 100644 --- a/test/runtime/isula/CMakeLists.txt +++ b/test/runtime/isula/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE isula_rt_ops_llt) +SET(EXE isula_rt_ops_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cutils/utils.c @@ -17,14 +17,14 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/services/execution/spec/sysinfo.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/commander.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/isulad/arguments.c - ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_llt_common.cc + ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_ut_common.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/containers_store_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/namespace_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/container_unix_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/engine_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/isulad_config_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/runtime/isula/isula_rt_ops.c - isula_rt_ops_llt.cc) + isula_rt_ops_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/runtime/isula/isula_rt_ops_llt.cc b/test/runtime/isula/isula_rt_ops_ut.cpp similarity index 98% rename from test/runtime/isula/isula_rt_ops_llt.cc rename to test/runtime/isula/isula_rt_ops_ut.cpp index f807877386189c36c6252f713621071e31bb05dc..edb1eb6a1b3856f8889a28cb0b1afac096e48dfb 100644 --- a/test/runtime/isula/isula_rt_ops_llt.cc +++ b/test/runtime/isula/isula_rt_ops_ut.cpp @@ -8,7 +8,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: isula runtime ops llt + * Description: isula runtime ops unit test * Author: jingrui * Create: 2020-02-15 */ @@ -57,7 +57,7 @@ public: NiceMock m_isulad_conf; }; -TEST(isula_rt_ops_llt, test_rt_isula_detect) +TEST(isula_rt_ops_ut, test_rt_isula_detect) { // All parameter NULL ASSERT_FALSE(rt_isula_detect(NULL)); diff --git a/test/runtime/lcr/CMakeLists.txt b/test/runtime/lcr/CMakeLists.txt index 3b67a72d2ef25c9338f1d9e65a70644aab79e4f3..85bd04aca6955acac5c9c43428632554f0945cf1 100644 --- a/test/runtime/lcr/CMakeLists.txt +++ b/test/runtime/lcr/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE lcr_rt_ops_llt) +SET(EXE lcr_rt_ops_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cutils/utils.c @@ -19,14 +19,14 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/services/execution/spec/sysinfo.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/commander.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/isulad/arguments.c - ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_llt_common.cc + ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_ut_common.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/containers_store_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/namespace_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/container_unix_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/engine_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/isulad_config_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/runtime/lcr/lcr_rt_ops.c - lcr_rt_ops_llt.cc) + lcr_rt_ops_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/runtime/lcr/lcr_rt_ops_llt.cc b/test/runtime/lcr/lcr_rt_ops_ut.cpp similarity index 99% rename from test/runtime/lcr/lcr_rt_ops_llt.cc rename to test/runtime/lcr/lcr_rt_ops_ut.cpp index ef9a3f63389936a8de31a69c2c51037c638936bb..59b8461a5eb58f715690baffe0d1af81c5e7132b 100644 --- a/test/runtime/lcr/lcr_rt_ops_llt.cc +++ b/test/runtime/lcr/lcr_rt_ops_ut.cpp @@ -8,7 +8,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: lcr runtime ops llt + * Description: lcr runtime ops unit test * Author: lifeng * Create: 2020-02-15 */ @@ -57,7 +57,7 @@ public: NiceMock m_isulad_conf; }; -TEST(lcr_rt_ops_llt, test_rt_lcr_detect) +TEST(lcr_rt_ops_ut, test_rt_lcr_detect) { // All parameter NULL ASSERT_FALSE(rt_lcr_detect(NULL)); diff --git a/test/services/CMakeLists.txt b/test/services/CMakeLists.txt index 08e07358ce483b1227e3512e57fc3d5135329b15..7d123e726643d145544ea6433bb6d2d46d9bb675 100644 --- a/test/services/CMakeLists.txt +++ b/test/services/CMakeLists.txt @@ -1,4 +1,4 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(graphdriver) add_subdirectory(execution) diff --git a/test/services/execution/CMakeLists.txt b/test/services/execution/CMakeLists.txt index 724c02e94df30eae4986da5ce9927791d515d726..2481c7441494d36ae123bb6fa6807defb9868833 100644 --- a/test/services/execution/CMakeLists.txt +++ b/test/services/execution/CMakeLists.txt @@ -1,4 +1,4 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(spec) add_subdirectory(execute) diff --git a/test/services/execution/execute/CMakeLists.txt b/test/services/execution/execute/CMakeLists.txt index a03abafb88a3220d4fb0f77fcd4d591b12c0b03b..bc84915154b8fe92eea30837fc06955ca13869a2 100644 --- a/test/services/execution/execute/CMakeLists.txt +++ b/test/services/execution/execute/CMakeLists.txt @@ -1,3 +1,3 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(execution_extend) diff --git a/test/services/execution/execute/execution_extend/CMakeLists.txt b/test/services/execution/execute/execution_extend/CMakeLists.txt index 2faa258ac870de2eb7ec35ff99a676e3a5c668bd..47339b7ee205693665037b9ffb396cc1a66eba40 100644 --- a/test/services/execution/execute/execution_extend/CMakeLists.txt +++ b/test/services/execution/execute/execution_extend/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE execution_extend_llt) +SET(EXE execution_extend_ut) add_executable(${EXE} @@ -41,7 +41,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/driver_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/restartmanager_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/specs_mock.cc - execution_extend_llt.cc) + execution_extend_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/services/execution/execute/execution_extend/execution_extend_llt.cc b/test/services/execution/execute/execution_extend/execution_extend_ut.cpp similarity index 99% rename from test/services/execution/execute/execution_extend/execution_extend_llt.cc rename to test/services/execution/execute/execution_extend/execution_extend_ut.cpp index 053755473fe54a676a28f944e1cd5a9cf01bb64a..71cef0f9cff3cd1bc415ba009d19084556d6f478 100644 --- a/test/services/execution/execute/execution_extend/execution_extend_llt.cc +++ b/test/services/execution/execute/execution_extend/execution_extend_ut.cpp @@ -10,7 +10,7 @@ * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 - * Description: provide execution_extend llt test + * Description: provide execution_extend unit test ******************************************************************************/ #include "execution_extend.h" diff --git a/test/services/execution/spec/CMakeLists.txt b/test/services/execution/spec/CMakeLists.txt index 522dac92192e5c674752828b552bd844cdd8c452..54f3675f7ae213871db4a8a6976d92cc1852bfc3 100644 --- a/test/services/execution/spec/CMakeLists.txt +++ b/test/services/execution/spec/CMakeLists.txt @@ -1,7 +1,7 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE selinux_label_llt) -SET(MOCK_EXE selinux_label_mock_llt) +SET(EXE selinux_label_ut) +SET(MOCK_EXE selinux_label_mock_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/cutils/utils.c @@ -18,7 +18,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libisulad.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../mocks/namespace_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/services/execution/spec/selinux_label.c - selinux_label_llt.cc) + selinux_label_ut.cpp) add_executable(${MOCK_EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/cutils/utils.c @@ -37,7 +37,7 @@ add_executable(${MOCK_EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../mocks/syscall_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../mocks/selinux_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/services/execution/spec/selinux_label.c - selinux_label_mock_llt.cc) + selinux_label_mock_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/services/execution/spec/selinux_label_mock_llt.cc b/test/services/execution/spec/selinux_label_mock_ut.cpp similarity index 100% rename from test/services/execution/spec/selinux_label_mock_llt.cc rename to test/services/execution/spec/selinux_label_mock_ut.cpp diff --git a/test/services/execution/spec/selinux_label_llt.cc b/test/services/execution/spec/selinux_label_ut.cpp similarity index 100% rename from test/services/execution/spec/selinux_label_llt.cc rename to test/services/execution/spec/selinux_label_ut.cpp diff --git a/test/services/graphdriver/CMakeLists.txt b/test/services/graphdriver/CMakeLists.txt index 49f78e6f47adfab9e82155446dfad447c28a476b..2e3e3e2b3ebab837a5781b0cb1dd05873c22d31e 100644 --- a/test/services/graphdriver/CMakeLists.txt +++ b/test/services/graphdriver/CMakeLists.txt @@ -1,3 +1,3 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(driver) diff --git a/test/services/graphdriver/driver/CMakeLists.txt b/test/services/graphdriver/driver/CMakeLists.txt index 5379df59f913e13634b4425bc0006e94d5552351..46bd992748f690931a6ee4bc63be440018afe199 100644 --- a/test/services/graphdriver/driver/CMakeLists.txt +++ b/test/services/graphdriver/driver/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE driver_llt) +SET(EXE driver_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/cutils/utils.c @@ -20,7 +20,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/services/graphdriver/driver.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/services/graphdriver/devmapper/driver_devmapper.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libisulad.c - driver_llt.cc) + driver_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/services/graphdriver/driver/driver_llt.cc b/test/services/graphdriver/driver/driver_ut.cpp similarity index 92% rename from test/services/graphdriver/driver/driver_llt.cc rename to test/services/graphdriver/driver/driver_ut.cpp index 4dead3f4e0dcd431e9da986b5a154cc6dc1c76b1..3163e88fd404f780d91484272825edc03e69aede 100644 --- a/test/services/graphdriver/driver/driver_llt.cc +++ b/test/services/graphdriver/driver/driver_ut.cpp @@ -8,7 +8,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: driver llt + * Description: driver unit test * Author: wangfengtu * Create: 2020-02-19 */ @@ -63,13 +63,13 @@ public: }; // All parameter NULL -TEST(graphdriver_init_llt, test_graphdriver_init_1) +TEST(graphdriver_init_ut, test_graphdriver_init_1) { ASSERT_TRUE(graphdriver_init(NULL, NULL, 0) == NULL); } // All parameter correct -TEST(graphdriver_init_llt, test_graphdriver_init_2) +TEST(graphdriver_init_ut, test_graphdriver_init_2) { struct graphdriver *driver = NULL; char **options = NULL; @@ -86,7 +86,7 @@ TEST(graphdriver_init_llt, test_graphdriver_init_2) } // Parameter dm.fs invalid -TEST(graphdriver_init_llt, test_graphdriver_init_3) +TEST(graphdriver_init_ut, test_graphdriver_init_3) { struct graphdriver *driver = NULL; char **options = NULL; @@ -100,7 +100,7 @@ TEST(graphdriver_init_llt, test_graphdriver_init_3) } // Parameter dm.thinpooldev invalid -TEST(graphdriver_init_llt, test_graphdriver_init_4) +TEST(graphdriver_init_ut, test_graphdriver_init_4) { struct graphdriver *driver = NULL; char **options = NULL; @@ -114,7 +114,7 @@ TEST(graphdriver_init_llt, test_graphdriver_init_4) } // Parameter dm.min_free_space invalid -TEST(graphdriver_init_llt, test_graphdriver_init_5) +TEST(graphdriver_init_ut, test_graphdriver_init_5) { struct graphdriver *driver = NULL; char **options = NULL; @@ -134,7 +134,7 @@ TEST(graphdriver_init_llt, test_graphdriver_init_5) } // Parameter dm.basesize invalid -TEST(graphdriver_init_llt, test_graphdriver_init_6) +TEST(graphdriver_init_ut, test_graphdriver_init_6) { struct graphdriver *driver = NULL; char **options = NULL; @@ -148,7 +148,7 @@ TEST(graphdriver_init_llt, test_graphdriver_init_6) } // None exist parameter -TEST(graphdriver_init_llt, test_graphdriver_init_7) +TEST(graphdriver_init_ut, test_graphdriver_init_7) { struct graphdriver *driver = NULL; char **options = NULL; diff --git a/test/specs/CMakeLists.txt b/test/specs/CMakeLists.txt index 12817971a8553b9843656fbc7bfdc0e91787b91f..7acd68a1545a3cde49ce0dadfdaad7cd870c947b 100644 --- a/test/specs/CMakeLists.txt +++ b/test/specs/CMakeLists.txt @@ -1,4 +1,4 @@ -project(iSulad_LLT) +project(iSulad_UT) add_subdirectory(specs) add_subdirectory(specs_extend) diff --git a/test/specs/specs/CMakeLists.txt b/test/specs/specs/CMakeLists.txt index ca24af6ad93c265a688b267e8c184aaa482677c2..1f8379a720c8a791654e0b0e1d6f1e200b460899 100644 --- a/test/specs/specs/CMakeLists.txt +++ b/test/specs/specs/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE specs_llt) +SET(EXE specs_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cutils/utils.c @@ -23,14 +23,14 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/services/execution/spec/sysinfo.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/commander.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/isulad/arguments.c - ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_llt_common.cc + ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_ut_common.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/containers_store_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/namespace_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/container_unix_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/engine_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/selinux_label_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/isulad_config_mock.cc - specs_llt.cc) + specs_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/specs/specs/specs_llt.cc b/test/specs/specs/specs_ut.cpp similarity index 96% rename from test/specs/specs/specs_llt.cc rename to test/specs/specs/specs_ut.cpp index 4e129befa95766ea664f1e54fb686fa0efdfc5f2..39b13ffcc9cb79d643cfb5a728903e31fbecebbf 100644 --- a/test/specs/specs/specs_llt.cc +++ b/test/specs/specs/specs_ut.cpp @@ -8,7 +8,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: specs llt + * Description: specs unit test * Author: lifeng * Create: 2020-02-18 */ @@ -21,7 +21,7 @@ #include "specs.h" #include "isula_libutils/host_config.h" #include "isula_libutils/container_config.h" -#include "oci_llt_common.h" +#include "oci_ut_common.h" #include #include #include "isulad_config_mock.h" @@ -58,13 +58,13 @@ public: #define HOST_CONFIG_FILE "specs/specs/hostconfig.json" #define OCI_RUNTIME_SPEC_FILE "specs/specs/oci_runtime_spec.json" -TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup_1) +TEST(merge_conf_cgroup_ut, test_merge_conf_cgroup_1) { // All parameter NULL ASSERT_NE(merge_conf_cgroup(NULL, NULL), 0); } -TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup_2) +TEST(merge_conf_cgroup_ut, test_merge_conf_cgroup_2) { oci_runtime_spec *oci_spec = NULL; @@ -76,7 +76,7 @@ TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup_2) oci_spec = NULL; } -TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup_3) +TEST(merge_conf_cgroup_ut, test_merge_conf_cgroup_3) { char *host_config_file = NULL; host_config *host_spec = NULL; @@ -96,7 +96,7 @@ TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup_3) host_spec = NULL; } -TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup) +TEST(merge_conf_cgroup_ut, test_merge_conf_cgroup) { char *host_config_file = NULL; host_config *host_spec = NULL; @@ -124,7 +124,7 @@ TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup) oci_spec = NULL; } -TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup_cpu) +TEST(merge_conf_cgroup_ut, test_merge_conf_cgroup_cpu) { char *host_config_file = NULL; host_config *host_spec = NULL; @@ -177,7 +177,7 @@ TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup_cpu) oci_spec = NULL; } -TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup_mem) +TEST(merge_conf_cgroup_ut, test_merge_conf_cgroup_mem) { char *host_config_file = NULL; host_config *host_spec = NULL; diff --git a/test/specs/specs_extend/CMakeLists.txt b/test/specs/specs_extend/CMakeLists.txt index e1bdfb0ee122f79228f490e8d08c18634827be5b..0dfa9e8528a76f62b8d90e6ec85d4c3705535b94 100644 --- a/test/specs/specs_extend/CMakeLists.txt +++ b/test/specs/specs_extend/CMakeLists.txt @@ -1,6 +1,6 @@ -project(iSulad_LLT) +project(iSulad_UT) -SET(EXE specs_extend_llt) +SET(EXE specs_extend_ut) add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cutils/utils.c @@ -23,14 +23,14 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/services/execution/spec/sysinfo.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/commander.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/isulad/arguments.c - ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_llt_common.cc + ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_ut_common.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/containers_store_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/namespace_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/container_unix_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/engine_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/selinux_label_mock.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/isulad_config_mock.cc - specs_extend_llt.cc) + specs_extend_ut.cpp) target_include_directories(${EXE} PUBLIC ${GTEST_INCLUDE_DIR} diff --git a/test/specs/specs_extend/specs_extend_llt.cc b/test/specs/specs_extend/specs_extend_ut.cpp similarity index 93% rename from test/specs/specs_extend/specs_extend_llt.cc rename to test/specs/specs_extend/specs_extend_ut.cpp index 7fce712de3759694e0af943e9510ac55a39f4081..4b77605502d377cd7bf9bab6e9574948777281fd 100644 --- a/test/specs/specs_extend/specs_extend_llt.cc +++ b/test/specs/specs_extend/specs_extend_ut.cpp @@ -8,7 +8,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v2 for more details. - * Description: specs extend llt + * Description: specs extend unit test * Author: lifeng * Create: 2020-02-18 */ @@ -21,7 +21,7 @@ #include "specs.h" #include "isula_libutils/host_config.h" #include "isula_libutils/container_config.h" -#include "oci_llt_common.h" +#include "oci_ut_common.h" #include #include #include "isulad_config_mock.h" @@ -44,7 +44,7 @@ using namespace std; #define HOOKS_CONFIG_FILE "specs/specs_extend/hooks.json" -TEST(make_sure_oci_spec_linux_llt, test_make_sure_oci_spec_linux) +TEST(make_sure_oci_spec_linux_ut, test_make_sure_oci_spec_linux) { oci_runtime_spec *oci_spec = NULL; oci_spec = (oci_runtime_spec *) util_common_calloc_s(sizeof(oci_runtime_spec)); @@ -55,7 +55,7 @@ TEST(make_sure_oci_spec_linux_llt, test_make_sure_oci_spec_linux) oci_spec = NULL; } -TEST(make_sure_oci_spec_process_llt, test_make_sure_oci_spec_process) +TEST(make_sure_oci_spec_process_ut, test_make_sure_oci_spec_process) { oci_runtime_spec *oci_spec = NULL; oci_spec = (oci_runtime_spec *) util_common_calloc_s(sizeof(oci_runtime_spec)); @@ -66,7 +66,7 @@ TEST(make_sure_oci_spec_process_llt, test_make_sure_oci_spec_process) oci_spec = NULL; } -TEST(make_sure_oci_spec_linux_resources_llt, test_make_sure_oci_spec_linux_resources) +TEST(make_sure_oci_spec_linux_resources_ut, test_make_sure_oci_spec_linux_resources) { oci_runtime_spec *oci_spec = NULL; oci_spec = (oci_runtime_spec *) util_common_calloc_s(sizeof(oci_runtime_spec)); @@ -78,7 +78,7 @@ TEST(make_sure_oci_spec_linux_resources_llt, test_make_sure_oci_spec_linux_resou oci_spec = NULL; } -TEST(make_sure_oci_spec_linux_resources_blkio_llt, test_make_sure_oci_spec_linux_resources_blkio) +TEST(make_sure_oci_spec_linux_resources_blkio_ut, test_make_sure_oci_spec_linux_resources_blkio) { oci_runtime_spec *oci_spec = NULL; oci_spec = (oci_runtime_spec *) util_common_calloc_s(sizeof(oci_runtime_spec)); @@ -91,12 +91,12 @@ TEST(make_sure_oci_spec_linux_resources_blkio_llt, test_make_sure_oci_spec_linux oci_spec = NULL; } -TEST(merge_hooks_llt, test_merge_hooks_invalid) +TEST(merge_hooks_ut, test_merge_hooks_invalid) { ASSERT_NE(merge_hooks(nullptr, nullptr), 0); } -TEST(merge_hooks_llt, test_merge_hooks_llt_2) +TEST(merge_hooks_ut, test_merge_hooks_ut_2) { oci_runtime_spec *oci_spec = NULL; @@ -108,7 +108,7 @@ TEST(merge_hooks_llt, test_merge_hooks_llt_2) oci_spec = NULL; } -TEST(merge_hooks_llt, test_merge_hooks_llt_3) +TEST(merge_hooks_ut, test_merge_hooks_ut_3) { char *hooks_config_file = NULL; oci_runtime_spec_hooks *hooks_spec = NULL; @@ -127,7 +127,7 @@ TEST(merge_hooks_llt, test_merge_hooks_llt_3) hooks_spec = NULL; } -TEST(merge_hooks_llt, test_merge_hooks_llt_4) +TEST(merge_hooks_ut, test_merge_hooks_ut_4) { char *hooks_config_file = NULL; oci_runtime_spec_hooks *hooks_spec = NULL; @@ -155,7 +155,7 @@ TEST(merge_hooks_llt, test_merge_hooks_llt_4) free_oci_runtime_spec(oci_spec); oci_spec = NULL; } -TEST(merge_hooks_llt, test_merge_hooks_llt_prestart) +TEST(merge_hooks_ut, test_merge_hooks_ut_prestart) { char *hooks_config_file = NULL; oci_runtime_spec_hooks *hooks_spec = NULL; @@ -193,7 +193,7 @@ TEST(merge_hooks_llt, test_merge_hooks_llt_prestart) oci_spec = NULL; } -TEST(merge_hooks_llt, test_merge_hooks_llt_poststart) +TEST(merge_hooks_ut, test_merge_hooks_ut_poststart) { char *hooks_config_file = NULL; oci_runtime_spec_hooks *hooks_spec = NULL; @@ -240,7 +240,7 @@ TEST(merge_hooks_llt, test_merge_hooks_llt_poststart) oci_spec = NULL; } -TEST(merge_hooks_llt, test_merge_hooks_llt_poststop) +TEST(merge_hooks_ut, test_merge_hooks_ut_poststop) { char *hooks_config_file = NULL; oci_runtime_spec_hooks *hooks_spec = NULL; diff --git a/test/test.sh b/test/test.sh index 38e59ad172bdc094b82e3524d4d86e81a40de6d6..fb73d6c348047de8e66df86f3c5fa64a663054b2 100755 --- a/test/test.sh +++ b/test/test.sh @@ -19,8 +19,8 @@ function usage() { - echo "Usage: sh llt.sh [OPTIONS]" - echo "Use llt.sh to control llt operation" + echo "Usage: sh test.sh [OPTIONS]" + echo "Use test.sh to control unit test operation" echo "" echo "Misc:" echo " -h, --help Print this help, then exit" @@ -31,8 +31,8 @@ function usage() echo " -e, --empty Enable compile empty(make clean)" echo echo "TestRun Options" - echo " -r, --run-llt