Skip to content
Merged
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
4 changes: 2 additions & 2 deletions cov_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ cd $WORKDIR
sed -i '/PKG_CHECK_MODULES(\[PROCPS\], \[libproc >= 3.2.8\])/s/^/#/' ./configure.ac
rm -f ./src/unittest/stubs/rdk_debug.h
autoreconf -i
./configure --enable-libsoup3=yes --enable-IPv6=yes
./configure --enable-IPv6=yes

make AM_CXXFLAGS="-I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/include -I/usr/include/cjson -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/handlers/include -I$WORKDIR/src/hostif/parodusClient/waldb -I$WORKDIR/src/hostif/profiles/DeviceInfo -I/usr/include/cjson -I$WORKDIR/src/hostif/profiles/Time -I$WORKDIR/src/hostif/profiles/Device -I/usr/include/libsoup-3.0 -I/usr/include/yajl -I$WORKDIR/src/hostif/profiles/STBService -I$WORKDIR/src/unittest/stubs/ds -I/usr/devicesettings/ds -I/usr/local/include -I$WORKDIR/src/hostif/profiles/IP -I$WORKDIR/src/hostif/profiles/Ethernet -I/usr/local/include/rbus -I$WORKDIR/src/hostif/parodusClient/pal -I/usr/rdk-halif-device_settings/include -I/usr/local/include/libparodus -I/usr/local/include -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/local/include/ -I/usr/include/yajl -I/usr/tinyxml2 -I/usr/devicesettings/ds -I/$WORKDIR/src/hostif/httpserver/include -I/usr/remote_debugger/src/ -DLIBSOUP3_ENABLE -DIPV6_SUPPORT" \
make AM_CXXFLAGS="-I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/include -I/usr/include/cjson -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/handlers/include -I$WORKDIR/src/hostif/parodusClient/waldb -I$WORKDIR/src/hostif/profiles/DeviceInfo -I/usr/include/cjson -I$WORKDIR/src/hostif/profiles/Time -I$WORKDIR/src/hostif/profiles/Device -I/usr/include/libsoup-3.0 -I/usr/include/yajl -I$WORKDIR/src/hostif/profiles/STBService -I$WORKDIR/src/unittest/stubs/ds -I/usr/devicesettings/ds -I/usr/local/include -I$WORKDIR/src/hostif/profiles/IP -I$WORKDIR/src/hostif/profiles/Ethernet -I/usr/local/include/rbus -I$WORKDIR/src/hostif/parodusClient/pal -I/usr/rdk-halif-device_settings/include -I/usr/local/include/libparodus -I/usr/local/include -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/local/include/ -I/usr/include/yajl -I/usr/tinyxml2 -I/usr/devicesettings/ds -I/$WORKDIR/src/hostif/httpserver/include -I/usr/remote_debugger/src/ -DIPV6_SUPPORT" \
AM_LDFLAGS="-L/usr/local/lib -lrbus -lsecure_wrapper -lcurl -lrfcapi -lrdkloggers -llibparodus -lglib-2.0 -lnanomsg -lIARMBus -lWPEFrameworkPowerController -lds -ldshalcli -ldshalsrv -lwrp-c -lwdmp-c -lprocps -ltrower-base64 -lcimplog -lsoup-3.0 -L/usr/lib/x86_64-linux-gnu -lyajl -L/usr/local/lib/x86_64-linux-gnu -ltinyxml2" CXXFLAGS="-fpermissive -DPARODUS_ENABLE -DUSE_REMOTE_DEBUGGER"
make install

Expand Down
31 changes: 26 additions & 5 deletions run_ut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ apt-get -y install libsoup-3.0-dev
apt-get -y install libprocps-dev
apt-get -y install libnanomsg-dev
apt-get -y install iproute2

sed '/<\/model>/d; /<\/dm:document>/d' ./src/hostif/parodusClient/waldb/data-model/data-model-tv.xml > ./src/hostif/parodusClient/waldb/data-model/data-model-merged.xml
sed '/<?xml/,/<model/ d' ./src/hostif/parodusClient/waldb/data-model/data-model-generic.xml >> ./src/hostif/parodusClient/waldb/data-model/data-model-merged.xml

Expand All @@ -65,17 +64,26 @@ mkdir -p /tmp/webpa
mkdir -p /opt/persistent/
mkdir -p /etc/rfcdefaults
mkdir -p /etc/apparmor.d
mkdir -p /opt/secure/persistent/
mkdir -p /etc/rrd/
cp ./src/unittest/stubs/tr181store.ini /opt/secure/RFC/tr181store.ini
cp ./src/integrationtest/conf/bootstrap.ini /opt/secure/RFC/
cp ./src/integrationtest/conf/rfcVariable.ini /opt/secure/RFC/
cp partners_defaults.json /etc/partners_defaults.json
cp ./src/unittest/stubs/partners_defaults_device.json /etc/partners_defaults_device.json
cp ./src/unittest/stubs/fwdnldstatus.txt /opt/fwdnldstatus.txt
cp ./src/integrationtest/conf/mgrlist.conf /etc/mgrlist.conf
cp ./src/unittest/stubs/remote_debugger.json /etc/rrd/remote_debugger.json
touch /tmp/timeReceivedNTP
touch /tmp/webpa/start_time
touch /opt/persistent/firstNtpTime


touch /etc/rfcdefaults/rfcdefaults.ini
touch /opt/XRE_container_enable /opt/dab-enable
touch /opt/.ntpEnabled
touch /var/tmp/rssh.pid
cat /version.txt
rm -rf /version.txt
echo "Method|" >> /opt/fwdnldstatus.txt

export TOP_DIR=$WORKDIR
cd ./src/
Expand All @@ -90,18 +98,29 @@ make clean

echo "TOP_DIR = $TOP_DIR"

echo "**** Compiling handlers gtest ****"
cd $TOP_DIR/src/hostif/handlers/src/gtest
rm handlers_gtest
sed -i '/getCurrentTime/,/^ *}/d' ../../../src/hostIf_utils.cpp
make clean
make
./handlers_gtest
echo "********************"


echo "**** Compiling data model gtest ****"
cd $TOP_DIR/src/hostif/parodusClient/gtest
rm dm_gtest
sed -i '/getCurrentTime/,/^ *}/d' ../../src/hostIf_utils.cpp
#sed -i '/getCurrentTime/,/^ *}/d' ../../src/hostIf_utils.cpp
make
./dm_gtest
echo "********************"

echo "**** Compiling httpserver gtest ****"
cd $TOP_DIR/src/hostif/httpserver/src/gtest
rm httpserver_gtest
sed -i '$a void getCurrentTime(struct timespec *timer)\n{\n clock_gettime(CLOCK_REALTIME, timer);\n}' ../../../src/hostIf_utils.cpp
#sed -i '$a void getCurrentTime(struct timespec *timer)\n{\n clock_gettime(CLOCK_REALTIME, timer);\n}' ../../../src/hostIf_utils.cpp
#sed -i '/getCurrentTime/,/^ *}/d' ../../src/hostIf_utils.cpp
make clean
make
./httpserver_gtest
Expand All @@ -110,6 +129,7 @@ echo "********************"
echo "**** Compiling src gtest ****"
cd $TOP_DIR/src/hostif/src/gtest
rm src_gtest
sed -i '$a void getCurrentTime(struct timespec *timer)\n{\n clock_gettime(CLOCK_REALTIME, timer);\n}' ../hostIf_utils.cpp
make clean
make
./src_gtest
Expand Down Expand Up @@ -145,6 +165,7 @@ echo "********************"

echo "**** Compiling DeviceInfo gtest ****"
cd $TOP_DIR/src/hostif/profiles/DeviceInfo/gtest
cp ../../../../unittest/stubs/rfc.properties /etc/rfc.properties
rm devieInfo_gtest /opt/www/authService/partnerId3.dat
make
./devieInfo_gtest
Expand Down
1 change: 1 addition & 0 deletions src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ AC_SUBST(T2_EVENT_FLAG)
hostif/profiles/Ethernet/gtest/Makefile
hostif/profiles/Time/gtest/Makefile
hostif/profiles/DeviceInfo/gtest/Makefile
hostif/handlers/src/gtest/Makefile
])

# Generate the configure script
Expand Down
11 changes: 11 additions & 0 deletions src/hostif/handlers/include/hostIf_rbus_Dml_Provider.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in src/hostif/handlers/include/hostIf_rbus_Dml_Provider.h

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'src/hostif/handlers/include/hostIf_rbus_Dml_Provider.h' (Match: rdk/components/generic/tr69hostif/rdk/components/generic/tr69hostif/2011, 46 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/tr69hostif/+archive/rdk-dev-2011.tar.gz, file: src/hostif/handlers/include/hostIf_rbus_Dml_Provider.h)

Check failure on line 3 in src/hostif/handlers/include/hostIf_rbus_Dml_Provider.h

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'src/hostif/handlers/include/hostIf_rbus_Dml_Provider.h' (Match: rdk/components/generic/tr69hostif/rdk/components/generic/tr69hostif/2011, 46 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/tr69hostif/+archive/rdk-dev-2011.tar.gz, file: src/hostif/handlers/include/hostIf_rbus_Dml_Provider.h)
*
* Copyright 2020 RDK Management
*
Expand Down Expand Up @@ -48,11 +48,22 @@
#ifndef HOSTIF_RBUS_DML_PROVIDER_H_
#define HOSTIF_RBUS_DML_PROVIDER_H_

#ifdef GTEST_ENABLE
#include "rbus_value.h"
#include "rbus.h"
#endif

void init_rbus_dml_provider();

int setRbusStringParam(const char *paramName, char* paramValue);
int getRbusStringParam(const char *paramName, char** paramValue);

#ifdef GTEST_ENABLE
rbusError_t TR_Dml_EventSubHandler(rbusHandle_t handle, rbusEventSubAction_t action, const char* eventName, rbusFilter_t filter, int32_t interval, bool* autoPublish);
rbusError_t TR_Dml_GetHandler(rbusHandle_t handle, rbusProperty_t inProperty, rbusGetHandlerOptions_t* opts);
rbusError_t TR_Dml_SetHandler(rbusHandle_t handle, rbusProperty_t inProperty, rbusSetHandlerOptions_t* opts);
#endif

#endif /* HOSTIF_RBUS_DML_PROVIDER_H_ */

/* End of HOSTIF_RBUS_DML_PROVIDER_H_ API doxygen group */
Expand Down
39 changes: 39 additions & 0 deletions src/hostif/handlers/src/gtest/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
################################################################################

Check failure on line 1 in src/hostif/handlers/src/gtest/Makefile.am

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'src/hostif/handlers/src/gtest/Makefile.am' (Match: JoepVanlier/ysfx/0.0.1, 16 lines, url: https://github.com/JoepVanlier/ysfx/archive/v0.0.1.tar.gz, file: cmake/ExtractYsfxExports.cmake)

Check failure on line 1 in src/hostif/handlers/src/gtest/Makefile.am

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'src/hostif/handlers/src/gtest/Makefile.am' (Match: JoepVanlier/ysfx/0.0.1, 16 lines, url: https://github.com/JoepVanlier/ysfx/archive/v0.0.1.tar.gz, file: cmake/ExtractYsfxExports.cmake)
# Copyright 2024 Comcast Cable Communications Management, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

AUTOMAKE_OPTIONS = subdir-objects

# Define the program name and the source files
bin_PROGRAMS = handlers_gtest

# Define the include directories

COMMON_CPPFLAGS = -std=c++11 -DGTEST_ENABLE -DYOCTO_BUILD -DUSE_DEV_PROPERTIES_CONF -DUSE_REMOTE_DEBUGGER -I/usr/include -I/usr/include/cjson -I$(TOP_DIR)/src/hostif/include -I$(TOP_DIR)/src/hostif/profiles/DeviceInfo -I$(TOP_DIR)/src/unittest/stubs -I$(TOP_DIR)/src/unittest/stubs/ds -I$(TOP_DIR)/src/unittest/stubs/rbus/include -I$(TOP_DIR)/src/hostif/handlers/include -I$(TOP_DIR)/src/hostif/parodusClient/pal -I$(TOP_DIR)/src/hostif/parodusClient/waldb -I$(TOP_DIR)/src/hostif/httpserver/include -I$(TOP_DIR)/src/hostif/handlers/src -I/usr/include/rbus -I/usr/local/include/rbus -Isrc/unittest/stubs/rbus/include/ -I$(TOP_DIR)/src/hostif/profiles/Time -I$(TOP_DIR)/src/hostif/profiles/Device -I$(TOP_DIR)/src/hostif/profiles/IP -I$(TOP_DIR)/src/hostif/profiles/STBService -I/usr/rdk-halif-device_settings/include/ -I/usr/rdkvhal-devicesettings-raspberrypi4/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$(TOP_DIR)/src/hostif/profiles/Ethernet -I/usr/remote_debugger/src/ -I/usr/local/include/libparodus/ -I/usr/local/include/wrp-c/ -I$(TOP_DIR)/src/hostif/parodusClient/startParodus/ -I$(TOP_DIR)/src/hostif/profiles/DHCPv4 -I/usr/include/libsoup-3.0

# Define the libraries to link against
COMMON_LDADD = -lgtest -lgtest_main -lgmock_main -lgmock -lgcov $(GLIB_LIBS) -ltinyxml2 -lcjson -lcurl -lglib-2.0 -llibparodus -lwrp-c -lnanomsg -lmsgpackc -ltrower-base64 -lcimplog -lsoup-3.0

# Define the compiler flags
COMMON_CXXFLAGS = -frtti $(GLIB_CFLAGS) -fprofile-arcs -ftest-coverage

handlers_gtest_SOURCES = handlers_test.cpp $(TOP_DIR)/src/hostif/parodusClient/startParodus/startParodus.cpp $(TOP_DIR)/src/hostif/src/hostIf_utils.cpp $(TOP_DIR)/src/hostif/src/IniFile.cpp $(TOP_DIR)/src/unittest/stubs/secure_wrapper.c $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComRFCStore.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComRFC.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComBSStore.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComBSStoreJournal.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_NotificationHandler.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_notification.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_attribute.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_parameter.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/libpd.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_adapter.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_msgHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_XrdkCentralT2_ReqHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_IPClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo_ProcessStatus_Process.cpp $(TOP_DIR)/src/hostif/profiles/Ethernet/Device_Ethernet_Interface.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_DisplayDevice.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_EthernetClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/profiles/Ethernet/Device_Ethernet_Interface_Stats.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_TimeClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Interface.cpp $(TOP_DIR)/src/hostif/profiles/Time/Device_Time.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_updateHandler.cpp $(TOP_DIR)/src/hostif/profiles/Device/x_rdk_profile.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_dsClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_rbus_Dml_Provider.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Capabilities.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_SPDIF.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_VideoDecoder.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_AudioOutput.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_HDMI.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_VideoOutput.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Interface_Stats.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_ActivePort.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Diagnostics_IPPing.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Interface_IPv4Address.cpp $(TOP_DIR)/src/hostif/handlers/src/x_rdk_req_handler.cpp $(TOP_DIR)/src/unittest/stubs/dm_stubs.cpp $(TOP_DIR)/src/hostif/parodusClient/waldb/waldb.cpp $(TOP_DIR)/src/unittest/stubs/wdmp-c.c $(TOP_DIR)/src/unittest/stubs/wdmp_internal.c $(TOP_DIR)/src/hostif/httpserver/src/http_server.cpp $(TOP_DIR)/src/hostif/httpserver/src/request_handler.cpp $(TOP_DIR)/src/hostif/httpserver/src/XrdkCentralComRFCVar.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo_Processor.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo_ProcessStatus.cpp $(TOP_DIR)/src/unittest/stubs/ds/libprocps.cpp $(TOP_DIR)/src/unittest/stubs/file_writer.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_DHCPv4Client_ReqHandler.cpp $(TOP_DIR)/src/hostif/profiles/DHCPv4/Device_DHCPv4_Client.cpp

# Apply common properties to each program
handlers_gtest_CPPFLAGS = $(COMMON_CPPFLAGS)
handlers_gtest_LDADD = $(COMMON_LDADD)
handlers_gtest_CXXFLAGS = $(COMMON_CXXFLAGS)
Loading
Loading