Skip to content

Commit

Permalink
Merge branch 'sprint/2401' into for_checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
karuna2git authored Mar 8, 2024
2 parents 0dd8530 + cab9af5 commit 8817c48
Show file tree
Hide file tree
Showing 120 changed files with 8,478 additions and 3,495 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/unit-tests.yml → .github/workflows/L1-tests.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: unit-tests
name: l1-tests

on:
push:
Expand All @@ -12,7 +12,7 @@ env:
INTERFACES_REF: "930e01ec9aec8aa60254dec0be3beca932df63cd"

jobs:
unit-tests:
l1-tests:
name: Build and run unit tests
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
build/ThunderTools
install
!install/etc/WPEFramework/plugins
!install/usr/bin/RdkServicesTest
!install/usr/bin/RdkServicesL1Test
!install/usr/include/gmock
!install/usr/include/gtest
!install/usr/lib/libgmockd.a
Expand Down Expand Up @@ -238,11 +238,6 @@ jobs:
-I ${{github.workspace}}/rdkservices/Tests/headers/ccec/drivers
-I ${{github.workspace}}/rdkservices/Tests/headers/network
-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/Telemetry.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/Udev.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/maintenanceMGR.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/pkg.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/secure_wrappermock.h
Expand Down Expand Up @@ -281,7 +276,7 @@ jobs:
-DPLUGIN_MESSENGER=ON
-DPLUGIN_DEVICEINFO=ON
-DPLUGIN_SYSTEMSERVICES=ON
-DRDK_SERVICES_TEST=ON
-DRDK_SERVICES_L1_TEST=ON
-DPLUGIN_HDMIINPUT=ON
-DPLUGIN_HDCPPROFILE=ON
-DPLUGIN_NETWORK=ON
Expand Down Expand Up @@ -345,7 +340,7 @@ jobs:
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}
RdkServicesTest
RdkServicesL1Test
- name: Run unit tests with valgrind
if: ${{ !env.ACT }}
Expand All @@ -359,7 +354,7 @@ jobs:
--show-reachable=yes
--track-fds=yes
--fair-sched=try
RdkServicesTest
RdkServicesL1Test
- name: Generate coverage
if: ${{ matrix.coverage == 'with-coverage' && !env.ACT }}
Expand All @@ -375,7 +370,7 @@ jobs:
'*/install/usr/include/*'
'*/Tests/headers/*'
'*/Tests/mocks/*'
'*/Tests/tests/*'
'*/Tests/L1Tests/tests/*'
-o filtered_coverage.info
&&
genhtml
Expand Down
323 changes: 323 additions & 0 deletions .github/workflows/L2-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
name: l2-tests

on:
push:
branches: [ main, 'sprint/**', 'release/**' ]
pull_request:
branches: [ main, 'sprint/**', 'release/**' ]

env:
BUILD_TYPE: Debug
THUNDER_REF: "5e7c0b1ed3c3dd0fc31c86518a364388dc24273b"
INTERFACES_REF: "669d9c6e5ed7a5938ff26e1e7736adf485c7a205"

jobs:
l2-tests:
name: Build and run L2 tests
runs-on: ubuntu-latest
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
- 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 Thunder
uses: actions/checkout@v3
with:
repository: rdkcentral/Thunder
path: Thunder
ref: ${{env.THUNDER_REF}}

- name: Checkout rdkservices
uses: actions/checkout@v3
with:
path: rdkservices

- name: Apply patch
run: >
cd "${{github.workspace}}/Thunder"
&&
git apply "${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0001-RDK-30034-callsign.patch"
- name: Build Thunder
run: >
cmake
-S "${{github.workspace}}/Thunder/Tools"
-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
&&
cmake
-S "${{github.workspace}}/Thunder"
-B build/Thunder
-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}}

- 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
systemservices/proc/readproc.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
-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}}
-DCMAKE_CXX_FLAGS="-fPIC"
&&
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"
-DCMAKE_CXX_FLAGS="
-DEXCEPTIONS_ENABLE=ON
-fprofile-arcs
-ftest-coverage
-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/maintenanceMGR.h
-include ${{github.workspace}}/rdkservices/Tests/mocks/pkg.h
-Wall -Werror -Wno-error=format=
-DUSE_IARMBUS
-DENABLE_THERMAL_PROTECTION"
-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_L2Tests=ON
-DRDK_SERVICE_L2_TEST=ON
-DDS_FOUND=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
/opt/logs
/lib/rdk
/run/media/sda1/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/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
&&
sudo chmod 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
- 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
- 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
- name: Generate coverage
if: ${{ matrix.coverage == 'with-coverage' && !env.ACT }}
run: >
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
if-no-files-found: warn
Loading

0 comments on commit 8817c48

Please sign in to comment.