Files
update/patch-scripts
Eric MacDonald 956752aa1b Add Maintenance heartbeat period modify/apply upgrade/rollback script
This new script is implemented to handle the Maintenance Heartbeat
Period service parameter change for the:
 - 24.09 to 25.09 upgrade case
 - 25.09 to 24.09 rollback case

This script queries the current maintenance heartbeat_period
service parameter. In the upgrade case it ensures the value is
set to 1000 msecs. While in the rollback case it ensures the
value is 100.

Basic operations are
 - source openrc and platform.conf (if needed)
 - query heartbeat period service parameter
 - modify heartbeat service parameter, if needed
 - apply the service parameter change

Note: The apply operation, the last operation in the script, is
      launched as a background detached thread to save 10 seconds.

Test Plan:

PASS: Verify heartbeat_period service parameter
PASS: - is set to 1000 on 24.09 to 25.09 activate upgrade action
PASS: - is set to  100 on 25.09 to 24.09 activate-rollback action
PASS: - is unmodified with a no action log for all other cases
PASS: Verify script produces 'Start' and 'Completed' logs
PASS: Verify execution time is reported in the 'Completed' log
PASS: Verify heartbeat_period is not modified if already correct
PASS: Verify no action log when nodetype is not the active controller
PASS: Verify script is idempotent ; safely re-run without side effects

PASS: Verify 24.09 upgrade  to 25.09 (unit test of script)
PASS: Verify 25.09 rollback to 24.09 (unit test of script)

Performance:

PASS: Verify source of /etc/platform/platform.conf if needed
PASS: Verify source of openrc if needed ; saves 5 secs if not needed
PASS: Verify execution time improvement by launching the final service
      parameter apply operation in the background thereby not requiring
      the script to wait around for that to finish; saves 10 secs
PASS: Verify change execution time is typically 4-5 seconds ; from 20

Robustness:

PASS: Verify argument checking
PASS: Verify successful return code for all system commands
PASS: Verify logging for all success and failure paths
PASS: Verify heartbeat_period value must be a number between (100-1000)
PASS: Verify all variables use have ${var} syntax
PASS: Verify detection of uninitialized variables (FIT)
PASS: Verify against shellcheck

Partial-Fix: 2117252
Change-Id: I73405d97a6300e0788641d320c4f010996cb1b16
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
2025-08-01 10:51:31 -04:00
..