-
Notifications
You must be signed in to change notification settings - Fork 387
executable file
·434 lines (402 loc) · 16.2 KB
/
L2-tests-R4-4-1.yml
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
name: L2-tests-R4-4-1
on:
push:
branches: [ main, 'sprint/**', 'release/**' ]
pull_request:
branches: [ main, 'sprint/**', 'release/**' ]
env:
BUILD_TYPE: Debug
THUNDER_REF: "R4.4.1"
INTERFACES_REF: "R4.4.1"
jobs:
L2-tests-R4-4-1:
name: L2 tests with Thunder R4.4.1
runs-on: ubuntu-22.04
strategy:
matrix:
compiler: [ gcc, clang ]
coverage: [ with-coverage, without-coverage ]
exclude:
- compiler: clang
coverage: with-coverage
- compiler: clang
coverage: without-coverage
- compiler: gcc
coverage: without-coverage
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: pip install jsonref
- name: Set up CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- name: Install packages
run: >
sudo apt update
&&
sudo apt install -y libsqlite3-dev libcurl4-openssl-dev valgrind lcov clang libsystemd-dev libboost-all-dev libwebsocketpp-dev meson libcunit1 libcunit1-dev protobuf-compiler protobuf-compiler-grpc libgrpc-dev libgrpc++-dev
- name: Install GStreamer
run: |
sudo apt update
sudo apt install -y libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- name: Build trevor-base64
run: |
if [ ! -d "trower-base64" ]; then
git clone https://github.com/xmidt-org/trower-base64.git
fi
cd trower-base64
meson setup --warnlevel 3 --werror build
ninja -C build
sudo ninja -C build install
- name: Checkout rdkservices
uses: actions/checkout@v3
with:
path: rdkservices
- name: Checkout Thunder
uses: actions/checkout@v3
with:
repository: rdkcentral/Thunder
path: Thunder
ref: ${{env.THUNDER_REF}}
- name: Apply patches Thunder
run: |
cd ${{github.workspace}}/Thunder
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch
cd -
- name: Checkout ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: rdkcentral/ThunderTools
path: ThunderTools
ref: R4.4.3
- name: Build ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/ThunderTools"
-B build/ThunderTools
-DEXCEPTIONS_ENABLE=ON
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DGENERIC_CMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
&&
cmake --build build/ThunderTools -j8
&&
cmake --install build/ThunderTools
- name: Checkout rdkservices
run: |
cd ${{github.workspace}}/rdkservices
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0003-R4.4.1-LocationSync-compilation-error.patch
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0003-R4.4.1-SystemAudioPlayer-compilation-error.patch
cd -
- name: Build Thunder
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/Thunder"
-B build/Thunder
-DMESSAGING=ON
-DHIDE_NON_EXTERNAL_SYMBOLS=OFF
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DBUILD_TYPE=${{env.BUILD_TYPE}}
-DBINDING=127.0.0.1
-DPORT=9998
-DEXCEPTIONS_ENABLE=ON
&&
cmake --build build/Thunder -j8
&&
cmake --install build/Thunder
- name: Checkout ThunderInterfaces
uses: actions/checkout@v3
with:
repository: rdkcentral/ThunderInterfaces
path: ThunderInterfaces
ref: ${{env.INTERFACES_REF}}
run: rm -rf ${{github.workspace}}/ThunderInterfaces/jsonrpc/DTV.json
- name: Apply patch ThunderInterfaces
run: |
cd ThunderInterfaces
echo "Current branch is: $(git branch --show-current)"
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/R.4.4.1-0001-Add-TextToSpeech-Interface.patch
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/SplitDeviceCapablities.patch
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0007-RDK-IDeviceInfo-Changes.patch
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0001-RDK-45037-Secure-Storage-Thunder-Plugin.patch
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/RDKV-48604-User-Settings-Thunder-Plugin.patch
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/Use_Legact_Alt_In_ThunderInterfaces_Based_On_ThunderTools_R4.4.3.patch
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/RDK-51362-System-Mode-Thunder-Plugin.patch
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0001-Add-IAnalytics-interface-R4.4.patch
cd ..
- name: Build ThunderInterfaces
run: >
cmake
-S "${{github.workspace}}/ThunderInterfaces"
-B build/ThunderInterfaces
-DEXCEPTIONS_ENABLE=ON
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
&&
cmake --build build/ThunderInterfaces -j8
&&
cmake --install build/ThunderInterfaces
- name: Generate external headers
# Empty headers to mute errors
run: >
cd "${{github.workspace}}/rdkservices/Tests/"
&&
mkdir -p
headers
headers/rdk/ds
headers/rdk/iarmbus
headers/rdk/iarmmgrs-hal
headers/systemservices
headers/systemservices/proc
&&
cd headers
&&
touch
rdk/ds/host.hpp
rdk/ds/videoOutputPort.hpp
rdk/ds/audioOutputPort.hpp
rdk/ds/sleepMode.hpp
rdk/iarmbus/libIARM.h
rdk/iarmbus/libIBus.h
rdk/iarmbus/libIBusDaemon.h
rdk/iarmmgrs-hal/mfrMgr.h
rdk/iarmmgrs-hal/pwrMgr.h
rdk/iarmmgrs-hal/sysMgr.h
rfcapi.h
rbus.h
libudev.h
systemservices/proc/readproc.h
systemservices/secure_wrapper.h
maintenanceMGR.h
pkg.h
&&
cp -r /usr/include/gstreamer-1.0/gst /usr/include/glib-2.0/* /usr/lib/x86_64-linux-gnu/glib-2.0/include/* /usr/local/include/trower-base64/base64.h .
- name: Set clang toolchain
if: ${{ matrix.compiler == 'clang' }}
run: echo "TOOLCHAIN_FILE=${{github.workspace}}/rdkservices/Tests/clang.cmake" >> $GITHUB_ENV
- name: Set gcc/with-coverage toolchain
if: ${{ matrix.compiler == 'gcc' && matrix.coverage == 'with-coverage' && !env.ACT }}
run: echo "TOOLCHAIN_FILE=${{github.workspace}}/rdkservices/Tests/gcc-with-coverage.cmake" >> $GITHUB_ENV
- name: Build mocks
run: >
cmake
-S "${{github.workspace}}/rdkservices/Tests/mocks"
-B build/mocks
-DBUILD_SHARED_LIBS=ON
-DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
&&
cmake --build build/mocks -j8
&&
cmake --install build/mocks
- name: Build rdkservices
run: >
cmake
-S "${{github.workspace}}/rdkservices"
-B build/rdkservices
-DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DHIDE_NON_EXTERNAL_SYMBOLS=OFF
-DCMAKE_CXX_FLAGS="
-DEXCEPTIONS_ENABLE=ON
-fprofile-arcs
-ftest-coverage
-DUSE_THUNDER_R4=ON
-DTHUNDER_VERSION=4
-DTHUNDER_VERSION_MAJOR=4
-DTHUNDER_VERSION_MINOR=4
-DPLUGIN_PERSISTENTSTORE_PATH="/tmp/secure/persistent/rdkservicestore"
-DPLUGIN_PERSISTENTSTORE_LEGACYPATH="/tmp/persistent/rdkservicestore"
-I ${{github.workspace}}/rdkservices/Tests/headers
-I ${{github.workspace}}/rdkservices/Tests/headers/rdk/ds
-I ${{github.workspace}}/rdkservices/Tests/headers/rdk/iarmbus
-I ${{github.workspace}}/rdkservices/Tests/headers/rdk/iarmmgrs-hal
-I ${{github.workspace}}/rdkservices/Tests/headers/systemservices
-I ${{github.workspace}}/rdkservices/Tests/headers/systemservices/proc
-include ${{github.workspace}}/rdkservices/Tests/mocks/devicesettings.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/Iarm.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/Rfc.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/RBus.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/Udev.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/Wraps.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/maintenanceMGR.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/pkg.h
-Werror -Wall -Wno-unused-result -Wno-deprecated-declarations -Wno-error=format=
-DUSE_IARMBUS
-DDISABLE_SECURITY_TOKEN
-DENABLE_THERMAL_PROTECTION"
-DPLUGIN_PERSISTENTSTORE_PATH="/tmp/secure/persistent/rdkservicestore"
-DPLUGIN_PERSISTENTSTORE_LEGACYPATH="/tmp/persistent/rdkservicestore"
-DCOMCAST_CONFIG=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_DS=ON
-DCMAKE_DISABLE_FIND_PACKAGE_IARMBus=ON
-DCMAKE_DISABLE_FIND_PACKAGE_Udev=ON
-DCMAKE_DISABLE_FIND_PACKAGE_RFC=ON
-DCMAKE_DISABLE_FIND_PACKAGE_RBus=ON
-DPLUGIN_SYSTEMSERVICES=ON
-DPLUGIN_TELEMETRY=ON
-DPLUGIN_HDCPPROFILE=ON
-DPLUGIN_NETWORK=ON
-DPLUGIN_TEXTTOSPEECH=ON
-DPLUGIN_USBACCESS=ON
-DPLUGIN_USERSETTINGS=ON
-DPLUGIN_PERSISTENTSTORE=ON
-DUSE_THUNDER_R4=ON
-DPLUGIN_L2Tests=ON
-DRDK_SERVICE_L2_TEST=ON
-DDS_FOUND=ON
-DPLUGIN_ANALYTICS=ON
-DPLUGIN_ANALYTICS_SIFT_BACKEND=ON
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
&&
cmake --build build/rdkservices -j8
&&
cmake --install build/rdkservices
- name: Set up files
run: >
sudo mkdir -p -m 777
/opt/persistent
/opt/secure
/opt/secure/reboot
/opt/secure/persistent
/opt/secure/persistent/System
/tmp/secure/persistent
/tmp/persistent
/tmp/persistent/rdkservicestore
/opt/logs
/lib/rdk
/run/media/sda1/logs/PreviousLogs
/run/media/sda2/logs/PreviousLogs
/run/sda1/UsbTestFWUpdate
/run/sda1/UsbProdFWUpdate
/run/sda2
&&
sudo touch
/opt/standbyReason.txt
/opt/tmtryoptout
/opt/fwdnldstatus.txt
/opt/dcm.properties
/etc/device.properties
/etc/dcm.properties
/etc/authService.conf
/version.txt
/run/media/sda1/logs/PreviousLogs/logFile.txt
/run/media/sda1/logs/test.txt
/run/media/sda1/logs/test.png
/run/media/sda1/logs/test.docx
/run/media/sda2/logs/test.txt
/run/media/sda2/logs/test.png
/run/sda1/HSTP11MWR_5.11p5s1_VBN_sdy.bin
/run/sda1/UsbTestFWUpdate/HSTP11MWR_3.11p5s1_VBN_sdy.bin
/run/sda1/UsbProdFWUpdate/HSTP11MWR_4.11p5s1_VBN_sdy.bin
/lib/rdk/getMaintenanceStartTime.sh
/tmp/opkg.conf
/tmp/system_service_temp.conf
/tmp/secure/persistent/rdkservicestore
&&
sudo chmod -R 777
/opt/standbyReason.txt
/opt/tmtryoptout
/opt/fwdnldstatus.txt
/opt/dcm.properties
/etc/device.properties
/etc/dcm.properties
/etc/authService.conf
/version.txt
/lib/rdk/getMaintenanceStartTime.sh
/tmp/opkg.conf
/tmp/system_service_temp.conf
/tmp/persistent/rdkservicestore
/tmp/secure/persistent/rdkservicestore
- name: Download pact_verifier_cli
run: >
echo "Copying pact plugins" &&
sudo mkdir -p ~/.pact/plugins/websockets-0.4.1 &&
sudo cp "${{github.workspace}}/rdkservices/Tests/L2Tests/pact/pact-plugin-websockets" ~/.pact/plugins/websockets-0.4.1/ &&
sudo cp "${{github.workspace}}/rdkservices/Tests/L2Tests/pact/pact-plugin.json" ~/.pact/plugins/websockets-0.4.1/ &&
sudo chmod +x ~/.pact/plugins/websockets-0.4.1/pact-plugin-websockets &&
PATH=${{github.workspace}}/install/usr/bin:${PATH}
${{github.workspace}}/rdkservices/Tests/L2Tests/pact/install-verifier-cli.sh
- name: Run unit tests without valgrind
run: >
PATH=${{github.workspace}}/install/usr/bin:${PATH}
LD_LIBRARY_PATH=${{github.workspace}}/install/usr/lib:${{github.workspace}}/install/usr/lib/wpeframework/plugins:${LD_LIBRARY_PATH}
RdkServicesL2Test &&
cp -rf $(pwd)/rdkL2TestResults.json ${{github.workspace}}/rdkL2TestResultsWithoutValgrind.json &&
rm -rf $(pwd)/rdkL2TestResults.json
- name: Run unit tests with valgrind
if: ${{ !env.ACT }}
run: >
PATH=${{github.workspace}}/install/usr/bin:${PATH}
LD_LIBRARY_PATH=${{github.workspace}}/install/usr/lib:${{github.workspace}}/install/usr/lib/wpeframework/plugins:${LD_LIBRARY_PATH}
valgrind
--tool=memcheck
--log-file=valgrind_log
--leak-check=yes
--show-reachable=yes
--track-fds=yes
--fair-sched=try
RdkServicesL2Test &&
cp -rf $(pwd)/rdkL2TestResults.json ${{github.workspace}}/rdkL2TestResultsWithValgrind.json &&
rm -rf $(pwd)/rdkL2TestResults.json
- name: Generate coverage
if: ${{ matrix.coverage == 'with-coverage' && !env.ACT }}
run: >
cp ${{github.workspace}}/rdkservices/Tests/L2Tests/.lcovrc_l2 ~/.lcovrc
&&
lcov -c
-o coverage.info
-d build/rdkservices
&&
lcov
-r coverage.info
'/usr/include/*'
'*/build/rdkservices/_deps/*'
'*/install/usr/include/*'
'*/Tests/headers/*'
'*/Tests/mocks/*'
'*/Tests/L2Tests/*'
-o filtered_coverage.info
&&
genhtml
-o coverage
-t "rdkservices coverage"
filtered_coverage.info
- name: Upload artifacts
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
coverage/
valgrind_log
rdkL2TestResultsWithoutValgrind.json
rdkL2TestResultsWithValgrind.json
if-no-files-found: warn
- name: Run contract tests
if: ${{ !env.ACT }}
env:
PACTFLOW_TOKEN: ${{ secrets.PACTFLOW_TOKEN }}
run: >
PATH=$GITHUB_WORKSPACE/install/usr/bin:${PATH}
LD_LIBRARY_PATH=$GITHUB_WORKSPACE/install/usr/lib:$GITHUB_WORKSPACE/install/usr/lib/wpeframework/plugins:${LD_LIBRARY_PATH}
RdkServicesL2Test CTVerifierMain
- name: Upload contract test results
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
with:
name: Contract test results
path: |
contract-test-results.json
contract-test-statistics.txt
if-no-files-found: warn