From 479e2cd1cd6b1c2c0305995ac3331a8d11a19af8 Mon Sep 17 00:00:00 2001 From: Murat Date: Tue, 24 Nov 2020 06:38:05 +0000 Subject: [PATCH 1/6] Adding PyTest for osversion/build query --- tests/telemetry/test_telemetry.py | 45 ++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/tests/telemetry/test_telemetry.py b/tests/telemetry/test_telemetry.py index 58ebf0daf4f..2cfc5c7524b 100644 --- a/tests/telemetry/test_telemetry.py +++ b/tests/telemetry/test_telemetry.py @@ -12,7 +12,16 @@ logger = logging.getLogger(__name__) TELEMETRY_PORT = 50051 +mode_subscribe = "subscribe" +mode_get = "get" +subscribe_mode_stream = 0 +subscribe_mode_once = 1 +subscribe_mode_poll = 2 + +submode_targetdefined=0 +submode_onchange=1 +submode_sample=2 # Helper functions def get_dict_stdout(gnmi_out, certs_out): @@ -45,6 +54,21 @@ def setup_telemetry_forpyclient(duthost): else: logger.info('client auth is false. No need to restart telemetry') +def generate_client_cli(duthost, mode=mode_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}' + cmd = cmdFormat.format(duthost.mgmt_ip, TELEMETRY_PORT, mode, xpath, target, "ndastreamingservertest") + + if mode == mode_subscribe: + cmd += " --subscribe_mode {0} --submode {1} --interval {2} --update_count {3}".format(subscribe_mode, submode, intervalms, update_count) + return cmd + +def assert_equal(actual, expected, message): + """Helper method to compare an expected value vs the actual value. + """ + pytest_assert(actual == expected, "{0}. Expected {1} vs actual {2}".format(message, expected, actual)) + def verify_telemetry_dockerimage(duthost): """If telemetry docker is available in image then return true """ @@ -55,10 +79,9 @@ def verify_telemetry_dockerimage(duthost): return (len(matching) > 0) # Test functions -def test_config_db_parameters(duthosts, rand_one_dut_hostname): +def test_config_db_parameters(duthost): """Verifies required telemetry parameters from config_db. """ - duthost = duthosts[rand_one_dut_hostname] docker_present = verify_telemetry_dockerimage(duthost) if not docker_present: pytest.skip("docker-sonic-telemetry is not part of the image") @@ -84,10 +107,9 @@ def test_config_db_parameters(duthosts, rand_one_dut_hostname): server_crt_expected = "/etc/sonic/telemetry/streamingtelemetryserver.cer" pytest_assert(str(value) == server_crt_expected, "'server_crt' value is not '{}'".format(server_crt_expected)) -def test_telemetry_enabledbydefault(duthosts, rand_one_dut_hostname): +def test_telemetry_enabledbydefault(duthost): """Verify telemetry should be enabled by default """ - duthost = duthosts[rand_one_dut_hostname] docker_present = verify_telemetry_dockerimage(duthost) if not docker_present: pytest.skip("docker-sonic-telemetry is not part of the image") @@ -103,10 +125,9 @@ def test_telemetry_enabledbydefault(duthosts, rand_one_dut_hostname): status_expected = "enabled"; pytest_assert(str(v) == status_expected, "Telemetry feature is not enabled") -def test_telemetry_ouput(duthosts, rand_one_dut_hostname, ptfhost, localhost): +def test_telemetry_ouput(duthost, ptfhost, localhost): """Run pyclient from ptfdocker and show gnmi server outputself. """ - duthost = duthosts[rand_one_dut_hostname] docker_present = verify_telemetry_dockerimage(duthost) if not docker_present: pytest.skip("docker-sonic-telemetry is not part of the image") @@ -133,3 +154,15 @@ def test_telemetry_ouput(duthosts, rand_one_dut_hostname, ptfhost, localhost): result = str(show_gnmi_out) inerrors_match = re.search("SAI_PORT_STAT_IF_IN_ERRORS", result) pytest_assert(inerrors_match is not None, "SAI_PORT_STAT_IF_IN_ERRORS not found in gnmi_output") + +def test_osbuild_version(duthost, ptfhost, localhost): + """ Test osbuild/version query. + """ + + cmd = generate_client_cli(duthost=duthost, mode=mode_get, target="OTHERS", xpath="osversion/build") + logger.info("Command to run: {0}".format(cmd)) + show_gnmi_out = ptfhost.shell(cmd)['stdout'] + logger.info(show_gnmi_out) + result = str(show_gnmi_out) + + assert_equal(len(re.findall('"build_version": "sonic', result)), 1, "build_version value") From 9c3ec920538a4caa340bee15bd6fa5788879ef24 Mon Sep 17 00:00:00 2001 From: Murat Date: Tue, 24 Nov 2020 06:44:12 +0000 Subject: [PATCH 2/6] Merged with master --- tests/telemetry/test_telemetry.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/telemetry/test_telemetry.py b/tests/telemetry/test_telemetry.py index 2cfc5c7524b..02da04da9c3 100644 --- a/tests/telemetry/test_telemetry.py +++ b/tests/telemetry/test_telemetry.py @@ -79,9 +79,10 @@ def verify_telemetry_dockerimage(duthost): return (len(matching) > 0) # Test functions -def test_config_db_parameters(duthost): +def test_config_db_parameters(duthosts, rand_one_dut_hostname): """Verifies required telemetry parameters from config_db. """ + duthost = duthosts[rand_one_dut_hostname] docker_present = verify_telemetry_dockerimage(duthost) if not docker_present: pytest.skip("docker-sonic-telemetry is not part of the image") @@ -107,9 +108,10 @@ def test_config_db_parameters(duthost): server_crt_expected = "/etc/sonic/telemetry/streamingtelemetryserver.cer" pytest_assert(str(value) == server_crt_expected, "'server_crt' value is not '{}'".format(server_crt_expected)) -def test_telemetry_enabledbydefault(duthost): +def test_telemetry_enabledbydefault(duthosts, rand_one_dut_hostname): """Verify telemetry should be enabled by default """ + duthost = duthosts[rand_one_dut_hostname] docker_present = verify_telemetry_dockerimage(duthost) if not docker_present: pytest.skip("docker-sonic-telemetry is not part of the image") @@ -125,9 +127,10 @@ def test_telemetry_enabledbydefault(duthost): status_expected = "enabled"; pytest_assert(str(v) == status_expected, "Telemetry feature is not enabled") -def test_telemetry_ouput(duthost, ptfhost, localhost): +def test_telemetry_ouput(duthosts, rand_one_dut_hostname, ptfhost, localhost): """Run pyclient from ptfdocker and show gnmi server outputself. """ + duthost = duthosts[rand_one_dut_hostname] docker_present = verify_telemetry_dockerimage(duthost) if not docker_present: pytest.skip("docker-sonic-telemetry is not part of the image") @@ -155,10 +158,10 @@ def test_telemetry_ouput(duthost, ptfhost, localhost): inerrors_match = re.search("SAI_PORT_STAT_IF_IN_ERRORS", result) pytest_assert(inerrors_match is not None, "SAI_PORT_STAT_IF_IN_ERRORS not found in gnmi_output") -def test_osbuild_version(duthost, ptfhost, localhost): +def test_osbuild_version(duthosts, rand_one_dut_hostname, ptfhost, localhost): """ Test osbuild/version query. """ - + duthost = duthosts[rand_one_dut_hostname] cmd = generate_client_cli(duthost=duthost, mode=mode_get, target="OTHERS", xpath="osversion/build") logger.info("Command to run: {0}".format(cmd)) show_gnmi_out = ptfhost.shell(cmd)['stdout'] From 961db9b27590d7d8074d0bd21505c45d3c3e2405 Mon Sep 17 00:00:00 2001 From: Murat Acikgoz Date: Tue, 1 Dec 2020 16:15:39 -0800 Subject: [PATCH 3/6] Basic PyTest for streaming mode --- tests/telemetry/test_telemetry.py | 78 ++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 6 deletions(-) diff --git a/tests/telemetry/test_telemetry.py b/tests/telemetry/test_telemetry.py index 58ebf0daf4f..d7f8f94232c 100644 --- a/tests/telemetry/test_telemetry.py +++ b/tests/telemetry/test_telemetry.py @@ -12,7 +12,16 @@ logger = logging.getLogger(__name__) TELEMETRY_PORT = 50051 +mode_subscribe = "subscribe" +mode_get = "get" +subscribe_mode_stream = 0 +subscribe_mode_once = 1 +subscribe_mode_poll = 2 + +submode_targetdefined=0 +submode_onchange=1 +submode_sample=2 # Helper functions def get_dict_stdout(gnmi_out, certs_out): @@ -45,6 +54,21 @@ def setup_telemetry_forpyclient(duthost): else: logger.info('client auth is false. No need to restart telemetry') +def generate_client_cli(duthost, mode=mode_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}' + cmd = cmdFormat.format(duthost.mgmt_ip, TELEMETRY_PORT, mode, xpath, target, "ndastreamingservertest") + + if mode == mode_subscribe: + cmd += " --subscribe_mode {0} --submode {1} --interval {2} --update_count {3}".format(subscribe_mode, submode, intervalms, update_count) + return cmd + +def assert_equal(actual, expected, message): + """Helper method to compare an expected value vs the actual value. + """ + pytest_assert(actual == expected, "{0}. Expected {1} vs actual {2}".format(message, expected, actual)) + def verify_telemetry_dockerimage(duthost): """If telemetry docker is available in image then return true """ @@ -55,10 +79,54 @@ def verify_telemetry_dockerimage(duthost): return (len(matching) > 0) # Test functions -def test_config_db_parameters(duthosts, rand_one_dut_hostname): + +def test_invalid_streaming_mode(duthost, ptfhost, localhost): + """Check for sample streaming streaming mode validations. + Verify that TARGET_DEFINED is not supported. + """ + cmd = generate_client_cli(duthost=duthost, mode=mode_subscribe, submode=submode_targetdefined, update_count = 3) + logger.info("Command to run: {0}".format(cmd)) + show_gnmi_out = ptfhost.shell(cmd)['stdout'] + logger.info(show_gnmi_out) + result = str(show_gnmi_out) + + assert_equal(len(re.findall('subscribe {', result)), 1, "Subscribe request.") + assert_equal(len(re.findall('mode: ', result)), 0, "Default submode.") # since ON_TARGET is the default mode, it is not included in the request. + assert_equal(len(re.findall('status = StatusCode.INVALID_ARGUMENT', result)), 1, "Response code for invalid submode.") + assert_equal(len(re.findall('details = "unsupported subscription mode, TARGET_DEFINED"', result)), 1, "Details for invalid submode.") + +def test_invalid_streaming_interval(duthost, ptfhost, localhost): + """Check for sample streaming interval validations. + Default limit for interval is 1s, any non-zero interval should be rejected. + """ + cmd = generate_client_cli(duthost=duthost, mode=mode_subscribe, update_count = 3, intervalms = 900) + logger.info("Command to run: {0}".format(cmd)) + show_gnmi_out = ptfhost.shell(cmd)['stdout'] + logger.info(show_gnmi_out) + result = str(show_gnmi_out) + + assert_equal(len(re.findall('subscribe {', result)), 1, "Subscribe request.") + assert_equal(len(re.findall('mode: SAMPLE', result)), 1, "SAMPLE submode.") + assert_equal(len(re.findall('sample_interval: 900000000', result)), 1, "Sample interval.") + assert_equal(len(re.findall('details = "invalid interval: 900ms. It cannot be less than 1s"', result)), 1, "Response for invalid interval.") + +def test_virtualdb_table_streaming(duthost, ptfhost, localhost): + """Run pyclient from ptfdocker to stream a virtual-db query multiple times. + """ + cmd = generate_client_cli(duthost=duthost, mode=mode_subscribe, update_count = 3) + logger.info("Command to run: {0}".format(cmd)) + show_gnmi_out = ptfhost.shell(cmd)['stdout'] + logger.info(show_gnmi_out) + result = str(show_gnmi_out) + + assert_equal(len(re.findall('Max update count reached 3', result)), 1, "Streaming update count.") + assert_equal(len(re.findall('name: "Ethernet0"\n', result)), 4, "Streaming updates for Ethernet0") # 1 for request, 3 for response + assert_equal(len(re.findall('timestamp: \d+', result)), 3, "Timestamp markers for each update message.") + + +def test_config_db_parameters(duthost): """Verifies required telemetry parameters from config_db. """ - duthost = duthosts[rand_one_dut_hostname] docker_present = verify_telemetry_dockerimage(duthost) if not docker_present: pytest.skip("docker-sonic-telemetry is not part of the image") @@ -84,10 +152,9 @@ def test_config_db_parameters(duthosts, rand_one_dut_hostname): server_crt_expected = "/etc/sonic/telemetry/streamingtelemetryserver.cer" pytest_assert(str(value) == server_crt_expected, "'server_crt' value is not '{}'".format(server_crt_expected)) -def test_telemetry_enabledbydefault(duthosts, rand_one_dut_hostname): +def test_telemetry_enabledbydefault(duthost): """Verify telemetry should be enabled by default """ - duthost = duthosts[rand_one_dut_hostname] docker_present = verify_telemetry_dockerimage(duthost) if not docker_present: pytest.skip("docker-sonic-telemetry is not part of the image") @@ -103,10 +170,9 @@ def test_telemetry_enabledbydefault(duthosts, rand_one_dut_hostname): status_expected = "enabled"; pytest_assert(str(v) == status_expected, "Telemetry feature is not enabled") -def test_telemetry_ouput(duthosts, rand_one_dut_hostname, ptfhost, localhost): +def test_telemetry_ouput(duthost, ptfhost, localhost): """Run pyclient from ptfdocker and show gnmi server outputself. """ - duthost = duthosts[rand_one_dut_hostname] docker_present = verify_telemetry_dockerimage(duthost) if not docker_present: pytest.skip("docker-sonic-telemetry is not part of the image") From 881aecc1c340bc82037e15c981dea74f8acf9c20 Mon Sep 17 00:00:00 2001 From: Murat Acikgoz Date: Tue, 1 Dec 2020 20:45:35 -0800 Subject: [PATCH 4/6] Processing PR comments. --- tests/telemetry/test_telemetry.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/tests/telemetry/test_telemetry.py b/tests/telemetry/test_telemetry.py index 02da04da9c3..dad1a10c9de 100644 --- a/tests/telemetry/test_telemetry.py +++ b/tests/telemetry/test_telemetry.py @@ -12,16 +12,16 @@ logger = logging.getLogger(__name__) TELEMETRY_PORT = 50051 -mode_subscribe = "subscribe" -mode_get = "get" +METHOD_SUBSCRIBE = "subscribe" +METHOD_GET = "get" -subscribe_mode_stream = 0 -subscribe_mode_once = 1 -subscribe_mode_poll = 2 +SUBSCRIBE_MODE_STREAM = 0 +SUBSCRIBE_MODE_ONCE = 1 +SUBSCRIBE_MODE_POLL = 2 -submode_targetdefined=0 -submode_onchange=1 -submode_sample=2 +SUBMODE_TARGET_DEFINED = 0 +SUBMODE_ON_CHANGE = 1 +SUBMODE_SAMPLE = 2 # Helper functions def get_dict_stdout(gnmi_out, certs_out): @@ -54,13 +54,13 @@ def setup_telemetry_forpyclient(duthost): else: logger.info('client auth is false. No need to restart telemetry') -def generate_client_cli(duthost, mode=mode_get, xpath="COUNTERS/Ethernet0", target="COUNTERS_DB", subscribe_mode=subscribe_mode_stream, submode=submode_sample, intervalms=0, update_count=3): +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}' - cmd = cmdFormat.format(duthost.mgmt_ip, TELEMETRY_PORT, mode, xpath, target, "ndastreamingservertest") + cmd = cmdFormat.format(duthost.mgmt_ip, TELEMETRY_PORT, method, xpath, target, "ndastreamingservertest") - if mode == mode_subscribe: + if method == METHOD_SUBSCRIBE: cmd += " --subscribe_mode {0} --submode {1} --interval {2} --update_count {3}".format(subscribe_mode, submode, intervalms, update_count) return cmd @@ -162,10 +162,11 @@ def test_osbuild_version(duthosts, rand_one_dut_hostname, ptfhost, localhost): """ Test osbuild/version query. """ duthost = duthosts[rand_one_dut_hostname] - cmd = generate_client_cli(duthost=duthost, mode=mode_get, target="OTHERS", xpath="osversion/build") - logger.info("Command to run: {0}".format(cmd)) + cmd = generate_client_cli(duthost=duthost, method=METHOD_GET, target="OTHERS", xpath="osversion/build") + logger.debug("Command to run: {0}".format(cmd)) show_gnmi_out = ptfhost.shell(cmd)['stdout'] - logger.info(show_gnmi_out) + logger.debug(show_gnmi_out) result = str(show_gnmi_out) - assert_equal(len(re.findall('"build_version": "sonic', result)), 1, "build_version value") + assert_equal(len(re.findall('"build_version": "sonic\.', result)), 1, "build_version value at {0}".format(result)) + assert_equal(len(re.findall('sonic\.NA', result, flags=re.IGNORECASE)), 0, "invalid build_version value at {0}".format(result)) From 7bc87ae680d8d4cd38eb7b7e120d69fc92be7461 Mon Sep 17 00:00:00 2001 From: Murat Acikgoz Date: Mon, 14 Dec 2020 13:54:07 -0800 Subject: [PATCH 5/6] Rebased with upstream --- tests/telemetry/test_telemetry.py | 40 +++++++++++++++++++------------ 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/tests/telemetry/test_telemetry.py b/tests/telemetry/test_telemetry.py index d34d6f56a8c..cb15789f251 100644 --- a/tests/telemetry/test_telemetry.py +++ b/tests/telemetry/test_telemetry.py @@ -44,7 +44,7 @@ def get_list_stdout(cmd_out): out_list.append(result) return out_list -def setup_telemetry_forpyclient(duthost, localhost): +def setup_telemetry_forpyclient(duthost): """ Set client_auth=false. This is needed for pyclient to sucessfully set up channel with gnmi server. Restart telemetry process """ @@ -53,10 +53,6 @@ def setup_telemetry_forpyclient(duthost, localhost): if client_auth == "true": duthost.shell('sonic-db-cli CONFIG_DB HSET "TELEMETRY|gnmi" "client_auth" "false"', module_ignore_errors=False) duthost.service(name="telemetry", state="restarted") - - # wait till telemetry is restarted - pytest_assert(wait_until(100, 10, duthost.is_service_fully_started, "telemetry"), "TELEMETRY not started") - logger.info('telemetry process restarted. Now run pyclient on ptfdocker') else: logger.info('client auth is false. No need to restart telemetry') @@ -108,7 +104,7 @@ def setup_streaming_telemetry(duthosts, rand_one_dut_hostname, localhost, ptfho pytest_assert(file_exists["stat"]["exists"] is True) # Test functions -def test_config_db_parameters(duthost): +def test_config_db_parameters(duthosts, rand_one_dut_hostname): """Verifies required telemetry parameters from config_db. """ duthost = duthosts[rand_one_dut_hostname] @@ -134,7 +130,7 @@ def test_config_db_parameters(duthost): server_crt_expected = "/etc/sonic/telemetry/streamingtelemetryserver.cer" pytest_assert(str(value) == server_crt_expected, "'server_crt' value is not '{}'".format(server_crt_expected)) -def test_telemetry_enabledbydefault(duthost): +def test_telemetry_enabledbydefault(duthosts, rand_one_dut_hostname): """Verify telemetry should be enabled by default """ duthost = duthosts[rand_one_dut_hostname] @@ -166,20 +162,18 @@ def test_telemetry_ouput(duthosts, rand_one_dut_hostname, ptfhost, setup_streami inerrors_match = re.search("SAI_PORT_STAT_IF_IN_ERRORS", result) pytest_assert(inerrors_match is not None, "SAI_PORT_STAT_IF_IN_ERRORS not found in gnmi_output") -def test_virtualdb_table_streaming(duthost, ptfhost, localhost): - """Run pyclient from ptfdocker to stream a virtual-db query multiple times. +def test_osbuild_version(duthosts, rand_one_dut_hostname, ptfhost, localhost): + """ Test osbuild/version query. """ - logger.info('start virtual db sample streaming testing') - - cmd = generate_client_cli(duthost=duthost, method=METHOD_SUBSCRIBE, update_count = 3) + duthost = duthosts[rand_one_dut_hostname] + cmd = generate_client_cli(duthost=duthost, method=METHOD_GET, target="OTHERS", xpath="osversion/build") logger.debug("Command to run: {0}".format(cmd)) show_gnmi_out = ptfhost.shell(cmd)['stdout'] logger.debug(show_gnmi_out) result = str(show_gnmi_out) - assert_equal(len(re.findall('Max update count reached 3', result)), 1, "Streaming update count in:\n{0}".format(result)) - assert_equal(len(re.findall('name: "Ethernet0"\n', result)), 4, "Streaming updates for Ethernet0 in:\n{0}".format(result)) # 1 for request, 3 for response - assert_equal(len(re.findall('timestamp: \d+', result)), 3, "Timestamp markers for each update message in:\n{0}".format(result)) + assert_equal(len(re.findall('"build_version": "sonic\.', result)), 1, "build_version value at {0}".format(result)) + assert_equal(len(re.findall('sonic\.NA', result, flags=re.IGNORECASE)), 0, "invalid build_version value at {0}".format(result)) def test_sysuptime(duthosts, rand_one_dut_hostname, ptfhost, setup_streaming_telemetry, localhost): """ @@ -224,3 +218,19 @@ def test_sysuptime(duthosts, rand_one_dut_hostname, ptfhost, setup_streaming_tel if system_uptime_2nd - system_uptime_1st < 10: pytest.fail("The value of system uptime was not updated correctly.") + +def test_virtualdb_table_streaming(duthosts, rand_one_dut_hostname, ptfhost, localhost): + """Run pyclient from ptfdocker to stream a virtual-db query multiple times. + """ + logger.info('start virtual db sample streaming testing') + + duthost = duthosts[rand_one_dut_hostname] + cmd = generate_client_cli(duthost=duthost, method=METHOD_SUBSCRIBE, update_count = 3) + logger.debug("Command to run: {0}".format(cmd)) + show_gnmi_out = ptfhost.shell(cmd)['stdout'] + logger.debug(show_gnmi_out) + result = str(show_gnmi_out) + + assert_equal(len(re.findall('Max update count reached 3', result)), 1, "Streaming update count in:\n{0}".format(result)) + assert_equal(len(re.findall('name: "Ethernet0"\n', result)), 4, "Streaming updates for Ethernet0 in:\n{0}".format(result)) # 1 for request, 3 for response + assert_equal(len(re.findall('timestamp: \d+', result)), 3, "Timestamp markers for each update message in:\n{0}".format(result)) From 079b83b7204b412c89b6b83e4315c89789536dd0 Mon Sep 17 00:00:00 2001 From: Murat Acikgoz Date: Tue, 22 Dec 2020 14:21:31 -0800 Subject: [PATCH 6/6] Resolving comments. --- tests/telemetry/test_telemetry.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/telemetry/test_telemetry.py b/tests/telemetry/test_telemetry.py index cb15789f251..71087290c75 100644 --- a/tests/telemetry/test_telemetry.py +++ b/tests/telemetry/test_telemetry.py @@ -167,9 +167,7 @@ def test_osbuild_version(duthosts, rand_one_dut_hostname, ptfhost, localhost): """ duthost = duthosts[rand_one_dut_hostname] cmd = generate_client_cli(duthost=duthost, method=METHOD_GET, target="OTHERS", xpath="osversion/build") - logger.debug("Command to run: {0}".format(cmd)) show_gnmi_out = ptfhost.shell(cmd)['stdout'] - logger.debug(show_gnmi_out) result = str(show_gnmi_out) assert_equal(len(re.findall('"build_version": "sonic\.', result)), 1, "build_version value at {0}".format(result)) @@ -226,9 +224,7 @@ def test_virtualdb_table_streaming(duthosts, rand_one_dut_hostname, ptfhost, loc duthost = duthosts[rand_one_dut_hostname] cmd = generate_client_cli(duthost=duthost, method=METHOD_SUBSCRIBE, update_count = 3) - logger.debug("Command to run: {0}".format(cmd)) show_gnmi_out = ptfhost.shell(cmd)['stdout'] - logger.debug(show_gnmi_out) result = str(show_gnmi_out) assert_equal(len(re.findall('Max update count reached 3', result)), 1, "Streaming update count in:\n{0}".format(result))