X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FHoststackUtil.py;h=c3079466986930507e142fa1900763bccda08d4c;hb=HEAD;hp=2c9c080b69ce75bb1815297fce01e69d5331c6c1;hpb=752538617f43672a0a9eeb93432929032cca05d3;p=csit.git diff --git a/resources/libraries/python/HoststackUtil.py b/resources/libraries/python/HoststackUtil.py index 2c9c080b69..4ac73ff924 100644 --- a/resources/libraries/python/HoststackUtil.py +++ b/resources/libraries/python/HoststackUtil.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2024 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -44,7 +44,7 @@ class HoststackUtil(): vpp_echo_cmd = {} vpp_echo_cmd[u"name"] = u"vpp_echo" vpp_echo_cmd[u"args"] = f"{vpp_echo_attributes[u'role']} " \ - f"socket-name {vpp_echo_attributes[u'vpp_api_socket']} " \ + f"socket-name {vpp_echo_attributes[u'app_api_socket']} " \ f"{vpp_echo_attributes[u'json_output']} " \ f"uri {proto}://{addr}/{port} " \ f"nthreads {vpp_echo_attributes[u'nthreads']} " \ @@ -413,10 +413,6 @@ class HoststackUtil(): f"bits/sec, pkt-drop-rate {nsim_attr[u'packets_per_drop']} " \ f"pkts/drop\n" - test_results += \ - f"\n{role} VPP 'show errors' on host {node[u'host']}:\n" \ - f"{PapiSocketExecutor.run_cli_cmd(node, u'show error')}\n" - if u"error" in program_stderr.lower(): test_results += f"ERROR DETECTED:\n{program_stderr}" return (True, test_results) @@ -435,7 +431,7 @@ class HoststackUtil(): program_json = json.loads(json_results) export_hoststack_results( bandwidth=program_json["rx_bits_per_second"], - duration=program_json["time"] + duration=float(program_json["time"]) ) else: test_results += u"Invalid test data output!\n" + program_stdout @@ -445,7 +441,7 @@ class HoststackUtil(): program_json = json.loads(program_stdout)[u"intervals"][0][u"sum"] try: retransmits = program_json["retransmits"] - except(KeyError): + except KeyError: retransmits = None export_hoststack_results( bandwidth=program_json["bits_per_second"], @@ -469,18 +465,3 @@ class HoststackUtil(): :rtype: bool """ return server_defer_fail and client_defer_fail - - @staticmethod - def log_vpp_hoststack_data(node): - """Retrieve and log VPP HostStack data. - - :param node: DUT node. - :type node: dict - :raises RuntimeError: If node subtype is not a DUT or startup failed. - """ - - if node[u"type"] != u"DUT": - raise RuntimeError(u"Node type is not a DUT!") - - PapiSocketExecutor.run_cli_cmd(node, u"show error") - PapiSocketExecutor.run_cli_cmd(node, u"show interface")