reboot: use TLS for DPU gNOI calls - #4761
Conversation
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR updates the SmartSwitch reboot helper to use TLS (with insecure certificate verification) for direct DPU gNOI calls, aligning reboot handling with DPU telemetry servers that only expose ephemeral self-signed TLS.
Changes:
- Switch DPU gNOI
RebootStatusandRebootinvocations fromgnoi_client -notlstognoi_client -insecure. - Add pytest coverage that dynamically sources
scripts/reboot_smartswitch_helperand asserts TLS flags are used for both command paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/reboot_smartswitch_helper | Updates gNOI client invocations to use -insecure (TLS). |
| tests/reboot_smartswitch_helper_test.py | Adds tests that validate the helper issues gNOI commands with TLS enabled. |
Suppressed comments (1)
scripts/reboot_smartswitch_helper:192
- This line uses
$()(command substitution), so$?on the following line won’t reliably indicate whetherdocker exec gnoi_clientsucceeded; it can also lead to always taking the success path. Run the command directly (no substitution) and quote the-targetargument to avoid word-splitting issues.
$(docker exec gnmi gnoi_client -target ${dpu_ip}:${port} -logtostderr -insecure -module System -rpc Reboot -jsonin '{"method":3, "message":"User initiated reboot"}' &>/dev/null)
if [ $? -ne 0 ]; then
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Physical SmartSwitch validation passed on DPU0 using integrated image
Scope boundary: DPU0 ran the RPC acceptance sequence; DPU1-DPU3 were health-checked Online. Host Services was not exercised by this utility validation. |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Why
DPU gNOI servers without provisioned TLS certificates use ephemeral self-signed certificates. SmartSwitch reboot handling must use TLS rather than plaintext and remain robust when the configured legacy port is unavailable.
Tracks sonic-net/sonic-buildimage#28540.
Microsoft ADO (number only): 39179387
What
-notlsto-insecure.8080, and native port50052with bounded, side-effect-freeSystem.Timecalls; send one boundedRebootcall to the selected port and validateRebootStatuswith a bounded call.is_repeated) and older descriptor APIs in DASH dump decoding.pfcstattests explicitly request all ports when validating frontend and backend output.Validation
pytest -q --noconftest -o addopts='' tests/reboot_smartswitch_helper_test.py- 16 passeddump/dash_util.pyprotobuf-traversal check passed under protobuf 3.20.3, 4.21.12, and 7.35.1python3 -m py_compile dump/dash_util.py tests/pfcstat_test.py- passedbash -n scripts/reboot_smartswitch_helper- passed1188156passed Static Analysis, Python3, BuildData, and diff coverageSONiC.master-28915.1187671-f1a440da3observed the connection to port8080fail, selected port50052, and completed the exercised gNOI halt/reset workflow