From 3aea1e1efabaef3b822eac846428b7f660a0983b Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Sat, 16 May 2026 00:21:37 +0530 Subject: [PATCH 1/3] RDKEMW-18510: [develop]Log upload success logs not observed after scheduled reboot (#127) * Update strategies.c * Update strategies.c * Update strategies.c * Update uploadstblogs.c * Update uploadstblogs.c * Update strategies.c * Update strategies.c * Update strategies.c * Update strategies.c * Update strategies.c * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- uploadstblogs/src/strategies.c | 18 ++++++------------ uploadstblogs/src/uploadstblogs.c | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/uploadstblogs/src/strategies.c b/uploadstblogs/src/strategies.c index ce880373a..18cce20f0 100644 --- a/uploadstblogs/src/strategies.c +++ b/uploadstblogs/src/strategies.c @@ -850,13 +850,7 @@ static int reboot_upload(RuntimeContext* ctx, SessionState* session) "[%s:%d] Non-DCM mode (dcm_flag=0), will always upload logs\n", __FUNCTION__, __LINE__); } - // DCM mode (DCM_FLAG=1): Check upload_on_reboot flag - else if (ctx->upload_on_reboot) { - should_upload = true; - RDK_LOG(RDK_LOG_INFO, LOG_UPLOADSTB, - "[%s:%d] DCM mode: Upload enabled from settings (upload_on_reboot=true)\n", - __FUNCTION__, __LINE__); - } else { + else { // Check reboot reason file for scheduled reboot (grep -i "Scheduled Reboot\|MAINTENANCE_REBOOT") bool is_scheduled_reboot = false; FILE* reboot_file = fopen(reboot_info_path, "r"); @@ -887,12 +881,12 @@ static int reboot_upload(RuntimeContext* ctx, SessionState* session) RDK_LOG(RDK_LOG_INFO, LOG_UPLOADSTB, "[%s:%d] uploadLog:%s and UploadLogsOnUnscheduledReboot.Disable RFC: %s\n", __FUNCTION__, __LINE__, ctx->upload_on_reboot ? "true" : "false", disable_unscheduled_upload ? "true" : "false"); - // Upload if: reboot reason is empty (unscheduled) AND RFC doesn't disable it - // Script logic: [ -z "$reboot_reason" -a "$DISABLE_UPLOAD_LOGS_UNSHEDULED_REBOOT" == "false" ] - if (!is_scheduled_reboot && !disable_unscheduled_upload) { + // Upload if upload_on_reboot is enabled, OR if the reboot is unscheduled + // and the UploadLogsOnUnscheduledReboot.Disable RFC does not disable it. + // Script logic for the unscheduled reboot path: + // [ -z "$reboot_reason" -a "$DISABLE_UPLOAD_LOGS_UNSHEDULED_REBOOT" == "false" ] + if ( ctx->upload_on_reboot==1 || (!is_scheduled_reboot && !disable_unscheduled_upload)) { should_upload = true; - RDK_LOG(RDK_LOG_INFO, LOG_UPLOADSTB, - "[%s:%d] Unscheduled reboot and RFC allows upload\n", __FUNCTION__, __LINE__); } } diff --git a/uploadstblogs/src/uploadstblogs.c b/uploadstblogs/src/uploadstblogs.c index 411db6315..7f29b2eb5 100755 --- a/uploadstblogs/src/uploadstblogs.c +++ b/uploadstblogs/src/uploadstblogs.c @@ -127,7 +127,7 @@ bool parse_args(int argc, char** argv, RuntimeContext* ctx) if (argc >= 5 && argv[4]) { // Parse UploadOnReboot - ctx->upload_on_reboot = (strcmp(argv[4], "true") == 0) ? 1 : 0; + ctx->upload_on_reboot = (strcmp(argv[4], "true") == 0 || strcmp(argv[4], "1") == 0) ? 1 : 0; fprintf(stderr, "DEBUG: UploadOnReboot (argv[4]) = '%s' -> %d\n", argv[4], ctx->upload_on_reboot); } From fe804982965fb1db55917fb9d1f91573b65e6e0c Mon Sep 17 00:00:00 2001 From: nhanas001c Date: Mon, 18 May 2026 14:38:12 +0000 Subject: [PATCH 2/3] DCM Agent 2.1.3 release changelog updates --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d894dfd14..9bd28e1df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,22 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [2.1.3](https://github.com/rdkcentral/dcm-agent/compare/2.1.2...2.1.3) + +- RDKEMW-18510: [develop]Log upload success logs not observed after scheduled reboot [`#127`](https://github.com/rdkcentral/dcm-agent/pull/127) +- Merge tag '2.1.2' into develop [`7461693`](https://github.com/rdkcentral/dcm-agent/commit/7461693af0d9c1c8fbd3fb4fd374ef8858041608) + #### [2.1.2](https://github.com/rdkcentral/dcm-agent/compare/2.1.1...2.1.2) +> 29 April 2026 + - RDKEMW-17638 : [RDKEMW][ALPACA IT] Device not Going to Deepsleep. [`#122`](https://github.com/rdkcentral/dcm-agent/pull/122) - RDKEMW-17582: [develop]UploadLogsOnUnscheduledReboot.Disable RFC state not logged / not honored in 8.5 builds after Scheduled Reboot [`#119`](https://github.com/rdkcentral/dcm-agent/pull/119) - [RDKEMW-17616] Log-backup generated is named with local timestamp instead of UTC timestamp [`#114`](https://github.com/rdkcentral/dcm-agent/pull/114) - RDKEMW-14842 [Logupload] Sha value need to be print in dcmscript.log for all types of logupload [`#111`](https://github.com/rdkcentral/dcm-agent/pull/111) - DCM Agent Documentaion updated for the module [`#110`](https://github.com/rdkcentral/dcm-agent/pull/110) - RDKEMW-17026 : Remove OEM/SOC references from the module [`#113`](https://github.com/rdkcentral/dcm-agent/pull/113) +- DCM Agent 2.1.2 release changelog updates [`00ac749`](https://github.com/rdkcentral/dcm-agent/commit/00ac749be80b9d7cbfc47e60e0dcfc11005e9886) - Merge tag '2.1.1' into develop [`be1a984`](https://github.com/rdkcentral/dcm-agent/commit/be1a9843bd5631ee54d0c1d750e827b50e9ba848) #### [2.1.1](https://github.com/rdkcentral/dcm-agent/compare/2.1.0...2.1.1) From 5297f53231d345bff7544dd479bad35716ca1c8a Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Thu, 28 May 2026 18:51:26 +0530 Subject: [PATCH 3/3] RDKEMW-17622 : Analyze and Compare Log Upload Script and C module Logs (#131) * Update strategies.c * Update strategies.c * Update strategies.c * Update uploadstblogs.c * Update uploadstblogs.c * Update strategies.c * Update strategies.c * Update strategies.c * Update strategies.c * Update strategies.c * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Update event_manager.c * Update strategies.c * Update path_handler.c * Update path_handler.c * Update path_handler.c * Update event_manager.c * Update event_manager_gtest.cpp * Update event_manager_gtest.cpp * Update path_handler.c * Update path_handler.c * Update path_handler.c * Update strategies.c * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Update strategies.c --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- uploadstblogs/src/event_manager.c | 4 ++-- uploadstblogs/src/path_handler.c | 1 + uploadstblogs/src/strategies.c | 1 + uploadstblogs/unittest/event_manager_gtest.cpp | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/uploadstblogs/src/event_manager.c b/uploadstblogs/src/event_manager.c index b06c00dca..ff9c3cb94 100755 --- a/uploadstblogs/src/event_manager.c +++ b/uploadstblogs/src/event_manager.c @@ -431,7 +431,7 @@ void emit_folder_missing_error(void) RDK_LOG(RDK_LOG_ERROR, LOG_UPLOADSTB, "[%s:%d] Required folder missing for log upload\n", __FUNCTION__, __LINE__); - // Send maintenance error event (matches script behavior) - send_iarm_event_maintenance(MAINT_LOGUPLOAD_ERROR); + // Send maintenance complete event (matches script behavior) + send_iarm_event_maintenance(MAINT_LOGUPLOAD_COMPLETE); } diff --git a/uploadstblogs/src/path_handler.c b/uploadstblogs/src/path_handler.c index 8f61c7acd..162b97a21 100755 --- a/uploadstblogs/src/path_handler.c +++ b/uploadstblogs/src/path_handler.c @@ -563,6 +563,7 @@ static UploadResult perform_s3_put_with_fallback(RuntimeContext* ctx, SessionSta if (s3_verified == UPLOADSTB_SUCCESS) { t2_count_notify("TEST_lu_success"); // Script line 616 session->success = true; + RDK_LOG(RDK_LOG_INFO, LOG_UPLOADSTB, "[%s:%d] Direct log upload Success: httpcode= %d\n", __FUNCTION__, __LINE__, session->http_code); return UPLOADSTB_SUCCESS; } diff --git a/uploadstblogs/src/strategies.c b/uploadstblogs/src/strategies.c index 18cce20f0..2ea48736a 100644 --- a/uploadstblogs/src/strategies.c +++ b/uploadstblogs/src/strategies.c @@ -835,6 +835,7 @@ static int reboot_upload(RuntimeContext* ctx, SessionState* session) { RDK_LOG(RDK_LOG_INFO, LOG_UPLOADSTB, "[%s:%d] REBOOT/NON_DCM: Starting upload phase\n", __FUNCTION__, __LINE__); + RDK_LOG(RDK_LOG_INFO, LOG_UPLOADSTB, "[%s:%d] UploadOnReboot set to %s\n", __FUNCTION__, __LINE__, ctx->upload_on_reboot ? "true" : "false"); // Check reboot reason and RFC settings (matches script logic) // Script: if [ "$uploadLog" == "true" ] || [ -z "$reboot_reason" -a "$DISABLE_UPLOAD_LOGS_UNSHEDULED_REBOOT" == "false" ] diff --git a/uploadstblogs/unittest/event_manager_gtest.cpp b/uploadstblogs/unittest/event_manager_gtest.cpp index d790f5588..9ccb86dbd 100755 --- a/uploadstblogs/unittest/event_manager_gtest.cpp +++ b/uploadstblogs/unittest/event_manager_gtest.cpp @@ -448,10 +448,10 @@ TEST_F(EventManagerTest, SendIarmEventMaintenance_Success) { TEST_F(EventManagerTest, EmitFolderMissingError_Success) { emit_folder_missing_error(); - // Should send MaintenanceMGR error event + // Should send MaintenanceMGR Complete event EXPECT_EQ(mock_iarm_event_calls, 1); EXPECT_STREQ(mock_last_event_name, "MaintenanceMGR"); - EXPECT_EQ(mock_last_event_code, 5); // MAINT_LOGUPLOAD_ERROR + EXPECT_EQ(mock_last_event_code, 4); // MAINT_LOGUPLOAD_COMPLETE } // Integration tests