Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding test case to test telemetry service "osversion/build" query. #2578

Merged
merged 4 commits into from
Dec 15, 2020

Conversation

macikgozwa
Copy link
Contributor

Description of PR

Summary:
Adding a new test case to validate the osversion/build telemetry query. This is a new query to get the Sonic build version from the telemetry service. Details of the changes on telemetry service can be found in this PR: sonic-net/sonic-telemetry#50

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

A test case needed to cover a recently added telemetry service feature.

How did you do it?

The test case runs the mentioned query and checks the existence of expected keywords in the response.

How did you verify/test it?

Using Sonic KVM testbed.

Any platform specific information?

NA

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

NA

Documentation

tests/telemetry/test_telemetry.py Outdated Show resolved Hide resolved
tests/telemetry/test_telemetry.py Outdated Show resolved Hide resolved
@wangxin
Copy link
Collaborator

wangxin commented Nov 25, 2020

This test failed on vsimage, can you look into it? @macikgozwa

E           RunAnsibleModuleFail: run module shell failed, Ansible Results =>
E           {
E               "changed": true, 
E               "cmd": "python /gnxi/gnmi_cli_py/py_gnmicli.py -g -t 10.250.0.101 -p 50051 -m get -x osversion/build -xt OTHERS -o ndastreamingservertest", 
E               "delta": "0:00:00.798491", 
E               "end": "2020-11-24 08:16:23.024966", 
E               "failed": true, 
E               "invocation": {
E                   "module_args": {
E                       "_raw_params": "python /gnxi/gnmi_cli_py/py_gnmicli.py -g -t 10.250.0.101 -p 50051 -m get -x osversion/build -xt OTHERS -o ndastreamingservertest", 
E                       "_uses_shell": true, 
E                       "argv": null, 
E                       "chdir": null, 
E                       "creates": null, 
E                       "executable": null, 
E                       "removes": null, 
E                       "stdin": null, 
E                       "stdin_add_newline": true, 
E                       "strip_empty_ends": true, 
E                       "warn": true
E                   }
E               }, 
E               "msg": "non-zero return code", 
E               "rc": 1, 
E               "start": "2020-11-24 08:16:22.226475", 
E               "stderr": "Traceback (most recent call last):\n  File \"/gnxi/gnmi_cli_py/py_gnmicli.py\", line 422, in <module>\n    main()\n  File \"/gnxi/gnmi_cli_py/py_gnmicli.py\", line 389, in main\n    response = _get(stub, paths, user, password, prefix)\n  File \"/gnxi/gnmi_cli_py/py_gnmicli.py\", line 282, 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 = \"[OTHERS osversion build] not found in clientTrie tree\"\n\tdebug_error_string = \"{\"created\":\"@1606205783.009939832\",\"description\":\"Error received from peer\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":1036,\"grpc_message\":\"[OTHERS osversion build] not found in clientTrie tree\",\"grpc_status\":5}\"\n>", 
E               "stderr_lines": [
E                   "Traceback (most recent call last):", 
E                   "  File \"/gnxi/gnmi_cli_py/py_gnmicli.py\", line 422, in <module>", 
E                   "    main()", 
E                   "  File \"/gnxi/gnmi_cli_py/py_gnmicli.py\", line 389, in main", 
E                   "    response = _get(stub, paths, user, password, prefix)", 
E                   "  File \"/gnxi/gnmi_cli_py/py_gnmicli.py\", line 282, in _get", 
E                   "    **kwargs)", 
E                   "  File \"/usr/local/lib/python2.7/dist-packages/grpc/_channel.py\", line 550, in __call__", 
E                   "    return _end_unary_response_blocking(state, call, False, None)", 
E                   "  File \"/usr/local/lib/python2.7/dist-packages/grpc/_channel.py\", line 467, in _end_unary_response_blocking", 
E                   "    raise _Rendezvous(state, None, None, deadline)", 
E                   "grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:", 
E                   "\tstatus = StatusCode.NOT_FOUND", 
E                   "\tdetails = \"[OTHERS osversion build] not found in clientTrie tree\"", 
E                   "\tdebug_error_string = \"{\"created\":\"@1606205783.009939832\",\"description\":\"Error received from peer\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":1036,\"grpc_message\":\"[OTHERS osversion build] not found in clientTrie tree\",\"grpc_status\":5}\"", 
E                   ">"
E               ], 
E               "stdout": "Performing GetRequest, encoding=JSON_IETF to 10.250.0.101  with the following gNMI Path\n ------------------------- \n elem {\n  name: \"osversion\"\n}\nelem {\n  name: \"build\"\n}", 
E               "stdout_lines": [
E                   "Performing GetRequest, encoding=JSON_IETF to 10.250.0.101  with the following gNMI Path", 
E                   " ------------------------- ", 
E                   " elem {", 
E                   "  name: \"osversion\"", 
E                   "}", 
E                   "elem {", 
E                   "  name: \"build\"", 
E                   "}"
E               ]
E           }

@wangxin wangxin requested a review from pra-moh November 27, 2020 07:42
@macikgozwa
Copy link
Contributor Author

macikgozwa commented Dec 2, 2020

Thanks for the review @wangxin. The test is failing because the corresponding service changes are not merged yet. The PR for the service changes is here.
I'll update this thread once that PR is merged and re-validate if the test is OK.

@macikgozwa
Copy link
Contributor Author

Retest this, please

@wangxin wangxin merged commit e399ffb into sonic-net:master Dec 15, 2020
@macikgozwa macikgozwa deleted the pytest-build-version branch December 15, 2020 18:05
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.

3 participants