diff --git a/.github/workflows/native_full_build.yml b/.github/workflows/native_full_build.yml new file mode 100644 index 00000000..14a0a519 --- /dev/null +++ b/.github/workflows/native_full_build.yml @@ -0,0 +1,23 @@ + +name: Build Component in Native Environment + +on: + pull_request: + branches: [ develop ] + paths: ['**/*.c', '**/*.cpp', '**/*.cc', '**/*.cxx', '**/*.h', '**/*.hpp'] + +jobs: + build-systemtimemgr-on-pr: + name: Build Remote-debugger component in github rdkcentral + runs-on: ubuntu-latest + container: + image: ghcr.io/rdkcentral/docker-device-mgt-service-test/native-platform:latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: native build + run: | + chmod +x cov_build.sh + sh -e cov_build.sh diff --git a/configure.ac b/configure.ac index c234df5f..dec75e8b 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,18 @@ AC_ARG_ENABLE([gtestapp], [echo "Gtestapp is disabled"]) AM_CONDITIONAL([WITH_GTEST_SUPPORT], [test x$GTEST_SUPPORT_ENABLED = xtrue]) +AC_ARG_ENABLE([iarmbus], + AS_HELP_STRING([--enable-iarmbus], [enable IARMBus support (default is no)]), + [ + case "${enableval}" in + yes) USE_IARMBUS=true;; + no) AC_MSG_ERROR([IARMBus support is disabled]);; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-iarmbus]);; + esac + ], + [echo "IARMBus support is disabled"]) +AM_CONDITIONAL([USE_IARMBUS], [test x$USE_IARMBUS = xtrue]) + # Config Source files. AC_CONFIG_SRCDIR([src/rrdMain.c]) AC_CONFIG_HEADERS([config.h]) diff --git a/cov_build.sh b/cov_build.sh new file mode 100644 index 00000000..4435687e --- /dev/null +++ b/cov_build.sh @@ -0,0 +1,33 @@ +WORKDIR=`pwd` +# Build and install critical dependency +export ROOT=/usr +export INSTALL_DIR=${ROOT}/local +mkdir -p $INSTALL_DIR +#Build rfc +cd ${ROOT} +git clone https://github.com/rdkcentral/rfc.git +cd rfc +autoreconf -i +./configure --enable-rfctool=yes --enable-tr181set=yes +cd rfcapi +make librfcapi_la_CPPFLAGS="-I/usr/include/cjson -I/usr/rfc/rfcMgr/gtest/mocks" +make install +cd /usr/rfc/tr181api +g++ -fPIC -shared -o libtr181api.so tr181api.cpp -I/usr/local/include/wdmp-c +mv ./libtr181api.so /usr/local/lib +cp ./tr181api.h /usr/local/include +cd $ROOT +rm -rf iarmmgrs +rm -rf iarmbus +git clone https://github.com/rdkcentral/iarmmgrs.git +cp /usr/iarmmgrs/rdmmgr/include/rdmMgr.h /usr/local/include +git clone https://github.com/rdkcentral/iarmbus.git +cp /usr/iarmbus/core/include/libIBusDaemon.h /usr/local/include +cp /usr/iarmbus/core/include/libIBus.h /usr/local/include +cp /usr/iarmbus/core/libIARMCore.h /usr/local/include +cp /usr/iarmmgrs/hal/include/pwrMgr.h /usr/local/include/ +cd $WORKDIR +autoreconf -i +autoupdate +./configure --prefix=${INSTALL_DIR} +make remotedebugger_CFLAGS="-I/usr/include/cjson -I/usr/local/include/wdmp-c -I/usr/local/include/rbus -I/usr/local/include -I/usr/WebconfigFramework/include -I/usr/local/include/trower-base64" remotedebugger_LDFLAGS="-L/usr/local/lib -lrdkloggers -lcjson -lrfcapi -lrbus -lmsgpackc -lsecure_wrapper -lwebconfig_framework -lIARMBus -ltr181api -L/usr/local/lib/x86_64-linux-gnu -ltrower-base64 -L/usr/lib/x86_64-linux-gnu" diff --git a/src/rrdIarm.c b/src/rrdIarm.c index 225b1fe7..8fb00794 100644 --- a/src/rrdIarm.c +++ b/src/rrdIarm.c @@ -45,7 +45,7 @@ IARM_Result_t RRD_subscribe() int ret = 0; RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Entering... \n", __FUNCTION__, __LINE__); - +#if defined(USE_IARMBUS) ret = IARM_Bus_Init(IARM_BUS_RDK_REMOTE_DEBUGGER_NAME); if (ret != IARM_RESULT_SUCCESS) { @@ -56,8 +56,9 @@ IARM_Result_t RRD_subscribe() return ret; #endif } +#endif RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_Init done! \n", __FUNCTION__, __LINE__); - +#if defined(USE_IARMBUS) ret = IARM_Bus_Connect(); if (ret != IARM_RESULT_SUCCESS) { @@ -68,9 +69,10 @@ IARM_Result_t RRD_subscribe() return ret; #endif } +#endif RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_Connect done! \n", __FUNCTION__, __LINE__); - +#if defined(USE_IARMBUS) ret = IARM_Bus_RegisterEventHandler(IARM_BUS_RDK_REMOTE_DEBUGGER_NAME, IARM_BUS_RDK_REMOTE_DEBUGGER_ISSUETYPE, _remoteDebuggerEventHandler); if (ret != IARM_RESULT_SUCCESS) { @@ -91,6 +93,7 @@ IARM_Result_t RRD_subscribe() return ret; #endif } + RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_RegisterEventHandler for RRD done! \n", __FUNCTION__, __LINE__); // IARM Reg for RDM Event Handler @@ -116,7 +119,7 @@ IARM_Result_t RRD_subscribe() return ret; #endif } - +#endif webconfigFrameworkInit(); RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_RegisterEventHandler for RDMMGR done! \n", __FUNCTION__, __LINE__); @@ -546,7 +549,7 @@ IARM_Result_t RRD_unsubscribe() rbusError_t rc = RBUS_ERROR_BUS_ERROR; RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Entering... \n", __FUNCTION__, __LINE__); - +#if defined(USE_IARMBUS) ret = IARM_Bus_Disconnect(); if (ret != IARM_RESULT_SUCCESS) { @@ -557,8 +560,9 @@ IARM_Result_t RRD_unsubscribe() return ret; #endif } +#endif RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_Disconnect done!\n", __FUNCTION__, __LINE__); - +#if defined(USE_IARMBUS) ret = IARM_Bus_Term(); if (ret != IARM_RESULT_SUCCESS) { @@ -569,8 +573,9 @@ IARM_Result_t RRD_unsubscribe() return ret; #endif } +#endif RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_Term done!\n", __FUNCTION__, __LINE__); - +#if defined(USE_IARMBUS) ret = IARM_Bus_UnRegisterEventHandler(IARM_BUS_RDK_REMOTE_DEBUGGER_NAME, IARM_BUS_RDK_REMOTE_DEBUGGER_ISSUETYPE); if (ret != IARM_RESULT_SUCCESS) { @@ -607,6 +612,7 @@ IARM_Result_t RRD_unsubscribe() return ret; #endif } +#endif RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_UnRegisterEventHandler for RDMMGR done! \n", __FUNCTION__, __LINE__);