Skip to content

RDK-60607: Fix for y2k38 issue and integer overflow #1453

RDK-60607: Fix for y2k38 issue and integer overflow

RDK-60607: Fix for y2k38 issue and integer overflow #1453

Workflow file for this run

name: unit_tests
on:
push:
branches: [ main, develop, release, support/*, hotfix/*, topic/* ]
pull_request:
branches: [ main, develop, release, support/*, hotfix/*, topic/* ]
jobs:
all:
runs-on: ubuntu-22.04
steps:
- name: Set up cache
id: cache
uses: actions/cache@v3
with:
path: |
build
install
key: ${{ runner.os }}-${{ github.sha }}
- name: Set up CMake
# 3.16.x To support flow control commands to be overridden.
# Installs in: find /opt -ipath *bin/cmake
uses: jwlawson/actions-setup-cmake@v1.12
with:
cmake-version: '3.16.x'
- name: Install packages
run: >
sudo apt update && sudo apt install -y libcurl4-openssl-dev libgtest-dev lcov gcovr libmsgpack* libcjson-dev build-essential
- name: Checkout rbus
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
path: rbus
- name: Install dependencies
run: pip install pyyaml
- name: Configure Rbus
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/rbus"
-B build/rbus
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DBUILD_FOR_DESKTOP=ON
-DENABLE_UNIT_TESTING=ON
-DENABLE_CODE_COVERAGE=ON
-DCMAKE_BUILD_TYPE=Debug
- name: Build Rbus
if: steps.cache.outputs.cache-hit != 'true'
run: >
make -C build/rbus
- name: Install rbus
if: steps.cache.outputs.cache-hit != 'true'
run: >
make -C build/rbus install
- name: Start rtrouted
# nohup to keep it running.
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
nohup ./bin/rtrouted -f -l DEBUG > /tmp/rtrouted_log.txt &
- name: Run drop test with inactive provider
continue-on-error: true
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
export RT_LOG_LEVEL=info
nohup ./bin/rbusSampleProvider > /tmp/log_sampleProvider.txt 2>&1 &
sleep 1
nohup stdbuf -oL -eL ./bin/rbusBlockingProvider > /tmp/log_blockingProvider.txt 2>&1 &
sleep 1
./bin/rbusDmlBlockingConsumer > /tmp/log_dmlBlockingConsumer.txt 2>&1
cat /tmp/log_sampleProvider.txt || true
cat /tmp/log_blockingProvider.txt || true
cat /tmp/log_dmlBlockingConsumer.txt || true
- name: Run RbusTestTimeoutValues Unit test
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
export RT_LOG_LEVEL=info
nohup ./bin/rbusTestTimeoutValuesProvider > /tmp/log_testTimeoutValuesProvider.txt &
./bin/rbusTestTimeoutValuesConsumer > /tmp/log_testTimeoutValuesConsumer.txt
- name: Run Unit test
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
export RT_LOG_LEVEL=info
nohup ./bin/rbusTestProvider >/tmp/log_TestAppProvider.txt &
sleep 2
./bin/rbusTestConsumer -a > /tmp/log_TestConsumer.txt
- name: Run multiRbusOpenMethod Unit Test
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
export RT_LOG_LEVEL=info
./bin/multiRbusOpenMethodProvider > /tmp/log_MultiRbusOpenMethodProvider.txt &
./bin/multiRbusOpenMethodConsumer > /tmp/log_MultiRbusOpenMethodConsumer.txt &
- name: Run multiRbusOpenSubscribe Unit test
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
export RT_LOG_LEVEL=info
nohup ./bin/multiRbusOpenProvider >/tmp/log_multiRbusOpenProvider.txt &
./bin/multiRbusOpenConsumer >/tmp/log_multiRbusOpenConsumer.txt
- name: Run multiRbusOpenGet Unit test
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
export RT_LOG_LEVEL=info
nohup ./bin/multiRbusOpenRbusGetProvider >/tmp/log_multiRbusOpenRbusGetProvider.txt &
./bin/multiRbusOpenRbusGetConsumer >/tmp/log_multiRbusOpenRbusGetConsumer.txt
- name: Run multiRbusOpenSet Unit test
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
export RT_LOG_LEVEL=info
nohup ./bin/multiRbusOpenRbusGetProvider >/tmp/log_multiRbusOpenRbusSetProvider.txt &
./bin/multiRbusOpenRbusSetConsumer >/tmp/log_multiRbusOpenRbusSetConsumer.txt
- name: Run Gtest Cases
run: |
cd build/rbus
export RT_LOG_LEVEL=info
nohup ./src/session_manager/rbus_session_mgr &
./unittests/rbus_gtest.bin > /tmp/log_gtestlogs.txt
- name: Stop SessionManager
run: |
killall -15 rbus_session_mgr || true
- name: Stop rtrouted
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
./bin/rtrouted_diag shutdown
- name: Run CodeCoverage
run: |
rm -rf /tmp/rtrouted*
lcov -c -o coverage.info -d build/rbus/src
lcov --remove coverage.info '/usr/include/*' -o filtered-coverage.info
- name: Generate the html report
run: |
genhtml filtered-coverage.info --output-directory /tmp/coverage_report
- name: Upload the coverage report to Pull request using actions
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: /tmp/coverage_report
- name: Checkout log analyzer
uses: actions/checkout@v3
with:
repository: dshett549/NoisyLogAnalyzer
path: log-analyzer
- name: Analyze logs
run: |
cd ${{github.workspace}}/log-analyzer
set -- /tmp/log_*.txt
if [ ! -e "$1" ]; then
echo "No log files found matching /tmp/log_*.txt, skipping log analysis."
exit 0
else
for f in "$@"; do
python3 noisylogdetector.py "$f" "/tmp/noisy_log_report_$(basename "$f" .txt).html" || echo "Failed to analyze $f"
done
fi
- name: Upload the noisy log report to Pull request using actions
uses: actions/upload-artifact@v4
with:
name: noisy-log-report
path: /tmp/noisy_log_report_*.html
if-no-files-found: ignore