X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVPPUtil.py;h=c7354942824fee608334d8487a3b9ea8dbeceafa;hb=d6af9d72acaca4dff70dce1b55dcc03f73061c7b;hp=ca63fa6cea52b9c0816f94164104f3e71198cba8;hpb=2da2aa12260143bc513b4dff5e2b2ef6755172ab;p=csit.git diff --git a/resources/libraries/python/VPPUtil.py b/resources/libraries/python/VPPUtil.py index ca63fa6cea..c735494282 100644 --- a/resources/libraries/python/VPPUtil.py +++ b/resources/libraries/python/VPPUtil.py @@ -18,7 +18,7 @@ from robot.api import logger from resources.libraries.python.Constants import Constants from resources.libraries.python.DUTSetup import DUTSetup from resources.libraries.python.PapiExecutor import PapiSocketExecutor -from resources.libraries.python.ssh import exec_cmd_no_error +from resources.libraries.python.ssh import exec_cmd_no_error, exec_cmd from resources.libraries.python.topology import Topology, SocketType, NodeType @@ -134,17 +134,23 @@ class VPPUtil: :param node: Topology node. :type node: dict """ - cmd = u"echo \"show ver\" | sudo socat - UNIX-CONNECT:/run/vpp/cli.sock" + cmd = u"echo \"show pci\" | sudo socat - UNIX-CONNECT:/run/vpp/cli.sock" exec_cmd_no_error( node, cmd, sudo=False, message=u"VPP failed to start!", retries=120 ) - cmd = u"vppctl show ver 2>&1 | fgrep -v \"Connection refused\" | " \ + cmd = u"vppctl show pci 2>&1 | fgrep -v \"Connection refused\" | " \ u"fgrep -v \"No such file or directory\"" exec_cmd_no_error( node, cmd, sudo=True, message=u"VPP failed to start!", retries=120 ) + # Properly enable cards in case they were disabled. This will be + # followed in https://jira.fd.io/browse/VPP-1934. + cmd = u"for i in $(sudo vppctl sho int | grep Eth | cut -d' ' -f1); do"\ + u" sudo vppctl set int sta $i up; done" + exec_cmd(node, cmd, sudo=False) + @staticmethod def verify_vpp(node): """Verify that VPP is installed and started on the specified topology @@ -278,8 +284,13 @@ class VPPUtil: :param node: Topology node. :type node: dict """ - PapiSocketExecutor.run_cli_cmd_on_all_sockets( - node, u"elog trace api cli barrier") + try: + PapiSocketExecutor.run_cli_cmd_on_all_sockets( + node, u"event-logger trace api cli barrier") + except AssertionError: + # Perhaps an older VPP build is tested. + PapiSocketExecutor.run_cli_cmd_on_all_sockets( + node, u"elog trace api cli barrier") @staticmethod def vpp_enable_elog_traces_on_all_duts(nodes): @@ -346,15 +357,7 @@ class VPPUtil: with PapiSocketExecutor(node) as papi_exec: reply = papi_exec.add(cmd).get_reply() - threads_data = list() - for thread in reply[u"thread_data"]: - thread_data = list() - for item in thread: - if isinstance(item, str): - item = item.rstrip('\x00') - thread_data.append(item) - threads_data.append(thread_data) - + threads_data = reply[u"thread_data"] logger.trace(f"show threads:\n{threads_data}") return threads_data