[action] [PR:26388] Fixed the test_bmcctld_power_on_delay#1323
Merged
Conversation
### Description of PR
Fixes `test_bmcctld_power_on_delay` and BMC Log analyzer infrastructure
Summary:
- Supports PDU lookup for a Switch-Host not listed in `duthosts`.
- Passes complete outlet objects to `PduManager`.
- Uses `sed` instead of `awk` for marker-bounded `event.log` extraction.
- Synchronizes `event.log` around marker writes and log analysis.
Fixes: N/A
### Type of change
- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
- [ ] Skipped for non-supported platforms
- [x] Test case improvement
### Back port request
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511
- [ ] 202512
- [ ] 202605
Tracking issue/work item for backport/cherry-pick request: N/A
Failure type: Other
### Tested branch
- [ ] master
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511
- [ ] 202512
- [ ] 202605
### Test result
Test passed
### Approach
#### What is the motivation for this PR?
`test_bmcctld_power_on_delay` could not reliably power-cycle the Switch-Host or extract marker-bounded entries from `/host/bmc/event.log`.
The BMC testbed lists the BMC as the DUT, while the PDU connection belongs to its paired Switch-Host. Additionally, the test passed bare outlet IDs to `PduManager`, which expects complete outlet objects.
The existing `awk` command used to extract logs after a marker was also sensitive to marker formatting and shell quoting.
#### How did you do it?
- Updated `get_pdu_controller` to load graph facts on demand for a paired Switch-Host not present in the testbed DUT list.
- Updated the test to pass complete outlet dictionaries to `turn_off_outlet()` and `turn_on_outlet()`.
- Replaced the `awk` marker extraction with `sed`.
- Added `sync` calls around marker writes and before log analysis.
#### How did you verify/test it?
- Confirmed that the connection graph resolves the Switch-Host PDU.
- Confirmed that outlet status and power consumption are returned.
- Confirmed that the PDU power-cycle path reaches the BMC restart.
- Confirmed `/host/bmc/event.log` contains the expected marker and bmcctld startup messages.
- Test passed on the bmc-dual-mgmt testbed
#### Any platform specific information?
#### Supported testbed topology if it's a new test case?
Not a new test case. The updated test uses the `bmc-dual-mgmt` topology.
### Documentation
No documentation changes are required.
Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
Collaborator
Author
|
Original PR: sonic-net/sonic-mgmt#26388 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
20 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Fixes
test_bmcctld_power_on_delayand BMC Log analyzer infrastructureSummary:
duthosts.PduManager.sedinstead ofawkfor marker-boundedevent.logextraction.event.logaround marker writes and log analysis.Fixes: N/A
Type of change
Back port request
Tracking issue/work item for backport/cherry-pick request: N/A
Failure type: Other
Tested branch
Test result
Test passed
Approach
What is the motivation for this PR?
test_bmcctld_power_on_delaycould not reliably power-cycle the Switch-Host or extract marker-bounded entries from/host/bmc/event.log.The BMC testbed lists the BMC as the DUT, while the PDU connection belongs to its paired Switch-Host. Additionally, the test passed bare outlet IDs to
PduManager, which expects complete outlet objects.The existing
awkcommand used to extract logs after a marker was also sensitive to marker formatting and shell quoting.How did you do it?
get_pdu_controllerto load graph facts on demand for a paired Switch-Host not present in the testbed DUT list.turn_off_outlet()andturn_on_outlet().awkmarker extraction withsed.synccalls around marker writes and before log analysis.How did you verify/test it?
/host/bmc/event.logcontains the expected marker and bmcctld startup messages.Any platform specific information?
Supported testbed topology if it's a new test case?
Not a new test case. The updated test uses the
bmc-dual-mgmttopology.Documentation
No documentation changes are required.
Signed-off-by: Sonic Build Admin sonicbld@microsoft.com