Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pra-moh committed Apr 8, 2020
1 parent 4c1b491 commit cec2abe
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/telemetry/test_telemetry.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import pytest
import logging

logger = logging.getLogger(__name__)

# Helper functions
def get_dict_stdout(gnmi_out, certs_out):
result = ""
Expand All @@ -22,7 +20,6 @@ def get_list_stdout(cmd_out):
# Test functions
def test_config_db_parameters(duthost):
"""Verifies required telemetry parameters from config_db.
This is scoped as module as it need to be run once before first test run.
"""
gnmi = duthost.shell('/usr/bin/redis-cli -n 4 hgetall "TELEMETRY|gnmi"', module_ignore_errors=False)['stdout_lines']
certs = duthost.shell('/usr/bin/redis-cli -n 4 hgetall "TELEMETRY|certs"', module_ignore_errors=False)['stdout_lines']
Expand All @@ -42,9 +39,9 @@ def test_config_db_parameters(duthost):
def test_telemetry_enabledbydefault(duthost):
"""Verify telemetry should be enabled by default
"""
status = duthost.shell('/usr/bin/redis-cli -n 4 hgetall "FEATURE|telemetry"', module_ignore_errors=True)['stdout_lines']
status = duthost.shell('/usr/bin/redis-cli -n 4 hgetall "FEATURE|telemetry"', module_ignore_errors=False)['stdout_lines']
status_list = get_list_stdout(status)
status_dict = dict(itertools.izip_longest(*[iter(status_list)] *2, fillvalue=""))
for k,v in status_dict.items():
if str(k) == "status" and str(v) == "enabled":
assert True, "Telemetry status is enabled"
assert True, "Telemetry status is enabled"

0 comments on commit cec2abe

Please sign in to comment.