Skip to content

Restart gNMI after updating test authentication - #28016

Open
ashutosh-agrawal wants to merge 2 commits into
sonic-net:masterfrom
ashutosh-agrawal:fix/ipv6-telemetry-auth-restart
Open

ashutosh-agrawal wants to merge 2 commits into
sonic-net:masterfrom
ashutosh-agrawal:fix/ipv6-telemetry-auth-restart

Conversation

@ashutosh-agrawal

@ashutosh-agrawal ashutosh-agrawal commented Sep 18, 2026

Copy link
Copy Markdown
Member

Description of PR

Summary:

Update the IPv6 management telemetry test to restart the gNMI service after
changing its temporary authentication configuration. The gNMI launch arguments
are generated when the service starts, so reloading supervisord does not
reliably apply a changed user_auth value.

The test now preserves and restores the original user_auth configuration and
waits for both the service and its TCP listener before sending the request. The
shared streaming telemetry context also restores client_auth when a test
raises an exception.

Fixes #28017

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): #28017
Failure type: regression

Tested branch

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

Test result

  • master: python3 -m py_compile tests/common/helpers/telemetry_helper.py tests/ip/test_mgmt_ipv6_only.py (passed)

Approach

What is the motivation for this PR?

test_telemetry_output_ipv6_only temporarily disables gNMI user
authentication before invoking a client without credentials. The previous
supervisor reload could leave the running gNMI process using its earlier
authentication mode, causing the request to be rejected as unauthenticated.

How did you do it?

  • Preserve the existing user_auth value, including an absent field.
  • Restart the gNMI service after setting user_auth=none and wait for the TCP
    listener before querying it.
  • Restore the original authentication configuration and restart the service in
    a finally block.
  • Make the shared streaming telemetry context restore client_auth when the
    test body fails.

How did you verify/test it?

python3 -m py_compile tests/common/helpers/telemetry_helper.py tests/ip/test_mgmt_ipv6_only.py

Any platform specific information?

No.

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

N/A. This updates an existing IPv6 management test.

Documentation

N/A.

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
@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

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@ashutosh-agrawal ashutosh-agrawal changed the title [ip] Restart gNMI after updating test authentication Restart gNMI after updating test authentication Sep 18, 2026
Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ip] test_telemetry_output_ipv6_only does not apply updated gNMI authentication

2 participants