From 9f87a31816c8aff6999e9a1bcc4ebdaac63c4c2a Mon Sep 17 00:00:00 2001 From: Aravindan NC <35158113+AravindanNC@users.noreply.github.com> Date: Tue, 22 Jul 2025 15:12:00 -0400 Subject: [PATCH 1/9] RDK-58323: Canary firmware updates (#106) * Update Makefile.am * Update device_status_helper.c * Update flash.c * Update rdkv_main.c * Update rdkv_main.c * Update flash.c * Update flash.c * Update flash.c * Update flash.c * Update flash.c * Update flash.c * Update flash.c * Update flash.c * Update flash.c * Update flash.c * Update flash.c * Update flash.c * Update rdkv_main.c * Update flash.c * Add rbusInterface implementation * Update rbusInterface.c * Update flash.c * Update rfcinterface.h * Update rbusInterface.h * Update rbusInterface.h * Update rbusInterface.c * Update rbusInterface.c * Update rbusInterface.h * Update flash.c * Update rbusInterface.c * Update flash.c * Update flash.c * Update rbusInterface.c * Update flash.c * Update rbusInterface.c * Update flash.c * Update flash.c --- Makefile.am | 6 +- src/device_status_helper.c | 2 +- src/flash.c | 116 +++++++++++++++++++++++++++++- src/rbusInterface/rbusInterface.c | 69 ++++++++++++++++++ src/rbusInterface/rbusInterface.h | 27 +++++++ src/rdkv_main.c | 9 +++ src/rfcInterface/rfcinterface.h | 2 + 7 files changed, 225 insertions(+), 6 deletions(-) create mode 100644 src/rbusInterface/rbusInterface.c create mode 100644 src/rbusInterface/rbusInterface.h diff --git a/Makefile.am b/Makefile.am index 2c59866b..3ec845eb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,8 +20,8 @@ AM_CFLAGS = $(TRACE_CFLAGS) AM_CFLAGS += -Wall -Werror $(cjson_CFLAGS) $(curl_CFLAGS) $(CFLAGS) AM_LDFLAGS = -L$(PKG_CONFIG_SYSROOT_DIR)/$(libdir) -AM_LDFLAGS += $(cjson_LIBS) $(curl_LIBS) -AM_LDFLAGS += -lrdkloggers -ldwnlutil -lfwutils -lsecure_wrapper -lparsejson -lpthread +AM_LDFLAGS += $(cjson_LIBS) $(curl_LIBS) +AM_LDFLAGS += -lrdkloggers -ldwnlutil -lfwutils -lsecure_wrapper -lparsejson -lpthread -lrbus bin_PROGRAMS= rdkvfwupgrader @@ -35,12 +35,14 @@ rdkvfwupgrader_SOURCES = \ ${top_srcdir}/src/download_status_helper.c \ ${top_srcdir}/src/iarmInterface/iarmInterface.c \ ${top_srcdir}/src/rfcInterface/rfcinterface.c \ + ${top_srcdir}/src/rbusInterface/rbusInterface.c \ ${top_srcdir}/src/deviceutils/device_api.c \ ${top_srcdir}/src/deviceutils/deviceutils.c rdkvfwupgrader_include_HEADERS = \ ${top_srcdir}/src/rfcInterface/rfcinterface.h \ ${top_srcdir}/src/iarmInterface/iarmInterface.h \ + ${top_srcdir}/src/rbusInterface/rbusInterface.h \ ${top_srcdir}/src/deviceutils/device_api.h \ ${top_srcdir}/src/deviceutils/deviceutils.h \ ${top_srcdir}/src/include/device_status_helper.h diff --git a/src/device_status_helper.c b/src/device_status_helper.c index 6583a16c..bc51e48a 100644 --- a/src/device_status_helper.c +++ b/src/device_status_helper.c @@ -1094,7 +1094,7 @@ bool checkForValidPCIUpgrade(int trigger_type, const char *myfwversion, const ch t2ValNotify("cloudFWFile_split", (char *)cloudFWFile); SWLOG_INFO("lastdwnlfile:%s\n", last_dwnl_img); SWLOG_INFO("currentImg:%s\n", current_img); - if (trigger_type == 1 || trigger_type == 4) { + if (trigger_type == 1 || trigger_type == 3 || trigger_type == 4) { if ((false == current_img_status) || (false == last_dwnl_status)) { SWLOG_INFO("Unable to fetch current running image file name or last download file\n"); SWLOG_INFO("Error identified with image file comparison !!! Proceeding with firmware version check.\n"); diff --git a/src/flash.c b/src/flash.c index c1e44695..921a4f34 100644 --- a/src/flash.c +++ b/src/flash.c @@ -17,19 +17,26 @@ */ #include +#include #include "rdkv_cdl.h" #include "rdkv_cdl_log_wrapper.h" #include "download_status_helper.h" #include "device_status_helper.h" #include "iarmInterface/iarmInterface.h" #ifndef GTEST_ENABLE +#include "urlHelper.h" +#include "json_parse.h" #include "rdk_fwdl_utils.h" #include "system_utils.h" +#include "rbusInterface/rbusInterface.h" #endif #include "rfcInterface/rfcinterface.h" #include #include "deviceutils.h" +extern int getTriggerType(); +extern void t2CountNotify(char *marker, int val); + /* Description:Use for Flashing the image * @param: server_url : server url * @param: upgrade_file : Image file to be flash @@ -138,10 +145,25 @@ int flashImage(const char *server_url, const char *upgrade_file, const char *reb snprintf(fwdls.status, sizeof(fwdls.status), "Status|Success\n"); snprintf(fwdls.FwUpdateState, sizeof(fwdls.FwUpdateState), "FwUpdateState|Validation complete\n"); snprintf(fwdls.failureReason, sizeof(fwdls.failureReason), "FailureReason|"); - if (((strncmp(maint, "true", 4)) == 0) && (0 == (strncmp(reboot_flag, "true", 4)))) { + char *pXconfCheckNow = calloc(10, sizeof(char)); + FILE *canFile = fopen("/tmp/xconfchecknow_val", "r"); + if (canFile != NULL) { + int fret = fscanf(canFile, "%9s", pXconfCheckNow); + if (fret <= 0) { + SWLOG_ERROR("Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow: Error reading from file\n"); + } + fclose(canFile); + } + else { + SWLOG_INFO("Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow: File does not exist\n"); + } + if (((strncmp(maint, "true", 4)) == 0) && (0 == (strncmp(reboot_flag, "true", 4))) && ((0 != strcasecmp("CANARY", pXconfCheckNow)) || (getTriggerType() != 3))) { eventManager("MaintenanceMGR", MAINT_CRITICAL_UPDATE); SWLOG_INFO("Posting Critical update"); } + if( pXconfCheckNow != NULL ) { + free(pXconfCheckNow); + } if (0 == filePresentCheck(upgrade_file)) { SWLOG_INFO("flashImage: Flashing completed. Deleting File:%s\n", upgrade_file); unlink(upgrade_file); @@ -276,6 +298,21 @@ int postFlash(const char *maint, const char *upgrade_file, int upgrade_type, con } sleep(5); sync(); + char* pXconfCheckNow = calloc(10, sizeof(char)); + if (pXconfCheckNow == NULL) { + SWLOG_ERROR("Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow: CALLOC failure\n"); + return ret; + } + FILE *file = fopen("/tmp/xconfchecknow_val", "r"); + if (file != NULL) { + if (fscanf(file, "%9s", pXconfCheckNow) == EOF) { + SWLOG_ERROR("Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow: Error reading file\n"); + } + fclose(file); + } + else { + SWLOG_INFO("Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow: Error opening file for read\n"); + } if (0 != (filePresentCheck("/tmp/fw_preparing_to_reboot"))) { fp = fopen("/tmp/fw_preparing_to_reboot", "w"); if (fp == NULL) { @@ -284,7 +321,9 @@ int postFlash(const char *maint, const char *upgrade_file, int upgrade_type, con SWLOG_INFO("Creating flag for preparing to reboot event sent to AS/EPG\n"); fclose(fp); } - eventManager(FW_STATE_EVENT,FW_STATE_PREPARING_TO_REBOOT); + if ((0 != strcasecmp("CANARY", pXconfCheckNow)) || (getTriggerType() != 3)) { + eventManager(FW_STATE_EVENT,FW_STATE_PREPARING_TO_REBOOT); + } } if (upgrade_type == PDRI_UPGRADE) { SWLOG_INFO("Reboot Not Needed after PDRI Upgrade..!\n"); @@ -295,7 +334,75 @@ int postFlash(const char *maint, const char *upgrade_file, int upgrade_type, con fprintf(fp, "%s\n", upgrade_file); fclose(fp); } - if (0 == (strncmp(maint, "true", 4))) { + if ((0 == strcasecmp("CANARY", pXconfCheckNow)) && (getTriggerType() == 3)) { + + char post_data[] = "{\"jsonrpc\":\"2.0\",\"id\":\"42\",\"method\": \"org.rdk.System.getPowerState\"}"; + DownloadData DwnLoc = {NULL, 0, 0}; + JSON *pJson = NULL; + JSON *pItem = NULL; + JSON *res_val = NULL; + + if( MemDLAlloc( &DwnLoc, DEFAULT_DL_ALLOC ) == 0 ) { + if (0 != getJsonRpc(post_data, &DwnLoc)) { + SWLOG_INFO("%s :: isconnected JsonRpc call failed\n",__FUNCTION__); + free(pXconfCheckNow); + if (DwnLoc.pvOut != NULL) { + free(DwnLoc.pvOut); + } + return ret; + } + pJson = ParseJsonStr( (char *)DwnLoc.pvOut ); + if( pJson != NULL ) { + pItem = GetJsonItem( pJson, "result" ); + res_val = GetJsonItem( pItem, "powerState" ); + } + else { + SWLOG_INFO("%s :: isconnected JsonRpc response is empty\n",__FUNCTION__); + free(pXconfCheckNow); + if (DwnLoc.pvOut != NULL) { + free(DwnLoc.pvOut); + } + return ret; + } + } + + if(res_val != NULL) { + if(0 == strcasecmp("ON", res_val->valuestring)) { + SWLOG_INFO("Defer Reboot for Canary Firmware Upgrade since power state is ON\n"); + t2CountNotify("SYS_INFO_DEFER_CANARY_REBOOT", 1); + } +#ifndef GTEST_ENABLE + else { + // Call rbus method - Device.X_RDKCENTRAL-COM_T2.UploadDCMReport + if( RBUS_ERROR_SUCCESS != invokeRbusDCMReport()) { + SWLOG_ERROR("Error in uploading telemetry report\n"); + if( DwnLoc.pvOut != NULL ) { + free( DwnLoc.pvOut ); + } + if( pJson != NULL ) { + FreeJson( pJson ); + } + if ( pXconfCheckNow != NULL ) { + free(pXconfCheckNow); + } + return ret; + } + if (0 == (strncmp(reboot_flag, "true", 4))) { + SWLOG_INFO("Rebooting from RDK for Canary Firmware Upgrade\n"); + t2CountNotify("SYS_INFO_CANARY_Update", 1); + v_secure_system("sh /rebootNow.sh -s '%s' -o '%s'","CANARY_Update", "Rebooting the box from RDK for Pending Canary Firmware Upgrade..."); + } + } +#endif + } + if( DwnLoc.pvOut != NULL ) { + free( DwnLoc.pvOut ); + } + if( pJson != NULL ) { + FreeJson( pJson ); + } + } + else if (0 == (strncmp(maint, "true", 4))) { eventManager("MaintenanceMGR", MAINT_REBOOT_REQUIRED); if (0 == (strncmp(device_name, "PLATCO", 6)) && (0 == (strncmp(reboot_flag, "true", 4)))) { SWLOG_INFO("Send notification to reboot in 10mins due to critical upgrade\n"); @@ -324,5 +431,8 @@ int postFlash(const char *maint, const char *upgrade_file, int upgrade_type, con } } } + if( pXconfCheckNow != NULL ) { + free(pXconfCheckNow); + } return 0; } diff --git a/src/rbusInterface/rbusInterface.c b/src/rbusInterface/rbusInterface.c new file mode 100644 index 00000000..40abddfc --- /dev/null +++ b/src/rbusInterface/rbusInterface.c @@ -0,0 +1,69 @@ +/* + * Copyright 2023 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 + */ + +#ifndef GTEST_ENABLE +#include +#include "rbusInterface.h" + +/* Description:Use for Rbus callback + * @param: handle : rbus handle + * @param: methodName : Method name + * @param: error : rbus return value type + * @param: param : rbus object + * @return void : NA + * */ +static void t2EventHandler(rbusHandle_t handle, char const* methodName, rbusError_t error, rbusObject_t param) +{ + SWLOG_INFO("Got %s rbus callback\n", methodName); + if (RBUS_ERROR_SUCCESS == error) + { + rbusValue_t uploadStatus = rbusObject_GetValue(param, "UPLOAD_STATUS"); + if(uploadStatus) + { + SWLOG_INFO("Device.X_RDKCENTRAL-COM_T2.UploadDCMReport Upload Status = %s\n", rbusValue_GetString(uploadStatus, NULL)); + } + } +} + +/* Description: Trigger T2 upload + * @return rbusError_t : Return SUCCESS/FAILURE + * */ +rbusError_t invokeRbusDCMReport() +{ + rbusHandle_t rdkfwRbusHandle; + if (RBUS_ERROR_SUCCESS == rbus_open(&rdkfwRbusHandle, RDKFWUPGRADER_RBUS_HANDLE_NAME)) { + if (RBUS_ERROR_SUCCESS == rbusMethod_InvokeAsync(rdkfwRbusHandle, T2_UPLOAD, NULL, t2EventHandler, 0)) { + SWLOG_INFO("Waiting 60 sec to complete upload from Device.X_RDKCENTRAL-COM_T2.UploadDCMReport\n"); + sleep(60); + } + else { + SWLOG_ERROR("Error in calling Device.X_RDKCENTRAL-COM_T2.UploadDCMReport\n"); + return RBUS_ERROR_BUS_ERROR; + } + } + else { + SWLOG_ERROR("Error in opening rbus handle\n"); + return RBUS_ERROR_BUS_ERROR; + } + if (RBUS_ERROR_SUCCESS != rbus_close(rdkfwRbusHandle)) { + SWLOG_ERROR("Rbus termination failed\n"); + return RBUS_ERROR_BUS_ERROR; + } + return RBUS_ERROR_SUCCESS; +} +#endif diff --git a/src/rbusInterface/rbusInterface.h b/src/rbusInterface/rbusInterface.h new file mode 100644 index 00000000..f77a79ea --- /dev/null +++ b/src/rbusInterface/rbusInterface.h @@ -0,0 +1,27 @@ +/* + * Copyright 2023 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 + */ + +#ifndef GTEST_ENABLE +#include "rbus/rbus.h" +#include "rdkv_cdl_log_wrapper.h" + +#define RDKFWUPGRADER_RBUS_HANDLE_NAME "rdkfwRbus" +#define T2_UPLOAD "Device.X_RDKCENTRAL-COM_T2.UploadDCMReport" + +rbusError_t invokeRbusDCMReport(); +#endif diff --git a/src/rdkv_main.c b/src/rdkv_main.c index 4ff86117..5f71e2d5 100644 --- a/src/rdkv_main.c +++ b/src/rdkv_main.c @@ -86,6 +86,15 @@ static pthread_mutex_t app_mode_status = PTHREAD_MUTEX_INITIALIZER; static int app_mode = 1; // 1: fore ground and 0: background int force_exit = 0; //This use when rdkvfwupgrader rcv appmode background and thottle speed is set to zero. +/* Description: Get trigger type info. + * @param: NA + * @return: int + * */ +int getTriggerType() +{ + return trigger_type; +} + /* Description: Set App mode. * @param: state : set state * @return: void diff --git a/src/rfcInterface/rfcinterface.h b/src/rfcInterface/rfcinterface.h index f7085343..24fcf37b 100644 --- a/src/rfcInterface/rfcinterface.h +++ b/src/rfcInterface/rfcinterface.h @@ -87,6 +87,8 @@ typedef struct rfcdetails { #define RFC_FW_AUTO_EXCLUDE "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.FWUpdate.AutoExcluded.Enable" #define RFC_DEBUGSRV "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DbgServices.Enable" +#define RFC_XCONF_CHECK_NOW "Device.X_COMCAST-COM_Xcalibur.Client.xconfCheckNow" + int getRFCSettings(Rfc_t *rfc_list); int read_RFCProperty(char* type, const char* key, char *data, size_t datasize); From 5b77918a8457523b7bd6c84f202b62589607ca28 Mon Sep 17 00:00:00 2001 From: nanimatta <84963246+nanimatta@users.noreply.github.com> Date: Wed, 23 Jul 2025 13:38:31 -0400 Subject: [PATCH 2/9] RDKEMW-5953 Xconf rule gets changed for Westinghouse Reason for change: added fix to remove \n @ end of manufacturer Test Procedure: Refer JIRA Risks: Medium Priority: P1 --- src/deviceutils/device_api.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/deviceutils/device_api.c b/src/deviceutils/device_api.c index ce7fc98a..d900122f 100644 --- a/src/deviceutils/device_api.c +++ b/src/deviceutils/device_api.c @@ -283,6 +283,7 @@ size_t GetAdditionalFwVerInfo( char *pAdditionalFwVerInfo, size_t szBufSize ) { len += GetRemoteInfo( (pAdditionalFwVerInfo + len), (szBufSize - len) ); } + len = stripinvalidchar(pAdditionalFwVerInfo, szBufSize); // remove newline etc. } else { From a780a636b82edd8afcc005e28865b18e6cf1bb9e Mon Sep 17 00:00:00 2001 From: nanimatta <84963246+nanimatta@users.noreply.github.com> Date: Wed, 23 Jul 2025 14:00:44 -0400 Subject: [PATCH 3/9] RDKEMW-5953 Xconf rule gets changed for Westinghouse --- src/deviceutils/device_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/deviceutils/device_api.c b/src/deviceutils/device_api.c index d900122f..37f316c6 100644 --- a/src/deviceutils/device_api.c +++ b/src/deviceutils/device_api.c @@ -283,7 +283,7 @@ size_t GetAdditionalFwVerInfo( char *pAdditionalFwVerInfo, size_t szBufSize ) { len += GetRemoteInfo( (pAdditionalFwVerInfo + len), (szBufSize - len) ); } - len = stripinvalidchar(pAdditionalFwVerInfo, szBufSize); // remove newline etc. + len = stripinvalidchar(pAdditionalFwVerInfo, len); // remove newline etc. } else { From 9bc3d94d4908f6e0d14ff39c51cebdb930061294 Mon Sep 17 00:00:00 2001 From: mtirum011 Date: Fri, 1 Aug 2025 11:10:37 +0000 Subject: [PATCH 4/9] RDKEMW-6105 Update L1 tests in rdkvfwupdater to include rbus --- src/flash.c | 2 + src/rbusInterface/rbusInterface.c | 11 +++++- src/rbusInterface/rbusInterface.h | 5 ++- unittest/Makefile.am | 4 +- unittest/fwdl_interface_gtest.cpp | 20 ++++++++++ unittest/mocks/rbus_mock.c | 61 +++++++++++++++++++++++++++++ unittest/mocks/rbus_mock.h | 65 +++++++++++++++++++++++++++++++ 7 files changed, 163 insertions(+), 5 deletions(-) create mode 100644 unittest/mocks/rbus_mock.c create mode 100644 unittest/mocks/rbus_mock.h diff --git a/src/flash.c b/src/flash.c index 921a4f34..50de4793 100644 --- a/src/flash.c +++ b/src/flash.c @@ -29,6 +29,8 @@ #include "rdk_fwdl_utils.h" #include "system_utils.h" #include "rbusInterface/rbusInterface.h" +#else +#include "rbus_mock.h" #endif #include "rfcInterface/rfcinterface.h" #include diff --git a/src/rbusInterface/rbusInterface.c b/src/rbusInterface/rbusInterface.c index 40abddfc..580e334b 100644 --- a/src/rbusInterface/rbusInterface.c +++ b/src/rbusInterface/rbusInterface.c @@ -19,7 +19,10 @@ #ifndef GTEST_ENABLE #include #include "rbusInterface.h" - +#else +#include "rbus_mock.h" +#include +#endif /* Description:Use for Rbus callback * @param: handle : rbus handle * @param: methodName : Method name @@ -66,4 +69,10 @@ rbusError_t invokeRbusDCMReport() } return RBUS_ERROR_SUCCESS; } + +#ifdef GTEST_ENABLE +void (*getT2EventHandler(void))(rbusHandle_t handle, const char* methodName, rbusError_t error, rbusObject_t param) +{ + return &t2EventHandler; +} #endif diff --git a/src/rbusInterface/rbusInterface.h b/src/rbusInterface/rbusInterface.h index f77a79ea..1eefa23a 100644 --- a/src/rbusInterface/rbusInterface.h +++ b/src/rbusInterface/rbusInterface.h @@ -19,9 +19,10 @@ #ifndef GTEST_ENABLE #include "rbus/rbus.h" #include "rdkv_cdl_log_wrapper.h" - +#else +#include "rbus_mock.h" +#endif #define RDKFWUPGRADER_RBUS_HANDLE_NAME "rdkfwRbus" #define T2_UPLOAD "Device.X_RDKCENTRAL-COM_T2.UploadDCMReport" rbusError_t invokeRbusDCMReport(); -#endif diff --git a/unittest/Makefile.am b/unittest/Makefile.am index b8630401..a040f8c4 100644 --- a/unittest/Makefile.am +++ b/unittest/Makefile.am @@ -21,7 +21,7 @@ AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = rdkfw_device_status_gtest rdkfw_deviceutils_gtest rdkfw_main_gtest rdkfw_interface_gtest # Define the include directories -COMMON_CPPFLAGS = -std=c++11 -I/usr/include/cjson -I../src -I../src/cedmInterface -I../src/deviceutils/ -I../src/rfcInterface/ -I../src/iarmInterface/ -I../src/include/ -I./mocks/ -I./deviceutils/ -DGTEST_ENABLE -DGTEST_BASIC -DIARM_ENABLED -DRFC_API_ENABLED -DT2_EVENT_ENABLED +COMMON_CPPFLAGS = -std=c++11 -I/usr/include/cjson -I../src -I../src/cedmInterface -I../src/deviceutils/ -I../src/rfcInterface/ -I../src/iarmInterface/ -I../src/include/ -I../src/rbusInterface/ -I./mocks/ -I./deviceutils/ -DGTEST_ENABLE -DGTEST_BASIC -DIARM_ENABLED -DRFC_API_ENABLED -DT2_EVENT_ENABLED # Define the libraries to link against COMMON_LDADD = -lgtest -lgtest_main -lgmock_main -lgmock -lcjson -lgcov @@ -35,7 +35,7 @@ rdkfw_deviceutils_gtest_SOURCES = deviceutils/device_api_gtest.cpp deviceutils/d rdkfw_main_gtest_SOURCES = basic_rdkv_main_gtest.cpp ../src/rdkv_main.c ../src/chunk.c ../src/flash.c ../src/json_process.c ../src/deviceutils/device_api.c deviceutils/json_parse.c ./mocks/deviceutils_mock.cpp ../src/deviceutils/deviceutils.c -rdkfw_interface_gtest_SOURCES = fwdl_interface_gtest.cpp ./mocks/interface_mock.cpp ../src/rfcInterface/rfcinterface.c ../src/iarmInterface/iarmInterface.c deviceutils/json_parse.c +rdkfw_interface_gtest_SOURCES = fwdl_interface_gtest.cpp ./mocks/interface_mock.cpp ../src/rfcInterface/rfcinterface.c ../src/iarmInterface/iarmInterface.c ./mocks/mock_rbus.c ../src/rbusInterface/rbusInterface.c deviceutils/json_parse.c # Apply common properties to each program rdkfw_device_status_gtest_CPPFLAGS = $(COMMON_CPPFLAGS) diff --git a/unittest/fwdl_interface_gtest.cpp b/unittest/fwdl_interface_gtest.cpp index 60174538..00b66fb0 100644 --- a/unittest/fwdl_interface_gtest.cpp +++ b/unittest/fwdl_interface_gtest.cpp @@ -24,9 +24,13 @@ extern "C" { #include "rfcinterface.h" #include "iarmInterface.h" +#include "rbusInterface.h" void DwnlStopEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len); +typedef void (*T2EventHandlerType)(rbusHandle_t handle, const char* methodName, rbusError_t error, rbusObject_t param); +T2EventHandlerType getT2EventHandler(void); } #include "./mocks/interface_mock.h" +#include "./mocks/mock_rbus.h" #define IMG_DWL_EVENT "ImageDwldEvent" #define FW_STATE_EVENT "FirmwareStateEvent" @@ -265,6 +269,22 @@ TEST_F(InterfaceTestFixture, TestName_eventManagerFail) eventManager(IMG_DWL_EVENT, "2"); EXPECT_EQ(0, 0); } +TEST_F(InterfaceTestFixture, TestName_invokeRbusDCMReport) +{ + rbusError_t status = invokeRbusDCMReport(); + EXPECT_EQ(status, RBUS_ERROR_SUCCESS); +} +TEST_F(InterfaceTestFixture, TestName_t2EventHandler) +{ + T2EventHandlerType handler = getT2EventHandler(); + EXPECT_NE(handler, nullptr); + + rbusHandle_t testHandle = nullptr; + const char* testName = "TestMethod"; + rbusObject_t testParam = (rbusObject_t)0x123; + handler(testHandle, testName, RBUS_ERROR_SUCCESS, testParam); + EXPECT_EQ(0, 0); +} GTEST_API_ int main(int argc, char *argv[]){ char testresults_fullfilepath[GTEST_REPORT_FILEPATH_SIZE]; diff --git a/unittest/mocks/rbus_mock.c b/unittest/mocks/rbus_mock.c new file mode 100644 index 00000000..47954b8a --- /dev/null +++ b/unittest/mocks/rbus_mock.c @@ -0,0 +1,61 @@ +/* + * Copyright 2023 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 + */ +#include "rbus_mock.h" +#include +#include + +// Simulated global handle +static rbusHandle_t dummyHandle = (rbusHandle_t)0x1234; + +// Simulated value for UPLOAD_STATUS +static int uploadStatusValue = 1; + +rbusError_t rbus_open(rbusHandle_t* handle, const char* componentName) { + printf("Mock rbus_open called with name: %s\n", componentName); + *handle = dummyHandle; + return RBUS_ERROR_SUCCESS; +} + +rbusError_t rbus_close(rbusHandle_t handle) { + printf("Mock rbus_close called\n"); + return RBUS_ERROR_SUCCESS; +} + +rbusError_t rbusMethod_InvokeAsync(rbusHandle_t handle, const char* method, rbusObject_t input, rbusMethodAsyncRespHandler_t handler, int timeout) { + printf("Mock rbusMethod_InvokeAsync called with method: %s, timeout: %d\n", method, timeout); + if (handler) { + handler(); // Simulate callback + } + return RBUS_ERROR_SUCCESS; +} + +rbusValue_t rbusObject_GetValue(rbusObject_t obj, const char* name) { + printf("Mock rbusObject_GetValue called with name: %s\n", name); + if (strcmp(name, "UPLOAD_STATUS") == 0) { + return (rbusValue_t)&uploadStatusValue; + } + return NULL; +} + +const char* rbusValue_GetString(rbusValue_t value, void* unused) +{ + (void)unused; // unused parameter + + return "MockedUploadStatus"; +} + diff --git a/unittest/mocks/rbus_mock.h b/unittest/mocks/rbus_mock.h new file mode 100644 index 00000000..90b877bc --- /dev/null +++ b/unittest/mocks/rbus_mock.h @@ -0,0 +1,65 @@ +/* + * Copyright 2023 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 + */ +#ifndef RBUS_MOCK_H +#define RBUS_MOCK_H + +#include "../rdkv_cdl_log_wrapper.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define RBUS_ERROR_SUCCESS 0 +#define RBUS_ERROR_BUS_ERROR 1 + +#define RDKFWUPGRADER_RBUS_HANDLE_NAME "rdkfwRbus" +#define T2_UPLOAD "Device.X_RDKCENTRAL-COM_T2.UploadDCMReport" + +typedef int rbusError_t; + +struct _rbusHandle +{ +}; + +typedef struct _rbusHandle *rbusHandle_t; + +struct _rbusObject +{ +}; +typedef struct _rbusObject *rbusObject_t; + +struct _rbusValue +{ +}; +typedef struct _rbusValue *rbusValue_t; + +typedef void (*rbusMethodAsyncRespHandler_t)(void); + +//typedef void (*rbusMethodAsyncRespHandler_t)(rbusHandle_t handle, char const *methodName, rbusError_t error, rbusObject_t params); + +rbusError_t rbus_open(rbusHandle_t *handle, const char* componentName); +rbusError_t rbus_close(rbusHandle_t handle); +rbusError_t rbusMethod_InvokeAsync(rbusHandle_t handle, const char* method, rbusObject_t input, rbusMethodAsyncRespHandler_t handler, int timeout); +rbusValue_t rbusObject_GetValue(rbusObject_t obj, const char* name); +const char* rbusValue_GetString(rbusValue_t value, void* unused); + +#ifdef __cplusplus +} +#endif + +#endif // RBUS_MOCK_H From 3bfdda543afce1f3bc606b0d5c15ab4cfe6477f7 Mon Sep 17 00:00:00 2001 From: mtirum011 Date: Fri, 1 Aug 2025 11:10:37 +0000 Subject: [PATCH 5/9] RDKEMW-6105 Update L1 tests in rdkvfwupdater to include rbus --- src/flash.c | 2 + src/rbusInterface/rbusInterface.c | 11 +++++- src/rbusInterface/rbusInterface.h | 5 ++- unittest/Makefile.am | 4 +- unittest/fwdl_interface_gtest.cpp | 20 ++++++++++ unittest/mocks/rbus_mock.c | 61 +++++++++++++++++++++++++++++ unittest/mocks/rbus_mock.h | 65 +++++++++++++++++++++++++++++++ 7 files changed, 163 insertions(+), 5 deletions(-) create mode 100644 unittest/mocks/rbus_mock.c create mode 100644 unittest/mocks/rbus_mock.h diff --git a/src/flash.c b/src/flash.c index 921a4f34..50de4793 100644 --- a/src/flash.c +++ b/src/flash.c @@ -29,6 +29,8 @@ #include "rdk_fwdl_utils.h" #include "system_utils.h" #include "rbusInterface/rbusInterface.h" +#else +#include "rbus_mock.h" #endif #include "rfcInterface/rfcinterface.h" #include diff --git a/src/rbusInterface/rbusInterface.c b/src/rbusInterface/rbusInterface.c index 40abddfc..580e334b 100644 --- a/src/rbusInterface/rbusInterface.c +++ b/src/rbusInterface/rbusInterface.c @@ -19,7 +19,10 @@ #ifndef GTEST_ENABLE #include #include "rbusInterface.h" - +#else +#include "rbus_mock.h" +#include +#endif /* Description:Use for Rbus callback * @param: handle : rbus handle * @param: methodName : Method name @@ -66,4 +69,10 @@ rbusError_t invokeRbusDCMReport() } return RBUS_ERROR_SUCCESS; } + +#ifdef GTEST_ENABLE +void (*getT2EventHandler(void))(rbusHandle_t handle, const char* methodName, rbusError_t error, rbusObject_t param) +{ + return &t2EventHandler; +} #endif diff --git a/src/rbusInterface/rbusInterface.h b/src/rbusInterface/rbusInterface.h index f77a79ea..1eefa23a 100644 --- a/src/rbusInterface/rbusInterface.h +++ b/src/rbusInterface/rbusInterface.h @@ -19,9 +19,10 @@ #ifndef GTEST_ENABLE #include "rbus/rbus.h" #include "rdkv_cdl_log_wrapper.h" - +#else +#include "rbus_mock.h" +#endif #define RDKFWUPGRADER_RBUS_HANDLE_NAME "rdkfwRbus" #define T2_UPLOAD "Device.X_RDKCENTRAL-COM_T2.UploadDCMReport" rbusError_t invokeRbusDCMReport(); -#endif diff --git a/unittest/Makefile.am b/unittest/Makefile.am index b8630401..dfddfe30 100644 --- a/unittest/Makefile.am +++ b/unittest/Makefile.am @@ -21,7 +21,7 @@ AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = rdkfw_device_status_gtest rdkfw_deviceutils_gtest rdkfw_main_gtest rdkfw_interface_gtest # Define the include directories -COMMON_CPPFLAGS = -std=c++11 -I/usr/include/cjson -I../src -I../src/cedmInterface -I../src/deviceutils/ -I../src/rfcInterface/ -I../src/iarmInterface/ -I../src/include/ -I./mocks/ -I./deviceutils/ -DGTEST_ENABLE -DGTEST_BASIC -DIARM_ENABLED -DRFC_API_ENABLED -DT2_EVENT_ENABLED +COMMON_CPPFLAGS = -std=c++11 -I/usr/include/cjson -I../src -I../src/cedmInterface -I../src/deviceutils/ -I../src/rfcInterface/ -I../src/iarmInterface/ -I../src/include/ -I../src/rbusInterface/ -I./mocks/ -I./deviceutils/ -DGTEST_ENABLE -DGTEST_BASIC -DIARM_ENABLED -DRFC_API_ENABLED -DT2_EVENT_ENABLED # Define the libraries to link against COMMON_LDADD = -lgtest -lgtest_main -lgmock_main -lgmock -lcjson -lgcov @@ -35,7 +35,7 @@ rdkfw_deviceutils_gtest_SOURCES = deviceutils/device_api_gtest.cpp deviceutils/d rdkfw_main_gtest_SOURCES = basic_rdkv_main_gtest.cpp ../src/rdkv_main.c ../src/chunk.c ../src/flash.c ../src/json_process.c ../src/deviceutils/device_api.c deviceutils/json_parse.c ./mocks/deviceutils_mock.cpp ../src/deviceutils/deviceutils.c -rdkfw_interface_gtest_SOURCES = fwdl_interface_gtest.cpp ./mocks/interface_mock.cpp ../src/rfcInterface/rfcinterface.c ../src/iarmInterface/iarmInterface.c deviceutils/json_parse.c +rdkfw_interface_gtest_SOURCES = fwdl_interface_gtest.cpp ./mocks/interface_mock.cpp ../src/rfcInterface/rfcinterface.c ../src/iarmInterface/iarmInterface.c ./mocks/rbus_mock.c ../src/rbusInterface/rbusInterface.c deviceutils/json_parse.c # Apply common properties to each program rdkfw_device_status_gtest_CPPFLAGS = $(COMMON_CPPFLAGS) diff --git a/unittest/fwdl_interface_gtest.cpp b/unittest/fwdl_interface_gtest.cpp index 60174538..5809c2b7 100644 --- a/unittest/fwdl_interface_gtest.cpp +++ b/unittest/fwdl_interface_gtest.cpp @@ -24,9 +24,13 @@ extern "C" { #include "rfcinterface.h" #include "iarmInterface.h" +#include "rbusInterface.h" void DwnlStopEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len); +typedef void (*T2EventHandlerType)(rbusHandle_t handle, const char* methodName, rbusError_t error, rbusObject_t param); +T2EventHandlerType getT2EventHandler(void); } #include "./mocks/interface_mock.h" +#include "./mocks/rbus_mock.h" #define IMG_DWL_EVENT "ImageDwldEvent" #define FW_STATE_EVENT "FirmwareStateEvent" @@ -265,6 +269,22 @@ TEST_F(InterfaceTestFixture, TestName_eventManagerFail) eventManager(IMG_DWL_EVENT, "2"); EXPECT_EQ(0, 0); } +TEST_F(InterfaceTestFixture, TestName_invokeRbusDCMReport) +{ + rbusError_t status = invokeRbusDCMReport(); + EXPECT_EQ(status, RBUS_ERROR_SUCCESS); +} +TEST_F(InterfaceTestFixture, TestName_t2EventHandler) +{ + T2EventHandlerType handler = getT2EventHandler(); + EXPECT_NE(handler, nullptr); + + rbusHandle_t testHandle = nullptr; + const char* testName = "TestMethod"; + rbusObject_t testParam = (rbusObject_t)0x123; + handler(testHandle, testName, RBUS_ERROR_SUCCESS, testParam); + EXPECT_EQ(0, 0); +} GTEST_API_ int main(int argc, char *argv[]){ char testresults_fullfilepath[GTEST_REPORT_FILEPATH_SIZE]; diff --git a/unittest/mocks/rbus_mock.c b/unittest/mocks/rbus_mock.c new file mode 100644 index 00000000..47954b8a --- /dev/null +++ b/unittest/mocks/rbus_mock.c @@ -0,0 +1,61 @@ +/* + * Copyright 2023 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 + */ +#include "rbus_mock.h" +#include +#include + +// Simulated global handle +static rbusHandle_t dummyHandle = (rbusHandle_t)0x1234; + +// Simulated value for UPLOAD_STATUS +static int uploadStatusValue = 1; + +rbusError_t rbus_open(rbusHandle_t* handle, const char* componentName) { + printf("Mock rbus_open called with name: %s\n", componentName); + *handle = dummyHandle; + return RBUS_ERROR_SUCCESS; +} + +rbusError_t rbus_close(rbusHandle_t handle) { + printf("Mock rbus_close called\n"); + return RBUS_ERROR_SUCCESS; +} + +rbusError_t rbusMethod_InvokeAsync(rbusHandle_t handle, const char* method, rbusObject_t input, rbusMethodAsyncRespHandler_t handler, int timeout) { + printf("Mock rbusMethod_InvokeAsync called with method: %s, timeout: %d\n", method, timeout); + if (handler) { + handler(); // Simulate callback + } + return RBUS_ERROR_SUCCESS; +} + +rbusValue_t rbusObject_GetValue(rbusObject_t obj, const char* name) { + printf("Mock rbusObject_GetValue called with name: %s\n", name); + if (strcmp(name, "UPLOAD_STATUS") == 0) { + return (rbusValue_t)&uploadStatusValue; + } + return NULL; +} + +const char* rbusValue_GetString(rbusValue_t value, void* unused) +{ + (void)unused; // unused parameter + + return "MockedUploadStatus"; +} + diff --git a/unittest/mocks/rbus_mock.h b/unittest/mocks/rbus_mock.h new file mode 100644 index 00000000..90b877bc --- /dev/null +++ b/unittest/mocks/rbus_mock.h @@ -0,0 +1,65 @@ +/* + * Copyright 2023 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 + */ +#ifndef RBUS_MOCK_H +#define RBUS_MOCK_H + +#include "../rdkv_cdl_log_wrapper.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define RBUS_ERROR_SUCCESS 0 +#define RBUS_ERROR_BUS_ERROR 1 + +#define RDKFWUPGRADER_RBUS_HANDLE_NAME "rdkfwRbus" +#define T2_UPLOAD "Device.X_RDKCENTRAL-COM_T2.UploadDCMReport" + +typedef int rbusError_t; + +struct _rbusHandle +{ +}; + +typedef struct _rbusHandle *rbusHandle_t; + +struct _rbusObject +{ +}; +typedef struct _rbusObject *rbusObject_t; + +struct _rbusValue +{ +}; +typedef struct _rbusValue *rbusValue_t; + +typedef void (*rbusMethodAsyncRespHandler_t)(void); + +//typedef void (*rbusMethodAsyncRespHandler_t)(rbusHandle_t handle, char const *methodName, rbusError_t error, rbusObject_t params); + +rbusError_t rbus_open(rbusHandle_t *handle, const char* componentName); +rbusError_t rbus_close(rbusHandle_t handle); +rbusError_t rbusMethod_InvokeAsync(rbusHandle_t handle, const char* method, rbusObject_t input, rbusMethodAsyncRespHandler_t handler, int timeout); +rbusValue_t rbusObject_GetValue(rbusObject_t obj, const char* name); +const char* rbusValue_GetString(rbusValue_t value, void* unused); + +#ifdef __cplusplus +} +#endif + +#endif // RBUS_MOCK_H From 07dfc9d79d6e0a30c7aee49ba0a23f163ad988ea Mon Sep 17 00:00:00 2001 From: madhubabutt <114217841+madhubabutt@users.noreply.github.com> Date: Thu, 7 Aug 2025 10:54:23 +0530 Subject: [PATCH 6/9] Update rbusInterface.c --- src/rbusInterface/rbusInterface.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/rbusInterface/rbusInterface.c b/src/rbusInterface/rbusInterface.c index 580e334b..ab0a4df8 100644 --- a/src/rbusInterface/rbusInterface.c +++ b/src/rbusInterface/rbusInterface.c @@ -70,9 +70,3 @@ rbusError_t invokeRbusDCMReport() return RBUS_ERROR_SUCCESS; } -#ifdef GTEST_ENABLE -void (*getT2EventHandler(void))(rbusHandle_t handle, const char* methodName, rbusError_t error, rbusObject_t param) -{ - return &t2EventHandler; -} -#endif From 4a1f8b29dff382c88c5c6d470630671cc50bab3c Mon Sep 17 00:00:00 2001 From: madhubabutt <114217841+madhubabutt@users.noreply.github.com> Date: Thu, 7 Aug 2025 10:54:54 +0530 Subject: [PATCH 7/9] Update fwdl_interface_gtest.cpp --- unittest/fwdl_interface_gtest.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/unittest/fwdl_interface_gtest.cpp b/unittest/fwdl_interface_gtest.cpp index 174a7466..a1dfc047 100644 --- a/unittest/fwdl_interface_gtest.cpp +++ b/unittest/fwdl_interface_gtest.cpp @@ -271,17 +271,6 @@ TEST_F(InterfaceTestFixture, TestName_invokeRbusDCMReport) rbusError_t status = invokeRbusDCMReport(); EXPECT_EQ(status, RBUS_ERROR_SUCCESS); } -TEST_F(InterfaceTestFixture, TestName_t2EventHandler) -{ - auto handler = getT2EventHandler(); - EXPECT_NE(handler, nullptr); - - rbusHandle_t testHandle = nullptr; - const char* testName = "TestMethod"; - rbusObject_t testParam = (rbusObject_t)0x123; - handler(testHandle, testName, RBUS_ERROR_SUCCESS, testParam); - EXPECT_EQ(0, 0); -} GTEST_API_ int main(int argc, char *argv[]){ char testresults_fullfilepath[GTEST_REPORT_FILEPATH_SIZE]; From 66db7ca0a765b96ade28353d1c3bd712af07eaa1 Mon Sep 17 00:00:00 2001 From: madhubabutt <114217841+madhubabutt@users.noreply.github.com> Date: Thu, 7 Aug 2025 10:55:20 +0530 Subject: [PATCH 8/9] Update rbus_mock.h --- unittest/mocks/rbus_mock.h | 1 - 1 file changed, 1 deletion(-) diff --git a/unittest/mocks/rbus_mock.h b/unittest/mocks/rbus_mock.h index 2fd2a051..fb22c32b 100644 --- a/unittest/mocks/rbus_mock.h +++ b/unittest/mocks/rbus_mock.h @@ -56,7 +56,6 @@ rbusError_t rbusMethod_InvokeAsync(rbusHandle_t handle, const char* method, rbus rbusValue_t rbusObject_GetValue(rbusObject_t obj, const char* name); const char* rbusValue_GetString(rbusValue_t value, void* unused); rbusError_t invokeRbusDCMReport(); -void (*getT2EventHandler(void))(rbusHandle_t, const char*, rbusError_t, rbusObject_t); #ifdef __cplusplus } #endif From e956cf8abd7d14c031114eb1222146bf32ea6788 Mon Sep 17 00:00:00 2001 From: madhubabutt <114217841+madhubabutt@users.noreply.github.com> Date: Wed, 13 Aug 2025 14:28:01 +0530 Subject: [PATCH 9/9] Update flash.c --- src/flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flash.c b/src/flash.c index 50de4793..85cacdb3 100644 --- a/src/flash.c +++ b/src/flash.c @@ -375,7 +375,8 @@ int postFlash(const char *maint, const char *upgrade_file, int upgrade_type, con } #ifndef GTEST_ENABLE else { - // Call rbus method - Device.X_RDKCENTRAL-COM_T2.UploadDCMReport + t2CountNotify("SYS_INFO_CANARY_Update", 1); + // Call rbus method - Device.X_RDKCENTRAL-COM_T2.UploadDCMReport if( RBUS_ERROR_SUCCESS != invokeRbusDCMReport()) { SWLOG_ERROR("Error in uploading telemetry report\n"); if( DwnLoc.pvOut != NULL ) { @@ -391,7 +392,6 @@ int postFlash(const char *maint, const char *upgrade_file, int upgrade_type, con } if (0 == (strncmp(reboot_flag, "true", 4))) { SWLOG_INFO("Rebooting from RDK for Canary Firmware Upgrade\n"); - t2CountNotify("SYS_INFO_CANARY_Update", 1); v_secure_system("sh /rebootNow.sh -s '%s' -o '%s'","CANARY_Update", "Rebooting the box from RDK for Pending Canary Firmware Upgrade..."); } }