Skip to content

Commit fce6cc3

Browse files
Abhinavpv28Abhinav P V
authored andcommitted
Create Makefile
Create deepsleep_main.c Update Makefile Create power_controller.h Update run_l2.sh Update cov_build.sh Create pwrMgr.h Update cov_build.sh Update cov_build.sh Update Makefile Rename deepsleep_main.c to main.c Update Makefile update Makefile Delete test/functional-tests/tests/rrdIarmEvents.c Update run_l2.sh Update remote_debugger.json Update remote_debugger.json Create test_deepsleep_static.py Update run_l2.sh Update run_l2.sh Create test_deepsleep_dynamic.py Update run_l2.sh Update rrdInterface.c Update create_json.sh Create test_append.py Create test_category.py Update test_rrd_dynamic_profile_missing_report.py Create test_rrd_dynamic_with_download_harmful.py Create test_rrd_negative.py Update configure.ac Update cov_build.sh Update run_l2.sh Update main.c Rename main.c to deepsleep_main.c Update Makefile Create rrd_append_report.feature Create rrd_deepsleep_static.feature Create rrd_deepsleep_dynamic.feature Create rrd_dynamic_with_download_harmful_report.feature Update rrd_dynamic_profile_missing_report.feature Update test_rrd_dynamic_profile_missing_report.py Update cov_build.sh Update test_rrd_negative.py Update run_l2.sh Update test_rrd_dynamic_profile_missing_report.py Update test_rrd_dynamic_profile_missing_report.py Update run_l2.sh Update run_l2.sh Update cov_build.sh Update cov_build.sh Update cov_build.sh Update cov_build.sh Update cov_build.sh Update L2-tests.yml
1 parent 3f8ad3a commit fce6cc3

24 files changed

Lines changed: 2313 additions & 28 deletions

.github/workflows/L2-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
with:
2525
repository: 'rdkcentral/rfc'
2626
path: rfc
27+
ref: 1.1.2
2728

2829
- name: Check out dependent repostiories
2930
uses: actions/checkout@v4

configure.ac

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ AC_TYPE_SIZE_T
6262
AC_CONFIG_FILES([Makefile
6363
src/Makefile])
6464

65+
AC_ARG_ENABLE([L2support],
66+
AS_HELP_STRING([--enable-L2support],[enable L2support (default is no)]),
67+
[
68+
case "${enableval}" in
69+
yes) L2_SUPPORT_ENABLE=true
70+
L2_SUPPORT_FLAG="-DUSE_L2_SUPPORT"
71+
m4_if(m4_sysval,[0],[SUBDIRS_L2_SUPPORT="src"]) ;;
72+
no) L2_SUPPORT_ENABLE=false AC_MSG_ERROR([L2_SUPPORT is disabled]) ;;
73+
*) AC_MSG_ERROR([bad value ${enableval} for --enable-L2support]) ;;
74+
esac
75+
],
76+
[echo "L2support is disabled"])
77+
6578
# IARMBus Support
6679
AC_ARG_ENABLE([iarmbusSupport],
6780
[ --enable-iarmbusSupport Turn on iarmbus support],

cov_build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cd ${ROOT}
2929

3030
# Clone all dependencies if not present already
3131
if [ ! -d rfc ]; then
32-
git clone https://github.com/rdkcentral/rfc.git
32+
git clone https://github.com/rdkcentral/rfc.git -b feature/branch
3333
fi
3434

3535
if [ ! -d iarmmgrs ]; then
@@ -45,6 +45,8 @@ if [ ! -d tr69hostif ]; then
4545
fi
4646

4747
cd rfc
48+
git config --global --add safe.directory /usr/rfc
49+
4850
autoreconf -i
4951
./configure --enable-rfctool=yes --enable-tr181set=yes
5052
cd rfcapi
@@ -64,7 +66,6 @@ cp /usr/iarmmgrs/rdmmgr/include/rdmMgr.h /usr/local/include
6466
cp /usr/iarmbus/core/include/libIBusDaemon.h /usr/local/include
6567
cp /usr/iarmbus/core/include/libIBus.h /usr/local/include
6668
cp /usr/iarmbus/core/libIARMCore.h /usr/local/include
67-
cp /usr/iarmmgrs/hal/include/pwrMgr.h /usr/local/include/
6869

6970
# Build and install stubs from tr69hostif
7071

@@ -78,6 +79,6 @@ cp libIARM.h /usr/local/include
7879
cd $WORKDIR
7980
autoreconf -i
8081
autoupdate
81-
./configure --prefix=${INSTALL_DIR} --enable-iarmbusSupport=yes
82-
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"
82+
./configure --prefix=${INSTALL_DIR} --enable-iarmbusSupport=yes --enable-L2support=yes
83+
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"
8384
make install

remote_debugger.json

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,30 @@
3939
"Commands": "systemctl list-units --type=service --all",
4040
"Timeout" : 10
4141
}
42-
}
42+
},
43+
"DeepSleep": {
44+
"Audio" : {
45+
"AudioStatus" : {
46+
"Commands": "cat /sys/class/avsync_session0/session_stat;cat /sys/class/vdec/vdec_status;hal_dump",
47+
"Timeout" : 10
48+
}
49+
},
50+
"Video" : {
51+
"VideoStatus" : {
52+
"Commands": "cat /sys/class/avsync_session0/session_stat;cat /sys/class/vdec/vdec_status;hal_dump",
53+
"Timeout" : 10
54+
}
55+
},
56+
"Process" : {
57+
"ProcessStatus" : {
58+
"Commands": "cat /opt/logs/top_log.txt*",
59+
"Timeout" : 10
60+
},
61+
"ServiceStatus" : {
62+
"Commands": "systemctl list-units --type=service --all",
63+
"Timeout" : 10
64+
}
65+
66+
}
67+
}
4368
}

run_l2.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ mkdir -p "$OUTPUT_DIR"
2828
mkdir -p "$STATIC_PROFILE_DIR"
2929
mkdir -p "$LIB_DIR"
3030
mkdir -p /media/apps/RDK-RRD-Test/etc/rrd
31+
mkdir -p /media/apps/RDK-RRD-DEEPSLEEP/etc/rrd
3132

3233
touch /media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json
34+
touch /media/apps/RDK-RRD-DEEPSLEEP/etc/rrd/remote_debugger.json
3335

3436
apt-get remove systemd
3537
apt-get update && apt-get install -y tcpdump
@@ -58,9 +60,27 @@ ln -s /usr/local/bin/journalctl /usr/bin/journalctl
5860
rm -rf /tmp/rrd/*
5961
rm -rf /opt/logs/remotedebugger.log*
6062

63+
cd ./test/functional-tests/tests
64+
make
65+
cd -
66+
6167
# Run L2 Test cases
68+
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_neg.json test/functional-tests/tests/test_rrd_negative.py
69+
cat /opt/logs/remotedebugger.log.0
70+
cat /opt/logs/rfcscript.txt.0
71+
6272
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
73+
cat /opt/logs/remotedebugger.log.0
74+
/opt/logs/rfcscript.txt.0
75+
rm -rf /media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json
76+
rm -rf /tmp/RDK-RRD-Test/etc/rrd/remote_debugger.json
77+
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
78+
rm -rf /media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json
79+
rm -rf /tmp/RDK-RRD-Test/etc/rrd/remote_debugger.json
80+
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/test_category.json test/functional-tests/tests/test_category.py
81+
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_append.json test/functional-tests/tests/test_append.py
6382
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
83+
cp remote_debugger.json /etc/rrd/
6484
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
6585
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
6686
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_single_instance.json test/functional-tests/tests/test_rrd_single_instance.py
@@ -75,3 +95,8 @@ pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_em
7595
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
7696
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
7797
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
98+
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_deepsleep_static.json test/functional-tests/tests/test_deepsleep_static.py
99+
cp remote_debugger.json /media/apps/RDK-RRD-DEEPSLEEP/etc/rrd/remote_debugger.json
100+
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_deepsleep_dynamic.json test/functional-tests/tests/test_deepsleep_dynamic.py
101+
102+

src/rrdIarmEvents.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,14 @@ void _pwrManagerEventHandler(const PowerController_PowerState_t currentState,
157157
rbusValue_Init(&value);
158158
rbusValue_SetString(value,"root");
159159
rc = rbus_set(rrdRbusHandle, RRD_WEBCFG_FORCE_SYNC, value, NULL);
160-
if (rc != RBUS_ERROR_SUCCESS)
160+
#ifndef USE_L2_SUPPORT
161+
if (rc != RBUS_ERROR_SUCCESS)
161162
{
162163
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);
163164
return;
164165
}
165-
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Invoking WebCfg Force Sync: %s... \n", __FUNCTION__, __LINE__, RRD_WEBCFG_FORCE_SYNC);
166+
#endif
167+
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Invoking WebCfg Force Sync: %s... \n", __FUNCTION__, __LINE__, RRD_WEBCFG_FORCE_SYNC);
166168
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Copying Message Received to the queue.. \n", __FUNCTION__, __LINE__);
167169
sbuf = (data_buf *)malloc(sizeof(data_buf));
168170
if (!sbuf)

src/rrdInterface.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,24 @@ int RRD_subscribe()
7474
subscriptions[1].handler = _remoteDebuggerWebCfgDataEventHandler;
7575
subscriptions[1].userData = NULL;
7676

77-
#ifndef IARMBUS_SUPPORT
78-
subscriptions[2].eventName = RDM_DOWNLOAD_EVENT;
79-
subscriptions[2].filter = NULL;
80-
subscriptions[2].duration = 0;
81-
subscriptions[2].handler = _rdmDownloadEventHandler;
82-
subscriptions[2].userData = NULL;
83-
84-
ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 3, 60);
77+
#ifdef IARMBUS_SUPPORT
78+
#ifdef USE_L2_SUPPORT
79+
subscriptions[2].eventName = RDM_DOWNLOAD_EVENT;
80+
subscriptions[2].filter = NULL;
81+
subscriptions[2].duration = 0;
82+
subscriptions[2].handler = _rdmDownloadEventHandler;
83+
subscriptions[2].userData = NULL;
84+
ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 3, 60);
85+
#else
86+
ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 2, 60);
87+
#endif
8588
#else
86-
ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 2, 60);
89+
subscriptions[2].eventName = RDM_DOWNLOAD_EVENT;
90+
subscriptions[2].filter = NULL;
91+
subscriptions[2].duration = 0;
92+
subscriptions[2].handler = _rdmDownloadEventHandler;
93+
subscriptions[2].userData = NULL;
94+
ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 3, 60);
8795
#endif
8896
#endif
8997
if(ret != 0)
@@ -431,4 +439,3 @@ int RRD_unsubscribe()
431439
#endif
432440
return ret;
433441
}
434-

0 commit comments

Comments
 (0)