Skip to content

Commit

Permalink
Workflow added
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuhammedrafi committed Aug 27, 2024
1 parent 842af5e commit 0e5180f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 158 deletions.
154 changes: 27 additions & 127 deletions .github/workflows/L1-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ on:

env:
BUILD_TYPE: Debug
THUNDER_REF: "5e7c0b1ed3c3dd0fc31c86518a364388dc24273b"
INTERFACES_REF: "930e01ec9aec8aa60254dec0be3beca932df63cd"
THUNDER_REF: "R4.4.1"
THUNDER_TOOLS_REF: "R4.4.1"
INTERFACES_REF: "R4.4.1"

jobs:
l1-tests:
Expand Down Expand Up @@ -73,7 +74,7 @@ jobs:
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
sudo apt install -y libnm0 git pkg-config python3-pip ninja-build libusb-1.0-0-dev zlib1g-dev libssl-dev libcurl4-openssl-dev libglib2.0-dev libnm-dev libsqlite3-dev libcurl4-openssl-dev valgrind lcov clang libsystemd-dev libboost-all-dev libwebsocketpp-dev meson libcunit1 libcunit1-dev
- name: Install GStreamer
run: |
Expand All @@ -90,19 +91,18 @@ jobs:
ninja -C build
sudo ninja -C build install
- name: Checkout Thunder
- name: Checkout ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: rdkcentral/Thunder
path: Thunder
ref: ${{env.THUNDER_REF}}

- name: Build Thunder
repository: rdkcentral/ThunderTools
path: ThunderTools
ref: ${{env.THUNDER_TOOLS_REF}}
- name: Build ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/Thunder/Tools"
-S "${{github.workspace}}/ThunderTools"
-B build/ThunderTools
-DEXCEPTIONS_ENABLE=ON
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
Expand All @@ -112,7 +112,18 @@ jobs:
cmake --build build/ThunderTools -j8
&&
cmake --install build/ThunderTools
&&
- name: Checkout Thunder
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: rdkcentral/Thunder
path: Thunder
ref: ${{env.THUNDER_REF}}

- name: Build Thunder
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/Thunder"
-B build/Thunder
Expand Down Expand Up @@ -262,128 +273,17 @@ jobs:
-DCMAKE_DISABLE_FIND_PACKAGE_Udev=ON
-DCMAKE_DISABLE_FIND_PACKAGE_RFC=ON
-DCMAKE_DISABLE_FIND_PACKAGE_RBus=ON
-DPLUGIN_DATACAPTURE=ON
-DPLUGIN_DEVICEDIAGNOSTICS=ON
-DPLUGIN_LOCATIONSYNC=ON
-DPLUGIN_TIMER=ON
-DPLUGIN_SECURITYAGENT=ON
-DPLUGIN_DEVICEIDENTIFICATION=ON
-DPLUGIN_FRAMERATE=ON
-DPLUGIN_AVINPUT=ON
-DPLUGIN_TELEMETRY=ON
-DPLUGIN_SCREENCAPTURE=ON
-DPLUGIN_USBACCESS=ON
-DPLUGIN_LOGGINGPREFERENCES=ON
-DPLUGIN_USERPREFERENCES=ON
-DPLUGIN_MESSENGER=ON
-DPLUGIN_DEVICEINFO=ON
-DPLUGIN_SYSTEMSERVICES=ON
-DRDK_SERVICES_L1_TEST=ON
-DPLUGIN_HDMIINPUT=ON
-DPLUGIN_HDCPPROFILE=ON
-DPLUGIN_NETWORK=ON
-DPLUGIN_WIFIMANAGER=ON
-DPLUGIN_TRACECONTROL=ON
-DPLUGIN_WAREHOUSE=ON
-DPLUGIN_ACTIVITYMONITOR=ON
-DDS_FOUND=ON
-DPLUGIN_TEXTTOSPEECH=ON
-DPLUGIN_SYSTEMAUDIOPLAYER=ON
-DPLUGIN_MIRACAST=ON
-DPLUGIN_NETWORK=OFF
-DPLUGIN_WIFIMANAGER=OFF
-DPLUGIN_NETWORKMANAGER=ON
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
&&
cmake --build build/rdkservices -j8
cmake --build build/rdkservices -j16
&&
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
/var/run/wpa_supplicant
&&
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
&&
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
- 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}
RdkServicesL1Test
- 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
RdkServicesL1Test
- name: Generate coverage
if: ${{ matrix.coverage == 'with-coverage' && !env.ACT }}
run: >
cp ${{github.workspace}}/rdkservices/Tests/L1Tests/.lcovrc_l1 ~/.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/L1Tests/tests/*'
-o filtered_coverage.info
&&
genhtml
-o coverage
-t "rdkservices coverage"
filtered_coverage.info
- name: Upload artifacts
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
Expand All @@ -392,4 +292,4 @@ jobs:
path: |
coverage/
valgrind_log
if-no-files-found: warn
if-no-files-found: warn
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ if(PLUGIN_SHAREDSTORAGE)
add_subdirectory(SharedStorage)
endif()

if(PLUGIN_NETWORKMANAGER)
add_subdirectory(NetworkManager)
endif()

if(WPEFRAMEWORK_CREATE_IPKG_TARGETS)
set(CPACK_GENERATOR "DEB")
set(CPACK_DEB_COMPONENT_INSTALL ON)
Expand Down
2 changes: 1 addition & 1 deletion NetworkManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if(ENABLE_GNOME_NETWORKMANAGER)
pkg_check_modules(GLIB REQUIRED glib-2.0)
pkg_check_modules(LIBNM REQUIRED libnm)
else()
find_package(IARMBus REQUIRED)
find_package(IARMBus) # REQUIRED removed to workflow work
endif ()


Expand Down
58 changes: 30 additions & 28 deletions NetworkManager/NetworkManagerRDKProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "NetworkManagerConnectivity.h"
#include "WiFiSignalStrengthMonitor.h"
#include "libIBus.h"
#include "UtilsIarm.h"
#include "libIARM.h"

using namespace WPEFramework;
using namespace WPEFramework::Plugin;
Expand Down Expand Up @@ -1214,38 +1216,38 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN] = {
signalStrength = ssidInfo.m_signalStrength;

if (!signalStrength.empty())
{
{
signalStrengthOut = std::stof(signalStrength.c_str());
NMLOG_INFO ("WiFiSignalStrength in dB = %s",signalStrengthOut);
}
NMLOG_INFO ("WiFiSignalStrength in dB = %f",signalStrengthOut);
}

if (signalStrengthOut == 0)
{
quality = WIFI_SIGNAL_DISCONNECTED;
signalStrength = "0";
}
else if (signalStrengthOut >= signalStrengthThresholdExcellent && signalStrengthOut < 0)
{
quality = WIFI_SIGNAL_EXCELLENT;
signalStrength = "100";
}
else if (signalStrengthOut >= signalStrengthThresholdGood && signalStrengthOut < signalStrengthThresholdExcellent)
{
quality = WIFI_SIGNAL_GOOD;
signalStrength = "75";
}
else if (signalStrengthOut >= signalStrengthThresholdFair && signalStrengthOut < signalStrengthThresholdGood)
{
quality = WIFI_SIGNAL_FAIR;
signalStrength = "50";
}
else
{
quality = WIFI_SIGNAL_WEAK;
signalStrength = "25";
}
{
quality = WIFI_SIGNAL_DISCONNECTED;
signalStrength = "0";
}
else if (signalStrengthOut >= signalStrengthThresholdExcellent && signalStrengthOut < 0)
{
quality = WIFI_SIGNAL_EXCELLENT;
signalStrength = "100";
}
else if (signalStrengthOut >= signalStrengthThresholdGood && signalStrengthOut < signalStrengthThresholdExcellent)
{
quality = WIFI_SIGNAL_GOOD;
signalStrength = "75";
}
else if (signalStrengthOut >= signalStrengthThresholdFair && signalStrengthOut < signalStrengthThresholdGood)
{
quality = WIFI_SIGNAL_FAIR;
signalStrength = "50";
}
else
{
quality = WIFI_SIGNAL_WEAK;
signalStrength = "25";
}

NMLOG_INFO ("GetWiFiSignalStrength success");
NMLOG_TRACE ("GetWiFiSignalStrength success");
rc = Core::ERROR_NONE;
}
else
Expand Down
2 changes: 1 addition & 1 deletion NetworkManager/WiFiSignalStrengthMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace WPEFramework
FILE *fp = popen(command, "r");
if (!fp)
{
NMLOG_ERROR("Failed in getting output from command %s \n",command);
NMLOG_ERROR("Failed in getting output from command %s",command);
return keystr;
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/L1Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ FetchContent_Declare(
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
FetchContent_MakeAvailable(googletest)
file(GLOB TESTS tests/*.cpp)
file(GLOB TESTS tests/test_Network.cpp)
add_executable(${PROJECT_NAME}
${TESTS}
../mocks/Rfc.cpp
Expand Down

0 comments on commit 0e5180f

Please sign in to comment.