diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 83d65392..41696788 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -50,7 +50,7 @@ jobs: - name: CMake working-directory: build run: | - cmake .. -DWEBCONFIG_BIN_SUPPORT:BOOL=true -DWAN_FAILOVER_SUPPORTED:BOOL=true -DINTEGRATION_TESTING:BOOL=false -DDISABLE_VALGRIND:BOOL=${DISABLE_VALGRIND} -DENABLE_SESHAT:BOOL=true -DFEATURE_DNS_QUERY:BOOL=true + cmake .. -DWEBCONFIG_BIN_SUPPORT:BOOL=true -DWAN_FAILOVER_SUPPORTED:BOOL=true -DBUILD_GIT:BOOL=true -DDISABLE_VALGRIND:BOOL=${DISABLE_VALGRIND} - name: Unit tests run working-directory: build @@ -59,6 +59,10 @@ jobs: export RBUS_ROOT=${HOME}/rbus export RBUS_INSTALL_DIR=${RBUS_ROOT}/install && \ export LD_LIBRARY_PATH=${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib:${LD_LIBRARY_PATH} + export C_INCLUDE_PATH=${RBUS_INSTALL_DIR}/usr/include + mkdir _install + mkdir _install/lib + cp ${RBUS_INSTALL_DIR}/usr/lib/librbus* _install/lib build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output make all test - name: Stop rtrouted diff --git a/CMakeLists.txt b/CMakeLists.txt index 79849d2d..5fe794ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,26 +66,6 @@ if (MULTIPART_UTILITY) add_definitions(-DMULTIPART_UTILITY) endif (MULTIPART_UTILITY) -if (WEBCONFIG_BIN_SUPPORT) - -# rbus external dependency -#------------------------------------------------------------------------------- -ExternalProject_Add(rbus - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/_prefix/rbus - GIT_REPOSITORY https://github.com/rdkcentral/rbus.git - GIT_TAG main - CMAKE_ARGS += -DBUILD_FOR_DESKTOP=ON -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_TESTING=OFF -) - -add_library(librbuscore STATIC SHARED IMPORTED) -add_dependencies(librbuscore rbuscore) - -add_library(librtMessage STATIC SHARED IMPORTED) -add_dependencies(librtMessage rtMessage) - -add_library(librbus STATIC SHARED IMPORTED) -add_dependencies(librbus rbus) -endif (WEBCONFIG_BIN_SUPPORT) # msgpack-c external dependency #------------------------------------------------------------------------------- @@ -223,6 +203,27 @@ add_library(libcmocka STATIC SHARED IMPORTED) add_dependencies(libcmocka cmocka) endif (BUILD_TESTING) + +if (( NOT BUILD_GIT) AND WEBCONFIG_BIN_SUPPORT) + +# rbus external dependency +#------------------------------------------------------------------------------- +ExternalProject_Add(rbus + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/_prefix/rbus + GIT_REPOSITORY https://github.com/rdkcentral/rbus.git + GIT_TAG main + CMAKE_ARGS += -DBUILD_FOR_DESKTOP=ON -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_TESTING=OFF +) + +add_library(librbuscore STATIC SHARED IMPORTED) +add_dependencies(librbuscore rbuscore) + +add_library(librtMessage STATIC SHARED IMPORTED) +add_dependencies(librtMessage rtMessage) + +add_library(librbus STATIC SHARED IMPORTED) +add_dependencies(librbus rbus) +endif () endif () link_directories ( ${LIBRARY_DIR} ${COMMON_LIBRARY_DIR} ${LIBRARY_DIR64} ) diff --git a/src/webcfg_generic.c b/src/webcfg_generic.c index e02c1101..65b7f5c2 100644 --- a/src/webcfg_generic.c +++ b/src/webcfg_generic.c @@ -22,7 +22,7 @@ #include "webcfg_log.h" #if defined(WEBCONFIG_BIN_SUPPORT) #include "webcfg_rbus.h" -#include +#include #endif /*----------------------------------------------------------------------------*/ /* Macros */ diff --git a/src/webcfg_generic_pc.c b/src/webcfg_generic_pc.c index a7699698..c09b3c25 100644 --- a/src/webcfg_generic_pc.c +++ b/src/webcfg_generic_pc.c @@ -23,7 +23,7 @@ #include "webcfg_log.h" #if defined(WEBCONFIG_BIN_SUPPORT) #include "webcfg_rbus.h" -#include +#include #endif /*----------------------------------------------------------------------------*/ /* Macros */ diff --git a/tests/test_multipart_unittest.c b/tests/test_multipart_unittest.c index c28dbf24..75294cd8 100644 --- a/tests/test_multipart_unittest.c +++ b/tests/test_multipart_unittest.c @@ -1141,8 +1141,6 @@ void test_processMsgpackSubdoc_msgpack_failure() void test_processMsgpackSubdoc_setValues_rbus() { - webconfigRbusInit("consumerComponent"); - regWebConfigDataModel(); int res = rbus_open(&handle, "providerComponent"); if(res != RBUS_ERROR_SUCCESS) { @@ -1156,6 +1154,8 @@ void test_processMsgpackSubdoc_setValues_rbus() rbusError_t ret = rbus_regDataElements(handle, 1, webcfgBlobElement); CU_ASSERT_EQUAL(ret, RBUS_ERROR_SUCCESS); + webconfigRbusInit("consumerComponent"); + regWebConfigDataModel(); SubDocSupportMap_t *supportdocs = (SubDocSupportMap_t *)malloc(sizeof(SubDocSupportMap_t)); if(supportdocs) { diff --git a/tests/test_rbus_fr.c b/tests/test_rbus_fr.c index def29d06..b6af20a9 100644 --- a/tests/test_rbus_fr.c +++ b/tests/test_rbus_fr.c @@ -1773,7 +1773,6 @@ void test_blobSet_rbus() WDMP_STATUS retStatus = WDMP_FAILURE; int ccspStatus = 0; - webconfigRbusInit("consumerComponent"); int res = rbus_open(&handle, "providerComponent"); if(res != RBUS_ERROR_SUCCESS) { @@ -1785,6 +1784,7 @@ void test_blobSet_rbus() rbusError_t ret = rbus_regDataElements(handle, 1, webcfgBlobElement); CU_ASSERT_EQUAL(ret, RBUS_ERROR_SUCCESS); + webconfigRbusInit("consumerComponent"); blobSet_rbus(WEBCFG_BLOB_PARAM, buff, sendMsgSize, &retStatus, &ccspStatus); CU_ASSERT_EQUAL(CCSP_Msg_Bus_OK, ccspStatus); CU_ASSERT_EQUAL(WDMP_SUCCESS, retStatus);