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
13 changes: 13 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 Down
7 changes: 3 additions & 4 deletions cov_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ 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 librfcapi_la_CPPFLAGS="-I/usr/include/cjson -I/usr/rfc/rfcMgr/gtest/mocks -DUSE_IARMBUS"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for enabling USE_IARMBUS in L2 . My understanding was we don't have IARM available in our L2 environment .

make install
cd /usr/rfc/tr181api
g++ -fPIC -shared -o libtr181api.so tr181api.cpp -I/usr/local/include/wdmp-c
Expand All @@ -64,7 +64,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 +77,6 @@ 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
27 changes: 26 additions & 1 deletion remote_debugger.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,30 @@
"Commands": "systemctl list-units --type=service --all",
"Timeout" : 10
}
}
},
"DeepSleep": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DeepSleep config is added only for L2? Does it stay in the device root FS even if it's not required? Also need to check any security concerns.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file wont be available in rootfs. this file is only for test purpose. the real json file installations are done in meta layer.

"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
}

}
}
}
21 changes: 21 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,23 @@ 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 -

# 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
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 +91,8 @@ 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


6 changes: 4 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having changes specific to L2 code in main source files is not the right way.

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
27 changes: 17 additions & 10 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right .

#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 Expand Up @@ -431,4 +439,3 @@ int RRD_unsubscribe()
#endif
return ret;
}

Loading
Loading