Skip to content

[action] [PR:26388] Fixed the test_bmcctld_power_on_delay#1323

Merged
mssonicbld merged 1 commit into
Azure:202608from
mssonicbld:cherry/msft-202608/26388
Jul 21, 2026
Merged

[action] [PR:26388] Fixed the test_bmcctld_power_on_delay#1323
mssonicbld merged 1 commit into
Azure:202608from
mssonicbld:cherry/msft-202608/26388

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator

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

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • 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

### 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>
@mssonicbld

Copy link
Copy Markdown
Collaborator Author

Original PR: sonic-net/sonic-mgmt#26388

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

@mssonicbld
mssonicbld merged commit 5296f2f into Azure:202608 Jul 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant