Skip to content

Commit

Permalink
Update location of gnxi files due to docker-ptf modification (#5574)
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
PR sonic-net/sonic-buildimage#10599 move the work directory to /root.
So gnxi is moved to /root. test_telemetry failed because of wrong file location.

How did you do it?
Update /gnxi/... to /root/gnxi/...

How did you verify/test it?
run tests/telemetry/test_telemetry.py

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
  • Loading branch information
ZhaohuiS authored and wangxin committed May 11, 2022
1 parent ea0f0a1 commit 14246d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/telemetry/test_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def setup_telemetry_forpyclient(duthost):
def generate_client_cli(duthost, method=METHOD_GET, xpath="COUNTERS/Ethernet0", target="COUNTERS_DB", subscribe_mode=SUBSCRIBE_MODE_STREAM, submode=SUBMODE_SAMPLE, intervalms=0, update_count=3):
"""Generate the py_gnmicli command line based on the given params.
"""
cmdFormat = 'python /gnxi/gnmi_cli_py/py_gnmicli.py -g -t {0} -p {1} -m {2} -x {3} -xt {4} -o {5}'
cmdFormat = 'python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t {0} -p {1} -m {2} -x {3} -xt {4} -o {5}'
cmd = cmdFormat.format(duthost.mgmt_ip, TELEMETRY_PORT, method, xpath, target, "ndastreamingservertest")

if method == METHOD_SUBSCRIBE:
Expand Down Expand Up @@ -101,7 +101,7 @@ def setup_streaming_telemetry(duthosts, rand_one_dut_hostname, localhost, ptfho
wait_tcp_connection(localhost, dut_ip, TELEMETRY_PORT, timeout_s=60)

# pyclient should be available on ptfhost. If it was not available, then fail pytest.
file_exists = ptfhost.stat(path="/gnxi/gnmi_cli_py/py_gnmicli.py")
file_exists = ptfhost.stat(path="/root/gnxi/gnmi_cli_py/py_gnmicli.py")
pytest_assert(file_exists["stat"]["exists"] is True)

def skip_201911_and_older(duthost):
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_telemetry_ouput(duthosts, rand_one_dut_hostname, ptfhost, setup_streami

logger.info('start telemetry output testing')
dut_ip = duthost.mgmt_ip
cmd = 'python /gnxi/gnmi_cli_py/py_gnmicli.py -g -t {0} -p {1} -m get -x COUNTERS/Ethernet0 -xt COUNTERS_DB \
cmd = 'python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t {0} -p {1} -m get -x COUNTERS/Ethernet0 -xt COUNTERS_DB \
-o "ndastreamingservertest"'.format(dut_ip, TELEMETRY_PORT)
show_gnmi_out = ptfhost.shell(cmd)['stdout']
logger.info("GNMI Server output")
Expand Down Expand Up @@ -191,7 +191,7 @@ def test_sysuptime(duthosts, rand_one_dut_hostname, ptfhost, setup_streaming_tel
duthost = duthosts[rand_one_dut_hostname]
skip_201911_and_older(duthost)
dut_ip = duthost.mgmt_ip
cmd = 'python /gnxi/gnmi_cli_py/py_gnmicli.py -g -t {0} -p {1} -m get -x proc/uptime -xt OTHERS \
cmd = 'python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t {0} -p {1} -m get -x proc/uptime -xt OTHERS \
-o "ndastreamingservertest"'.format(dut_ip, TELEMETRY_PORT)
system_uptime_info = ptfhost.shell(cmd)["stdout_lines"]
system_uptime_1st = 0
Expand Down

0 comments on commit 14246d2

Please sign in to comment.