Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ AC_TYPE_SIZE_T
AC_CONFIG_FILES([Makefile
src/Makefile])

AC_ARG_ENABLE([L2support],
AS_HELP_STRING([--enable-L2support],[enable L2support (default is no)]),
[
case "${enableval}" in
yes) L2_SUPPORT_ENABLE=true
L2_SUPPORT_FLAG="-DUSE_L2_SUPPORT"
m4_if(m4_sysval,[0],[SUBDIRS_L2_SUPPORT="src"]) ;;
no) L2_SUPPORT_ENABLE=false AC_MSG_ERROR([L2_SUPPORT is disabled]) ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-L2support]) ;;
esac
],
[echo "L2support is disabled"])

# IARMBus Support
AC_ARG_ENABLE([iarmbusSupport],
[ --enable-iarmbusSupport Turn on iarmbus support],
Expand All @@ -74,3 +87,4 @@ AM_CONDITIONAL([IARMBUS_ENABLE], [test x$iarmbusSupport = xtrue])

AC_SUBST(GTEST_ENABLE_FLAG)
AC_OUTPUT

10 changes: 6 additions & 4 deletions cov_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ 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"
#cp /usr/include/cjson/cJSON.h ./
#cp /usr/local/include/wdmp-c/wdmp-c.h ./
make librfcapi_la_CPPFLAGS="-I/usr/include/cjson -I/usr/rfc/rfcMgr/gtest/mocks -DUSE_IARMBUS -DTEMP_LOGGING"
make install
cd /usr/rfc/tr181api
g++ -fPIC -shared -o libtr181api.so tr181api.cpp -I/usr/local/include/wdmp-c
Expand All @@ -64,7 +66,6 @@ cp /usr/iarmmgrs/rdmmgr/include/rdmMgr.h /usr/local/include
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/

# Build and install stubs from tr69hostif

Expand All @@ -78,6 +79,7 @@ cp libIARM.h /usr/local/include
cd $WORKDIR
autoreconf -i
autoupdate
./configure --prefix=${INSTALL_DIR} --enable-iarmbusSupport=yes
make remotedebugger_CFLAGS="-I/usr/include/cjson -I/usr/local/include/wdmp-c -I/usr/local/include/rbus -I/usr/local/include -I/usr/local/include/trower-base64 -DIARMBUS_SUPPORT -DUSECOV" 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"
./configure --prefix=${INSTALL_DIR} --enable-iarmbusSupport=yes --enable-L2support=yes
make remotedebugger_CFLAGS="-I/usr/include/cjson -I/usr/local/include/wdmp-c -I/usr/local/include/rbus -I/usr/local/include -I./unittest/mocks -I/usr/local/include/trower-base64 -DIARMBUS_SUPPORT -DUSECOV -DUSE_L2_SUPPORT" 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"
make install

28 changes: 27 additions & 1 deletion remote_debugger.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,31 @@
"Commands": "systemctl list-units --type=service --all",
"Timeout" : 10
}
}
},
"DeepSleep": {
"Audio" : {
"AudioStatus" : {
"Commands": "cat /sys/class/avsync_session0/session_stat;cat /sys/class/vdec/vdec_status;hal_dump",
"Timeout" : 10
}
},
"Video" : {
"VideoStatus" : {
"Commands": "cat /sys/class/avsync_session0/session_stat;cat /sys/class/vdec/vdec_status;hal_dump",
"Timeout" : 10
}
},
"Process" : {
"ProcessStatus" : {
"Commands": "cat /opt/logs/top_log.txt*",
"Timeout" : 10
},
"ServiceStatus" : {
"Commands": "systemctl list-units --type=service --all",
"Timeout" : 10
}

}
}
}

25 changes: 25 additions & 0 deletions run_l2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ mkdir -p "$OUTPUT_DIR"
mkdir -p "$STATIC_PROFILE_DIR"
mkdir -p "$LIB_DIR"
mkdir -p /media/apps/RDK-RRD-Test/etc/rrd
mkdir -p /media/apps/RDK-RRD-DEEPSLEEP/etc/rrd

touch /media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json
touch /media/apps/RDK-RRD-DEEPSLEEP/etc/rrd/remote_debugger.json

apt-get remove systemd
apt-get update && apt-get install -y tcpdump
Expand Down Expand Up @@ -58,9 +60,26 @@ ln -s /usr/local/bin/journalctl /usr/bin/journalctl
rm -rf /tmp/rrd/*
rm -rf /opt/logs/remotedebugger.log*

cd ./test/functional-tests/tests
make
cd -
echo "tr69 process :"
ps -ef | grep tr69hostif
# Run L2 Test cases
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_neg.json test/functional-tests/tests/test_rrd_negative.py

pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_dynamic_profile_missing_report.json test/functional-tests/tests/test_rrd_dynamic_profile_missing_report.py
cat /opt/logs/remotedebugger.log.0
cat /opt/logs/rfcscript.txt.0
rm -rf /media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json
rm -rf /tmp/RDK-RRD-Test/etc/rrd/remote_debugger.json
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_dynamic_profile_harmful_with_download.json test/functional-tests/tests/test_rrd_dynamic_with_download_harmful.py
rm -rf /media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json
rm -rf /tmp/RDK-RRD-Test/etc/rrd/remote_debugger.json
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/test_category.json test/functional-tests/tests/test_category.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_append.json test/functional-tests/tests/test_append.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_dynamic_profile_harmful_report.json test/functional-tests/tests/test_rrd_dynamic_profile_harmful_report.py
cp remote_debugger.json /etc/rrd/
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_dynamic_profile_report.json test/functional-tests/tests/test_rrd_dynamic_profile_report.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_append_dynamic_profile_static_notfound.json test/functional-tests/tests/test_rrd_append_dynamic_profile_static_notfound.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_single_instance.json test/functional-tests/tests/test_rrd_single_instance.py
Expand All @@ -75,3 +94,9 @@ pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_em
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_static_profile_missing_command_report.json test/functional-tests/tests/test_rrd_static_profile_missing_command_report.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_background_cmd_static_profile_report.json test/functional-tests/tests/test_rrd_background_cmd_static_profile_report.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_debug_report_upload.json test/functional-tests/tests/test_rrd_debug_report_upload.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_deepsleep_static.json test/functional-tests/tests/test_deepsleep_static.py
cp remote_debugger.json /media/apps/RDK-RRD-DEEPSLEEP/etc/rrd/remote_debugger.json
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_deepsleep_dynamic.json test/functional-tests/tests/test_deepsleep_dynamic.py



7 changes: 5 additions & 2 deletions src/rrdIarmEvents.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,14 @@ void _pwrManagerEventHandler(const PowerController_PowerState_t currentState,
rbusValue_Init(&value);
rbusValue_SetString(value,"root");
rc = rbus_set(rrdRbusHandle, RRD_WEBCFG_FORCE_SYNC, value, NULL);
if (rc != RBUS_ERROR_SUCCESS)
#ifndef USE_L2_SUPPORT
if (rc != RBUS_ERROR_SUCCESS)
{
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: rbus_set failed for [%s] with error [%d]\n\n", __FUNCTION__, __LINE__,RRD_WEBCFG_FORCE_SYNC ,rc);
return;
}
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Invoking WebCfg Force Sync: %s... \n", __FUNCTION__, __LINE__, RRD_WEBCFG_FORCE_SYNC);
#endif
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Invoking WebCfg Force Sync: %s... \n", __FUNCTION__, __LINE__, RRD_WEBCFG_FORCE_SYNC);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Copying Message Received to the queue.. \n", __FUNCTION__, __LINE__);
sbuf = (data_buf *)malloc(sizeof(data_buf));
if (!sbuf)
Expand Down Expand Up @@ -437,3 +439,4 @@ int RRD_IARM_unsubscribe()
#endif
return ret;
}

26 changes: 17 additions & 9 deletions src/rrdInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,24 @@ int RRD_subscribe()
subscriptions[1].handler = _remoteDebuggerWebCfgDataEventHandler;
subscriptions[1].userData = NULL;

#ifndef IARMBUS_SUPPORT
subscriptions[2].eventName = RDM_DOWNLOAD_EVENT;
subscriptions[2].filter = NULL;
subscriptions[2].duration = 0;
subscriptions[2].handler = _rdmDownloadEventHandler;
subscriptions[2].userData = NULL;

ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 3, 60);
#ifdef IARMBUS_SUPPORT
#ifdef USE_L2_SUPPORT
subscriptions[2].eventName = RDM_DOWNLOAD_EVENT;
subscriptions[2].filter = NULL;
subscriptions[2].duration = 0;
subscriptions[2].handler = _rdmDownloadEventHandler;
subscriptions[2].userData = NULL;
ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 3, 60);
#else
ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 2, 60);
#endif
#else
ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 2, 60);
subscriptions[2].eventName = RDM_DOWNLOAD_EVENT;
subscriptions[2].filter = NULL;
subscriptions[2].duration = 0;
subscriptions[2].handler = _rdmDownloadEventHandler;
subscriptions[2].userData = NULL;
ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 3, 60);
#endif
#endif
if(ret != 0)
Expand Down
Loading
Loading