X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVPPUtil.py;h=3c7894988be293a74e9d464b1e039de8dd59949b;hb=3289b49cd2f08f9aae43959e0d5778617379388f;hp=6e6dad70fc8165379d794a1fced1664099d46860;hpb=35024b691ade4278f49d8a65d237c7112fa32bc2;p=csit.git diff --git a/resources/libraries/python/VPPUtil.py b/resources/libraries/python/VPPUtil.py index 6e6dad70fc..3c7894988b 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 @@ -145,6 +145,12 @@ class VPPUtil: 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 @@ -346,15 +352,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