From 1515dcffc348d9ea26bd6086724e8bcc1357f669 Mon Sep 17 00:00:00 2001 From: Rangaiah Date: Fri, 1 Dec 2023 10:19:19 +0530 Subject: [PATCH] fix:Desktop build issue --- .github/workflows/push.yml | 7 ++-- CMakeLists.txt | 57 +++++++++++++++++++++++---------- src/webcfg_generic.c | 2 +- src/webcfg_generic_pc.c | 2 +- tests/test_multipart_unittest.c | 8 ++--- tests/test_rbus_fr.c | 4 +-- 6 files changed, 52 insertions(+), 28 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 83d65392..303eada9 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 @@ -58,7 +58,10 @@ jobs: ps aux 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 LD_LIBRARY_PATH=${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib:${RBUS_INSTALL_DIR}/usr/lib:${LD_LIBRARY_PATH} + export C_INCLUDE_PATH=${RBUS_INSTALL_DIR}/usr/include + ls -al ${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib + ls -al ${RBUS_INSTALL_DIR}/usr/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..f2ce3add 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,26 +66,26 @@ if (MULTIPART_UTILITY) add_definitions(-DMULTIPART_UTILITY) endif (MULTIPART_UTILITY) -if (WEBCONFIG_BIN_SUPPORT) +# 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 -) +# # 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(librbuscore STATIC SHARED IMPORTED) +# add_dependencies(librbuscore rbuscore) -add_library(librtMessage STATIC SHARED IMPORTED) -add_dependencies(librtMessage rtMessage) +# add_library(librtMessage STATIC SHARED IMPORTED) +# add_dependencies(librtMessage rtMessage) -add_library(librbus STATIC SHARED IMPORTED) -add_dependencies(librbus rbus) -endif (WEBCONFIG_BIN_SUPPORT) +# add_library(librbus STATIC SHARED IMPORTED) +# add_dependencies(librbus rbus) +# endif (WEBCONFIG_BIN_SUPPORT) # msgpack-c external dependency #------------------------------------------------------------------------------- @@ -223,6 +223,29 @@ add_library(libcmocka STATIC SHARED IMPORTED) add_dependencies(libcmocka cmocka) endif (BUILD_TESTING) + +if (NOT BUILD_GIT) +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) +endif () endif () link_directories ( ${LIBRARY_DIR} ${COMMON_LIBRARY_DIR} ${LIBRARY_DIR64} ) @@ -232,4 +255,4 @@ add_subdirectory(src) if (BUILD_TESTING) add_subdirectory(tests) -endif (BUILD_TESTING) +endif (BUILD_TESTING) \ No newline at end of file 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..cec4492b 100644 --- a/tests/test_multipart_unittest.c +++ b/tests/test_multipart_unittest.c @@ -1141,9 +1141,7 @@ void test_processMsgpackSubdoc_msgpack_failure() void test_processMsgpackSubdoc_setValues_rbus() { - webconfigRbusInit("consumerComponent"); - regWebConfigDataModel(); - int res = rbus_open(&handle, "providerComponent"); + int res = rbus_open(&handle, "providerComponent"); if(res != RBUS_ERROR_SUCCESS) { CU_FAIL("rbus_open failed for providerComponent"); @@ -1155,7 +1153,7 @@ void test_processMsgpackSubdoc_setValues_rbus() rbusError_t ret = rbus_regDataElements(handle, 1, webcfgBlobElement); CU_ASSERT_EQUAL(ret, RBUS_ERROR_SUCCESS); - + webconfigRbusInit("consumerComponent"); SubDocSupportMap_t *supportdocs = (SubDocSupportMap_t *)malloc(sizeof(SubDocSupportMap_t)); if(supportdocs) { @@ -1196,7 +1194,7 @@ void test_processMsgpackSubdoc_setValues_rbus() CU_ASSERT_EQUAL(result, WEBCFG_SUCCESS); } } - webpaRbus_Uninit(); + webpaRbus_Uninit(); } #endif diff --git a/tests/test_rbus_fr.c b/tests/test_rbus_fr.c index def29d06..182bf439 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) { @@ -1784,7 +1783,8 @@ 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);