RDK-61009 : [RDKE] Port Log Backup Scripts to Source code - #100
Conversation
|
b'## Copyright scan failure |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new backup_logs/ component (C code + autotools integration) to perform log backup/rotation, copy/move “special files” based on a config file, and send a systemd notification upon completion. It also adds a GoogleTest-based unit test suite for the new module.
Changes:
- Added the
backup_logsprogram implementation (config loading, backup engine logic, special file handling, and systemd notification). - Integrated
backup_logsinto the top-level autotools build (configure.ac,Makefile.am), including a newbackup_logs/Makefile.am. - Added a
backup_logs/unittesttest harness (gtest binaries, mocks, and autotools files) and aspecial_files.confconfig file.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 21 comments.
Show a summary per file
| File | Description |
|---|---|
| special_files.conf | Adds the list of “special files” intended for backup/copy/move. |
| configure.ac | Generates build files for the new backup_logs subdir. |
| Makefile.am | Adds backup_logs to top-level SUBDIRS. |
| backup_logs/Makefile.am | Defines how to build/link the new backup_logs binary. |
| backup_logs/include/backup_types.h | Introduces shared types/constants for the new module. |
| backup_logs/include/backup_logs.h | Declares the main backup_logs entrypoints. |
| backup_logs/include/backup_engine.h | Declares backup engine APIs for log rotation/backup. |
| backup_logs/include/config_manager.h | Declares configuration loading APIs. |
| backup_logs/include/special_files.h | Declares special-file config + execution APIs. |
| backup_logs/include/sys_integration.h | Declares system integration APIs (systemd notify, etc.). |
| backup_logs/src/backup_logs.c | Implements init/execute/cleanup/main for the backup program. |
| backup_logs/src/backup_engine.c | Implements the core log-moving/rotation and common operations. |
| backup_logs/src/config_manager.c | Implements config loading from RDK property APIs with defaults. |
| backup_logs/src/special_files.c | Implements parsing and executing the special-files list. |
| backup_logs/src/sys_integration.c | Implements sd_notify()-based systemd notification. |
| backup_logs/unittest/Makefile.am | Defines how gtest binaries are built and wrapped. |
| backup_logs/unittest/configure.ac | Autoconf setup intended for the unit test build. |
| backup_logs/unittest/mocks/config_manager_mocks.h | Adds mock declarations for config_manager tests. |
| backup_logs/unittest/config_manager_gtest.cpp | Adds config_manager unit tests with property mocks. |
| backup_logs/unittest/sys_integration_gtest.cpp | Adds unit tests for systemd notification formatting/error paths. |
| backup_logs/unittest/special_files_gtest.cpp | Adds unit tests for special-files parsing/execution logic. |
| backup_logs/unittest/backup_logs_gtest.cpp | Adds unit tests for backup_logs init/execute/cleanup/main. |
| backup_logs/unittest/backup_engine_gtest.cpp | Adds unit tests for backup engine behaviors and edge cases. |
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
Update configure.ac Create backup_engine.c Create backup_engine.h Create backup_logs.c Add config_load function for backup configuration Implement configuration loading for backup logs. Create special_files.c Add sys_integration.c for systemd notifications Create backup_logs.h Create backup_types.h Create config_manager.h Create special_files.h Add sys_integration.h header file with system functions Add Makefile.am for backup_logs project Create backup_utils.h Create backup_utils.c Update backup_logs.c Update backup_logs.c Update backup_logs.c Update backup_engine.c Delete backup_logs/src/backup_utils.c Delete backup_logs/include/backup_utils.h Update Makefile.am Remove unused backup_utils.h include Update config_manager.c Update config_manager.c Update config_manager.c Update special_files.c Update config_manager.c Update backup_engine.c Create special_files.conf Update backup_logs.c Update backup_logs.c Update sys_integration.c Update backup_logs.c Update special_files.c Update backup_logs.h Update backup_logs.c Update Makefile.am Update backup_logs.c Create configure.ac Add Makefile.am for unit testing setup Create special_files_gtest.cpp Create config_manager_gtest.cpp Update Makefile.am Create config_manager_mocks.h Create backup_logs_gtest.cpp Create sys_integration_gtest.cpp Update Makefile.am Define CPPFLAGS for config_manager_gtest Added CPPFLAGS for config manager tests with logging levels. Update Makefile.am Update backup_logs.c Update backup_engine.h Create backup_engine_gtest.cpp Add backup_engine_gtest to Makefile.am Update backup_engine.c Update backup_engine.c Update log file location to '/tmp/' Change log file location from '/opt/logs/' to '/tmp/'. Update config_manager.c Update backup_engine.c Check log_path length before building destination path Update backup_logs.c Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update backup_engine.c Update backup_engine.c Update backup_logs/include/sys_integration.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update backup_logs/include/config_manager.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update backup_engine.c Update copyright year to 2026 Update backup_logs.c Update config_manager.c Update copyright information in special_files.c Update sys_integration.c Update backup_engine.h Update backup_logs.h Update backup_types.h Update config_manager.h Update backup_logs.h Update backup_types.h Update special_files.h Update sys_integration.h Update backup_engine_gtest.cpp Revise copyright and license in backup_logs_gtest.cpp Updated copyright information and license details. Update config_manager_gtest.cpp Update special_files_gtest.cpp Update sys_integration_gtest.cpp Update copyright year and holder in Makefile.am Revise copyright and license in Makefile.am Updated copyright information and license details. Update configure.ac Revise copyright and licensing information Updated copyright information and license details in config_manager_mocks.h. RDK-61009 : [RDKE] Port Log Backup Scripts to Source code (#95) * Create backup_logs_requirements.md * Create backup_logs_migration_HLD.md * Create backup_logs_LLD.md * Create backup_logs_flowcharts.md --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> RDK-60634 [dcm-agent] RDK Coverity Defect Resolution for Device Management (#81) Co-authored-by: mtirum011 <madhubabu_tirumala@comcast.com> tr69hostif 2.0.4 release changelog updates Delete backup_logs/unittest/backup_engine_gtest.cpp Create backup_engine_gtest.cpp Update Makefile.am Update Makefile.am Clean up EXTRA_DIST in Makefile.am Removed extra files from distribution in Makefile.am. Update config_manager_gtest.cpp Update backup_logs/include/sys_integration.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update sys_integration.h Create test_backuplog_config_manager.py Create test_backup_engine.py Create test_backuplogs_system_integration.py Create test_backuplogs_special_files.py Create backup_logs_helper.py Update backup_logs_helper.py Update copyright year to 2026 in test_backup_engine.py Update copyright year in test_backuplogs_special_files.py Update copyright year in test_backuplog_config_manager.py Update test_backuplogs_system_integration.py Create backup_logs_engine.feature Create backup_logs_config_manager.feature Create backup_logs_sys_integration.feature Create backup_logs_special_files.feature Add tools and skills for agentic development (#102) * Add tools and skills for agentic development * Update .github/skills/triage-logs/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/skills/quality-checker/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/skills/technical-documentation-writer/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/skills/platform-portability-checker/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/skills/technical-documentation-writer/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/skills/quality-checker/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update backup_logs.h Update backup_types.h Add tools and skills for agentic development (#102) * Add tools and skills for agentic development * Update .github/skills/triage-logs/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/skills/quality-checker/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/skills/technical-documentation-writer/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/skills/platform-portability-checker/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/skills/technical-documentation-writer/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/skills/quality-checker/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update backup_logs.c Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update backup_engine_gtest.cpp Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update backup_engine.c Update special_files.c Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update Makefile.am Update Makefile.am
345ba69 to
9b6eeb1
Compare
…t files Co-authored-by: shibu-kv <89052442+shibu-kv@users.noreply.github.com> Agent-Logs-Url: https://github.com/rdkcentral/dcm-agent/sessions/8cb71809-166b-4110-a6a5-3b119703dcf1
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.