Skip to content

[action] [PR:28036] Complete redfish test (event subscription,telmetry,alert, recovery, pom, concurrency, etc) - #1492

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

mssonicbld merged 1 commit into
Azure:202608from
mssonicbld:cherry/msft-202608/28036

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator

Note: all tests below pass on a BMC image built from sonic-net/sonic-redfish#37

[INFRA] 2026-10-06 14:04:18: run_all_tests():
TESTS RUN RESULTS:BEG
+------------------------------------------------------+--------------------------------------+--------+----------+-------+
| Test                                                 | Description                          | Result | Duration | Error |
+------------------------------------------------------+--------------------------------------+--------+----------+-------+
| tests/redfish/test_redfish_cert_auth.py              | skipped 0 errors 0 failed 0 total 5  | PASS   | 480.41   |       |
| tests/redfish/test_redfish_computer_reset.py         | skipped 0 errors 0 failed 0 total 5  | PASS   | 581.12   |       |
| tests/redfish/test_redfish_concurrency.py            | skipped 0 errors 0 failed 0 total 3  | PASS   | 419.96   |       |
| tests/redfish/test_redfish_event_subscription.py     | skipped 0 errors 0 failed 0 total 16 | PASS   | 1225.86  |       |
| tests/redfish/test_redfish_firmware_inventory.py     | skipped 0 errors 0 failed 0 total 4  | PASS   | 419.83   |       |
| tests/redfish/test_redfish_pmon_interaction.py       | skipped 0 errors 0 failed 0 total 4  | PASS   | 561.1    |       |
| tests/redfish/test_redfish_rack_manager_alert.py     | skipped 0 errors 0 failed 0 total 10 | PASS   | 945.99   |       |
| tests/redfish/test_redfish_rack_manager_telemetry.py | skipped 0 errors 0 failed 0 total 16 | PASS   | 1379.09  |       |
| tests/redfish/test_redfish_restart_recovery.py       | skipped 0 errors 0 failed 0 total 2  | PASS   | 399.86   |       |
| tests/redfish/test_redfish_service_root.py           | skipped 0 errors 0 failed 0 total 2  | PASS   | 319.06   |       |
+------------------------------------------------------+--------------------------------------+--------+----------+-------+
TESTS RUN RESULTS:END

2026-10-06 14:04:18,395 nhtest.libs.sonic_mgmt.container_docker [INFO] [MainThread] Restored original ansible config files
2026-10-06 14:04:19,062 nhtest.libs.sonic_mgmt.container_docker [INFO] [MainThread] Removed container: 743266f57fb275418861f84814c4ce150e0037e4625a63a5e6b4736bcd0be1ec

Event subscription (16)

  1. test_event_service_advertised: GET EventService shows ServiceEnabled, the Subscriptions link, and the Base and OpenBMC registry prefixes.
  2. test_subscription_lifecycle: POST creates a subscription with a Location, GET echoes Destination and Context with bmcweb's defaults, the collection lists it, DELETE removes it and a later GET is 404.
  3. test_subscription_rejects_bad_requests, 7 cases: a missing, malformed, or credential-bearing Destination, an unsupported Protocol, an unknown RegistryPrefix, MessageIds combined with prefixes, and an unknown retry policy are each refused with a Redfish error and no subscription.
  4. test_leak_event_delivered: a Critical leak written to STATE_DB arrives at the subscriber as LeakDetectedCritical with OriginOfCondition pointing at the detector under Chassis/chassis, and clearing it arrives as LeakDetectedNormal with a higher event Id.
  5. test_leak_warning_event_delivered: a MINOR leak arrives as LeakDetectedWarning with Severity Warning.
  6. test_resource_type_filter: an unfiltered subscriber and one filtered on ResourceTypes LeakDetector both receive the leak, while Task and Base filtered subscribers receive nothing.
  7. test_subscription_persists_across_bmcweb_restart: after a bmcweb restart the subscription is still listed with the same Destination and Context and still receives a leak event.
  8. test_leak_detector_resource_tracks_state: the detector is listed in the LeakDetectors collection under Chassis/chassis, and GET on it shows DetectorState and Health following OK, Critical, OK with the STATE_DB row.
  9. test_host_power_events_delivered: as HOST_STATE moves through POWERING_OFF, POWERED_OFF, POWERING_ON, POWERED_ON, a subscriber filtered on ResourceTypes ComputerSystem receives ResourcePoweringOff, ResourcePoweredOff, ResourcePoweringOn, and ResourcePoweredOn in order with increasing Ids, each with OriginOfCondition /redfish/v1/Systems/system, while a LeakDetector-only subscriber receives none.
  10. test_host_power_off_event_drives_power_on_request: HOST_STATE reports POWERED_OFF, the subscriber receives ResourcePoweredOff and answers with ComputerSystem.Reset ResetType On, which becomes one RACK_MANAGER_COMMAND row that bmcctld completes DONE with SUCCESS, and once HOST_STATE reads POWERED_ON again the subscriber receives ResourcePoweredOn.

Rack manager telemetry (16)

  1. test_manager_advertises_telemetry_action: Managers/bmc advertises the SONiC RackManager SubmitTelemetry action and its target.
  2. test_submit_telemetry_persists_to_state_db: a valid telemetry POST writes the RACK_MANAGER_DATA rows with value, unit, severity, and timestamp.
  3. test_submit_telemetry_updates_existing_record: a later sample overwrites the earlier row so a cleared alert becomes visible.
  4. test_submit_telemetry_payload_shapes, 7 cases: alternate envelope names, inherited wrapper severity, missing severity defaulting to Normal, mixed-case severity, unknown fields dropped, multiple envelopes merged, and unrecognised-only payloads persisting nothing.
  5. test_submit_telemetry_rejects_bad_requests, 5 cases: malformed JSON, a missing alarms envelope, an unknown manager id, an oversized body, and GET on the action are refused with the right error and write nothing.
  6. test_submit_telemetry_bridge_unavailable: with the bridge stopped a telemetry POST is refused rather than silently dropped, and service recovers once it is back.

Concurrency (3)

  1. test_reset_concurrent_with_inventory_poll: five ResetType On requests while four threads poll Chassis, Managers, and FirmwareInventory, every poll answered 200 with stable membership, one command row per reset, RequestedHostTransition set, HOST_STATE back to POWERED_ON, no process restarted.
  2. test_duplicate_subscription_create_and_delete: eight identical subscription POSTs at once each get 201 with a unique id, concurrent DELETEs all answer 2xx or 404, and the collection ends empty.
  3. test_interleaved_create_delete_churn: four workers each run five create, read, delete cycles with no lost or cross-deleted subscription.

Pmon interaction (4)

  1. test_reset_command_consumed_by_bmcctld: one Reset produces one RACK_MANAGER_COMMAND row that bmcctld drives to DONE with result SUCCESS, the row is retained, and HOST_STATE stays POWERED_ON.
  2. test_power_state_consistent_across_layers: HOST_STATE device_power_state and device_status agree with CHASSIS_MODULE_TABLE oper_status.
  3. test_critical_alert_blocks_power_on_command: after a Critical SubmitAlert the next POWER_ON fails with CRITICAL_LEAK_PRESENT, and after clearing it the next POWER_ON completes with SUCCESS.
  4. test_bmcctld_restart_resyncs_host_state: a bmcctld restart re-publishes HOST_STATE with a newer timestamp, creates no command rows, and a subsequent Reset is still consumed.

Rack manager alert (10)

  1. test_submit_alert_persists_to_state_db: a flat-form alert returns 204 and writes the RACK_MANAGER_ALERT rows with severity and timestamp.
  2. test_submit_alert_wrapped_form_inherits_severity: the ShutdownAlert wrapped form resolves to the same records, with sensors inheriting the wrapper severity.
  3. test_submit_alert_clear_overwrites_critical: a later Normal alert overwrites an earlier Critical in place.
  4. test_submit_alert_minor_only: a single Minor measurement alert writes only that sensor's record.
  5. test_submit_alert_rejects_bad_requests, 6 cases: malformed JSON, a missing or wrong-case envelope, an unknown manager id, an oversized body, and GET on the action are refused and write nothing.

Restart recovery (2)

  1. test_bridge_restart_rediscovered_by_running_bmcweb: restarting sonic-dbus-bridge under a running bmcweb restores the same ObjectMapper tree and Redfish inventory, including leak detectors, without bmcweb restarting.
  2. test_redfish_container_restart: restarting the redfish container keeps mTLS in force, restores the inventory, and preserves a subscription created before the restart.

How to verify?

sonic management test for resdifish with --topology bmc-shared-mgmt

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 (GitHub issue or Microsoft ADO):
Failure type:

Tested branch

  • master
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • N/A

Approach

What is the motivation for this PR?

How did you verify/test it?

Ran the module on a SONiC BMC DUT on master.

Any platform specific information?

Needs a SONiC BMC image with the redfish container (bmcweb).

Supported testbed topology if it's a new test case?

bmc

Documentation

N/A

Signed-off-by: Sonic Build Admin sonicbld@microsoft.com

…om, concurrency, etc)

Note: all tests below pass on a BMC image built from sonic-net/sonic-redfish#37

```
[INFRA] 2026-10-06 14:04:18: run_all_tests():
TESTS RUN RESULTS:BEG
+------------------------------------------------------+--------------------------------------+--------+----------+-------+
| Test                                                 | Description                          | Result | Duration | Error |
+------------------------------------------------------+--------------------------------------+--------+----------+-------+
| tests/redfish/test_redfish_cert_auth.py              | skipped 0 errors 0 failed 0 total 5  | PASS   | 480.41   |       |
| tests/redfish/test_redfish_computer_reset.py         | skipped 0 errors 0 failed 0 total 5  | PASS   | 581.12   |       |
| tests/redfish/test_redfish_concurrency.py            | skipped 0 errors 0 failed 0 total 3  | PASS   | 419.96   |       |
| tests/redfish/test_redfish_event_subscription.py     | skipped 0 errors 0 failed 0 total 16 | PASS   | 1225.86  |       |
| tests/redfish/test_redfish_firmware_inventory.py     | skipped 0 errors 0 failed 0 total 4  | PASS   | 419.83   |       |
| tests/redfish/test_redfish_pmon_interaction.py       | skipped 0 errors 0 failed 0 total 4  | PASS   | 561.1    |       |
| tests/redfish/test_redfish_rack_manager_alert.py     | skipped 0 errors 0 failed 0 total 10 | PASS   | 945.99   |       |
| tests/redfish/test_redfish_rack_manager_telemetry.py | skipped 0 errors 0 failed 0 total 16 | PASS   | 1379.09  |       |
| tests/redfish/test_redfish_restart_recovery.py       | skipped 0 errors 0 failed 0 total 2  | PASS   | 399.86   |       |
| tests/redfish/test_redfish_service_root.py           | skipped 0 errors 0 failed 0 total 2  | PASS   | 319.06   |       |
+------------------------------------------------------+--------------------------------------+--------+----------+-------+
TESTS RUN RESULTS:END

2026-10-06 14:04:18,395 nhtest.libs.sonic_mgmt.container_docker [INFO] [MainThread] Restored original ansible config files
2026-10-06 14:04:19,062 nhtest.libs.sonic_mgmt.container_docker [INFO] [MainThread] Removed container: 743266f57fb275418861f84814c4ce150e0037e4625a63a5e6b4736bcd0be1ec
```
> Event subscription (16)

1. test_event_service_advertised: GET EventService shows ServiceEnabled, the Subscriptions link, and the Base and OpenBMC registry prefixes.
2. test_subscription_lifecycle: POST creates a subscription with a Location, GET echoes Destination and Context with bmcweb's defaults, the collection lists it, DELETE removes it and a later GET is 404.
3. test_subscription_rejects_bad_requests, 7 cases: a missing, malformed, or credential-bearing Destination, an unsupported Protocol, an unknown RegistryPrefix, MessageIds combined with prefixes, and an unknown retry policy are each refused with a Redfish error and no subscription.
4. test_leak_event_delivered: a Critical leak written to STATE_DB arrives at the subscriber as LeakDetectedCritical with OriginOfCondition pointing at the detector under Chassis/chassis, and clearing it arrives as LeakDetectedNormal with a higher event Id.
5. test_leak_warning_event_delivered: a MINOR leak arrives as LeakDetectedWarning with Severity Warning.
6. test_resource_type_filter: an unfiltered subscriber and one filtered on ResourceTypes LeakDetector both receive the leak, while Task and Base filtered subscribers receive nothing.
7. test_subscription_persists_across_bmcweb_restart: after a bmcweb restart the subscription is still listed with the same Destination and Context and still receives a leak event.
8. test_leak_detector_resource_tracks_state: the detector is listed in the LeakDetectors collection under Chassis/chassis, and GET on it shows DetectorState and Health following OK, Critical, OK with the STATE_DB row.
9. test_host_power_events_delivered: as HOST_STATE moves through POWERING_OFF, POWERED_OFF, POWERING_ON, POWERED_ON, a subscriber filtered on ResourceTypes ComputerSystem receives ResourcePoweringOff, ResourcePoweredOff, ResourcePoweringOn, and ResourcePoweredOn in order with increasing Ids, each with OriginOfCondition /redfish/v1/Systems/system, while a LeakDetector-only subscriber receives none.
10. test_host_power_off_event_drives_power_on_request: HOST_STATE reports POWERED_OFF, the subscriber receives ResourcePoweredOff and answers with ComputerSystem.Reset ResetType On, which becomes one RACK_MANAGER_COMMAND row that bmcctld completes DONE with SUCCESS, and once HOST_STATE reads POWERED_ON again the subscriber receives ResourcePoweredOn.

> Rack manager telemetry (16)

1. test_manager_advertises_telemetry_action: Managers/bmc advertises the SONiC RackManager SubmitTelemetry action and its target.
2. test_submit_telemetry_persists_to_state_db: a valid telemetry POST writes the RACK_MANAGER_DATA rows with value, unit, severity, and timestamp.
3. test_submit_telemetry_updates_existing_record: a later sample overwrites the earlier row so a cleared alert becomes visible.
4. test_submit_telemetry_payload_shapes, 7 cases: alternate envelope names, inherited wrapper severity, missing severity defaulting to Normal, mixed-case severity, unknown fields dropped, multiple envelopes merged, and unrecognised-only payloads persisting nothing.
5. test_submit_telemetry_rejects_bad_requests, 5 cases: malformed JSON, a missing alarms envelope, an unknown manager id, an oversized body, and GET on the action are refused with the right error and write nothing.
6. test_submit_telemetry_bridge_unavailable: with the bridge stopped a telemetry POST is refused rather than silently dropped, and service recovers once it is back.

> Concurrency (3)

1. test_reset_concurrent_with_inventory_poll: five ResetType On requests while four threads poll Chassis, Managers, and FirmwareInventory, every poll answered 200 with stable membership, one command row per reset, RequestedHostTransition set, HOST_STATE back to POWERED_ON, no process restarted.
2. test_duplicate_subscription_create_and_delete: eight identical subscription POSTs at once each get 201 with a unique id, concurrent DELETEs all answer 2xx or 404, and the collection ends empty.
3. test_interleaved_create_delete_churn: four workers each run five create, read, delete cycles with no lost or cross-deleted subscription.

> Pmon interaction (4)

1. test_reset_command_consumed_by_bmcctld: one Reset produces one RACK_MANAGER_COMMAND row that bmcctld drives to DONE with result SUCCESS, the row is retained, and HOST_STATE stays POWERED_ON.
2. test_power_state_consistent_across_layers: HOST_STATE device_power_state and device_status agree with CHASSIS_MODULE_TABLE oper_status.
3. test_critical_alert_blocks_power_on_command: after a Critical SubmitAlert the next POWER_ON fails with CRITICAL_LEAK_PRESENT, and after clearing it the next POWER_ON completes with SUCCESS.
4. test_bmcctld_restart_resyncs_host_state: a bmcctld restart re-publishes HOST_STATE with a newer timestamp, creates no command rows, and a subsequent Reset is still consumed.

> Rack manager alert (10)

1. test_submit_alert_persists_to_state_db: a flat-form alert returns 204 and writes the RACK_MANAGER_ALERT rows with severity and timestamp.
2. test_submit_alert_wrapped_form_inherits_severity: the ShutdownAlert wrapped form resolves to the same records, with sensors inheriting the wrapper severity.
3. test_submit_alert_clear_overwrites_critical: a later Normal alert overwrites an earlier Critical in place.
4. test_submit_alert_minor_only: a single Minor measurement alert writes only that sensor's record.
5. test_submit_alert_rejects_bad_requests, 6 cases: malformed JSON, a missing or wrong-case envelope, an unknown manager id, an oversized body, and GET on the action are refused and write nothing.

> Restart recovery (2)

1. test_bridge_restart_rediscovered_by_running_bmcweb: restarting sonic-dbus-bridge under a running bmcweb restores the same ObjectMapper tree and Redfish inventory, including leak detectors, without bmcweb restarting.
2. test_redfish_container_restart: restarting the redfish container keeps mTLS in force, restores the inventory, and preserves a subscription created before the restart.

### How to verify?

> sonic management test  for resdifish with --topology **bmc-shared-mgmt**

### Type of change

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [x] New Test case
    - [x] 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 (GitHub issue or Microsoft ADO):
Failure type:

### Tested branch
- [x] master
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511
- [ ] 202512
- [ ] 202605
- [ ] N/A

### Approach
#### What is the motivation for this PR?

#### How did you verify/test it?

Ran the module on a SONiC BMC DUT on master.

#### Any platform specific information?

Needs a SONiC BMC image with the redfish container (bmcweb).

#### Supported testbed topology if it's a new test case?

bmc

### Documentation

N/A

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator Author

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

@azure-pipelines

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

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

1 similar comment
@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

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

@azure-pipelines

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

@mssonicbld
mssonicbld merged commit c2ec4f2 into Azure:202608 Oct 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