Skip to content

Commit

Permalink
Improve gnmi setup (#7646)
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
If gnmi program is running, no need to restart.

How did you do it?
Check program status, return for running state.

How did you verify/test it?
Run GNMI end2end test
  • Loading branch information
ganglyu authored Mar 6, 2023
1 parent 78f3e52 commit 8c5821a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/gnmi/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def apply_cert_config(duthost):


def recover_cert_config(duthost):
dut_command = "docker exec %s supervisorctl status %s" % (GNMI_CONTAINER_NAME, GNMI_PROGRAM_NAME)
output = duthost.command(dut_command, module_ignore_errors=True)['stdout'].strip()
if 'RUNNING' in output:
return
dut_command = "docker exec %s pkill telemetry" % (GNMI_CONTAINER_NAME)
duthost.shell(dut_command, module_ignore_errors=True)
dut_command = "docker exec %s supervisorctl start %s" % (GNMI_CONTAINER_NAME, GNMI_PROGRAM_NAME)
Expand Down

0 comments on commit 8c5821a

Please sign in to comment.