Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions uploadstblogs/src/event_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

1 change: 1 addition & 0 deletions uploadstblogs/src/path_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
19 changes: 7 additions & 12 deletions uploadstblogs/src/strategies.c
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand All @@ -850,13 +851,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");
Expand Down Expand Up @@ -887,12 +882,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__);
}
}

Expand Down
2 changes: 1 addition & 1 deletion uploadstblogs/src/uploadstblogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions uploadstblogs/unittest/event_manager_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading