X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FDUTSetup.py;h=95b23018af8b6d6db6b5511ee2ad613d8f7f0859;hb=494c42cf77c2571a64854256a68abd7f180cd5d6;hp=e2fba066d3308f0b35789da10d7b3e358b9a5e2a;hpb=e001fdea995835f1ef75a5e21607ba02d78e4068;p=csit.git diff --git a/resources/libraries/python/DUTSetup.py b/resources/libraries/python/DUTSetup.py index e2fba066d3..95b23018af 100644 --- a/resources/libraries/python/DUTSetup.py +++ b/resources/libraries/python/DUTSetup.py @@ -62,7 +62,7 @@ class DUTSetup(object): @staticmethod def restart_service(node, service): - """Restarts the named service on node. + """Restart the named service on node. :param node: Node in the topology. :param service: Service unit name. @@ -76,13 +76,14 @@ class DUTSetup(object): message = 'Node {host} failed to restart service {name}'.\ format(host=node['host'], name=service) - exec_cmd_no_error(node, command, timeout=30, sudo=True, message=message) + exec_cmd_no_error( + node, command, timeout=180, sudo=True, message=message) DUTSetup.get_service_logs(node, service) @staticmethod def restart_service_on_all_duts(nodes, service): - """Retarts the named service on all DUTs. + """Restart the named service on all DUTs. :param node: Nodes in the topology. :param service: Service unit name. @@ -110,7 +111,8 @@ class DUTSetup(object): message = 'Node {host} failed to start service {name}'.\ format(host=node['host'], name=service) - exec_cmd_no_error(node, command, timeout=30, sudo=True, message=message) + exec_cmd_no_error( + node, command, timeout=180, sudo=True, message=message) DUTSetup.get_service_logs(node, service) @@ -143,7 +145,8 @@ class DUTSetup(object): message = 'Node {host} failed to stop service {name}'.\ format(host=node['host'], name=service) - exec_cmd_no_error(node, command, timeout=30, sudo=True, message=message) + exec_cmd_no_error( + node, command, timeout=180, sudo=True, message=message) DUTSetup.get_service_logs(node, service) @@ -160,34 +163,6 @@ class DUTSetup(object): if node['type'] == NodeType.DUT: DUTSetup.stop_service(node, service) - @staticmethod - def setup_dut(node): - """Run script over SSH to setup the DUT node. - - :param node: DUT node to set up. - :type node: dict - - :raises Exception: If the DUT setup fails. - """ - command = 'bash {0}/{1}/dut_setup.sh'.\ - format(Constants.REMOTE_FW_DIR, Constants.RESOURCES_LIB_SH) - message = 'DUT test setup script failed at node {name}'.\ - format(name=node['host']) - - exec_cmd_no_error(node, command, timeout=120, sudo=True, - message=message) - - @staticmethod - def setup_all_duts(nodes): - """Run script over SSH to setup all DUT nodes. - - :param nodes: Topology nodes. - :type nodes: dict - """ - for node in nodes.values(): - if node['type'] == NodeType.DUT: - DUTSetup.setup_dut(node) - @staticmethod def get_vpp_pid(node): """Get PID of running VPP process.