-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun_ut.sh
More file actions
203 lines (173 loc) · 6.89 KB
/
Copy pathrun_ut.sh
File metadata and controls
203 lines (173 loc) · 6.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#!/bin/sh
#########################################################################
# 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
############################################################################
WORKDIR=`pwd`
sh dependent_rdk_pkg_installer.sh
export ROOT=/usr
cd $ROOT
rm -rf remote_debugger
rm -rf rdk-halif-device_settings
rm -rf rdkvhal-devicesettings-raspberrypi4
git clone https://github.com/rdkcentral/remote_debugger.git
git clone https://github.com/rdkcentral/rdk-halif-device_settings.git
git clone https://github.com/rdkcentral/rdkvhal-devicesettings-raspberrypi4.git
cd $WORKDIR
ls -l /usr/local/include/libparodus/
ENABLE_COV=false
if [ "x$1" = "x--enable-cov" ]; then
echo "Enabling coverage options"
export CXXFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
export CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
export LDFLAGS="-lgcov --coverage"
ENABLE_COV=true
fi
# Force Thunder mode for production builds
CONFIGURE_THUNDER_OPT="--enable-thunder=yes"
apt-get update
apt-get -y install libtinyxml2-dev
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
cp ./src/hostif/parodusClient/waldb/data-model/data-model-merged.xml /tmp/data-model.xml
cp ./src/unittest/stubs/rfc.properties /etc/rfc.properties
cp ./src/unittest/stubs/rfcdefaults.ini /tmp/rfcdefaults.ini
mkdir /opt/secure
mkdir /opt/secure/RFC
mkdir -p /opt/secure/reboot/
mkdir -p /opt/www/authService/
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/
automake --add-missing
autoreconf --install
./configure --enable-libsoup3
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
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 '/getCurrentTime/,/^ *}/d' ../../src/hostIf_utils.cpp
make clean
make
./httpserver_gtest
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
echo "********************"
echo "**** Compiling DHCPv4 gtest ****"
cd $TOP_DIR/src/hostif/profiles/DHCPv4/gtest
rm dhcpv4_gtest
make
./dhcpv4_gtest
echo "********************"
echo "**** Compiling Device gtest ****"
cd $TOP_DIR/src/hostif/profiles/Device/gtest
rm device_gtest
make
./device_gtest
echo "********************"
echo "**** Compiling Ethernet gtest ****"
cd $TOP_DIR/src/hostif/profiles/Ethernet/gtest
rm ethernet_gtest
make
./ethernet_gtest
echo "********************"
echo "**** Compiling Time gtest ****"
cd $TOP_DIR/src/hostif/profiles/Time/gtest
rm time_gtest
make
./time_gtest
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
echo "********************"
echo "**** Compiling STBService Thunder gtest ****"
cd $TOP_DIR/src/hostif/profiles/STBService/gtest
rm -f stbservice_thunder_gtest
make || { echo "ERROR: STBService Thunder gtest build failed"; exit 1; }
./stbservice_thunder_gtest || { echo "ERROR: STBService Thunder gtest execution failed"; exit 1; }
echo "********************"
cd $TOP_DIR
if [ "$ENABLE_COV" = true ]; then
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' '*/gtest/*' '*/mocks/*' --output-file filtered.info
lcov --extract filtered.info '*/src/hostif/httpserver/*' '*/src/hostif/parodusClient/*' '*/src/hostif/src/*' '*/src/hostif/profiles/DHCPv4/*' '*/src/hostif/profiles/Device/*' '*/src/hostif/profiles/DeviceInfo/*' '*/src/hostif/profiles/Ethernet/*' '*/src/hostif/profiles/Time/*' '*/src/hostif/profiles/STBService/*' --output-file tr69hostif_coverage_temp.info
# Remove non-Thunder STBService files (libds versions no longer used) and untested Thunder files
lcov --remove tr69hostif_coverage_temp.info \
'*/STBService/Components_AudioOutput.cpp' \
'*/STBService/Components_DisplayDevice.cpp' \
'*/STBService/Components_HDMI.cpp' \
'*/STBService/Components_SPDIF.cpp' \
'*/STBService/Components_VideoDecoder.cpp' \
'*/STBService/Components_VideoOutput.cpp' \
'*/STBService/Capabilities.cpp' \
--output-file tr69hostif_coverage.info
rm -f tr69hostif_coverage_temp.info
lcov --list tr69hostif_coverage.info
fi