Check gnxi path and get correct path value before test#5634
Check gnxi path and get correct path value before test#5634wangxin merged 2 commits intosonic-net:masterfrom
Conversation
Signed-off-by: Zhaohui Sun <[email protected]>
tests/telemetry/test_telemetry.py
Outdated
| def verify_telemetry_dockerimage(duthosts, rand_one_dut_hostname, ptfhost): | ||
| """If telemetry docker is available in image then return true | ||
| """ | ||
| global GNXI_PATH |
There was a problem hiding this comment.
Can you make it a fixture instead of global variable?
Signed-off-by: Zhaohui Sun <[email protected]>
What is the motivation for this PR? gnxi's location is updated from /gnxi to /root/gnxi in RP sonic-net/sonic-buildimage#10599. But if test case run on old docker-ptf image which doesn't have this update, it will fail. Because it should still call /gnxi files. How did you do it? For avoiding this conflict, check gnxi path before test and set GNXI_PATH to correct value. Add it in verify_telemetry_dockerimage autouse module fixture to make sure to set GNXI_PATH before test. How did you verify/test it? run telemetry/test_telemetry.py Signed-off-by: Zhaohui Sun <[email protected]>
|
Hi @wangxin @ZhaohuiS 2022-09-17T07:17:09.6730990Z "cmd": "python /gnxi/gnmi_cli_py/py_gnmicli.py -g -t 10.3.147.150 -p 50051 -m get -x COUNTERS/Ethernet0 -xt COUNTERS_DB -o "ndastreamingservertest"", 2022-09-17T07:17:09.6787480Z "stderr": "Traceback (most recent call last):\n File "/gnxi/gnmi_cli_py/py_gnmicli.py", line 510, in \n main()\n File "/gnxi/gnmi_cli_py/py_gnmicli.py", line 477, in main\n response = _get(stub, paths, user, password, prefix)\n File "/gnxi/gnmi_cli_py/py_gnmicli.py", line 297, in _get\n **kwargs)\n File "/usr/local/lib/python2.7/dist-packages/grpc/_channel.py", line 550, in call\n return _end_unary_response_blocking(state, call, False, None)\n File "/usr/local/lib/python2.7/dist-packages/grpc/_channel.py", line 467, in _end_unary_response_blocking\n raise _Rendezvous(state, None, None, deadline)\ngrpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:\n\tstatus = StatusCode.NOT_FOUND\n\tdetails = "redis: nil"\n\tdebug_error_string = "{"created":"@1663399029.573632194","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1036,"grpc_message":"redis: nil","grpc_status":5}"\n>", any idea why it failed? thanks |
@wenyiz2021 It's better to check os version instead of kernel version and move it to tests_mark_conditions.yml. |
thanks @ZhaohuiS I'll raise a PR to skip test_telemetry_output in test_conditional_mark.yml |
Description of PR
Summary:
Fixes # (issue)
Signed-off-by: Zhaohui Sun [email protected]
Type of change
Back port request
Approach
What is the motivation for this PR?
gnxi's location is updated from /gnxi to /root/gnxi in RP sonic-net/sonic-buildimage#10599.
But if test case run on old docker-ptf image which doesn't have this update, it will fail. Because it should still call /gnxi files.
How did you do it?
For avoiding this conflict, check gnxi path before test and set GNXI_PATH to correct value.
Add it in verify_telemetry_dockerimage autouse module fixture to make sure to set GNXI_PATH before test.
How did you verify/test it?
run
telemetry/test_telemetry.pyAny platform specific information?
Supported testbed topology if it's a new test case?
Documentation