X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=resources%2Flibraries%2Fpython%2Fhoneycomb%2FHoneycombSetup.py;h=a8a4f0e2922fbcd2e6cbc8cf477d2232f85c8d9f;hb=68dfcca79ee6838a266330eba834b360b11a3c15;hp=fba2bd42257d0f3cffe6b0430d32aab860da64f2;hpb=5a02dd13563a5c67e336f04eb526cbea206da29b;p=csit.git diff --git a/resources/libraries/python/honeycomb/HoneycombSetup.py b/resources/libraries/python/honeycomb/HoneycombSetup.py index fba2bd4225..a8a4f0e292 100644 --- a/resources/libraries/python/honeycomb/HoneycombSetup.py +++ b/resources/libraries/python/honeycomb/HoneycombSetup.py @@ -61,12 +61,13 @@ class HoneycombSetup(object): HoneycombSetup.print_environment(nodes) - logger.console("\n(re)Starting Honeycomb service ...") - cmd = "sudo service honeycomb start" for node in nodes: if node['type'] == NodeType.DUT: + logger.console( + "\n(re)Starting Honeycomb service on node {0}".format( + node["host"])) ssh = SSH() ssh.connect(node) (ret_code, _, _) = ssh.exec_command_sudo(cmd) @@ -89,13 +90,15 @@ class HoneycombSetup(object): :type nodes: list :raises HoneycombError: If Honeycomb failed to stop. """ - logger.console("\nShutting down Honeycomb service ...") cmd = "sudo service honeycomb stop" errors = [] for node in nodes: if node['type'] == NodeType.DUT: + logger.console( + "\nShutting down Honeycomb service on node {0}".format( + node["host"])) ssh = SSH() ssh.connect(node) (ret_code, _, _) = ssh.exec_command_sudo(cmd) @@ -121,7 +124,8 @@ class HoneycombSetup(object): :raises HoneycombError: If Honeycomb fails to start. """ - logger.console("\n(re)Starting Honeycomb service ...") + logger.console( + "\n(re)Starting Honeycomb service on node {0}".format(node["host"])) cmd = "sudo service honeycomb restart" @@ -370,7 +374,14 @@ class HoneycombSetup(object): "BGP": ["io.fd.hc2vpp.bgp.inet.BgpInetModule", "io.fd.honeycomb.infra.bgp.BgpModule", "io.fd.honeycomb.infra.bgp.BgpReadersModule", - "io.fd.honeycomb.infra.bgp.BgpWritersModule"] + "io.fd.honeycomb.infra.bgp.BgpWritersModule", + "io.fd.honeycomb.northbound.bgp.extension.InetModule", + "io.fd.honeycomb.northbound.bgp.extension.EvpnModule", + "io.fd.honeycomb.northbound.bgp.extension.L3VpnV4Module", + "io.fd.honeycomb.northbound.bgp.extension.L3VpnV6Module", + "io.fd.honeycomb.northbound.bgp.extension." + "LabeledUnicastModule", + "io.fd.honeycomb.northbound.bgp.extension.LinkstateModule"] } ssh = SSH() @@ -488,13 +499,15 @@ class HoneycombSetup(object): "in progress ...".format(node['host'])) @staticmethod - def install_odl_features(node, path, *features): + def install_odl_features(node, odl_name, path, *features): """Install required features on a running ODL client. :param node: Honeycomb node. + :param odl_name: Name of ODL client version to use. :param path: Path to ODL client on node. :param features: Optional, list of additional features to install. :type node: dict + :type odl_name: str :type path: str :type features: list """ @@ -502,10 +515,14 @@ class HoneycombSetup(object): ssh = SSH() ssh.connect(node) - cmd = "{path}/*karaf*/bin/client -u karaf feature:install " \ + auth = "-u karaf" + if odl_name.lower() == "oxygen": + auth = "-u karaf -p karaf" + + cmd = "{path}/*karaf*/bin/client {auth} feature:install " \ "odl-restconf-all " \ "odl-netconf-connector-all " \ - "odl-netconf-topology".format(path=path) + "odl-netconf-topology".format(path=path, auth=auth) for feature in features: cmd += " {0}".format(feature) @@ -643,6 +660,26 @@ class HoneycombSetup(object): logger.info("ODL client service stopped.") + @staticmethod + def set_static_arp(node, ip_address, mac_address): + """Configure a static ARP entry using arp. + + :param node: Node in topology. + :param ip_address: IP address for the entry. + :param mac_address: MAC adddress for the entry. + :type node: dict + :type ip_address: str + :type mac_address: str + :raises RuntimeError: If the operation fails. + """ + + ssh = SSH() + ssh.connect(node) + ret_code, _, _ = ssh.exec_command_sudo("arp -s {0} {1}".format( + ip_address, mac_address)) + + if ret_code != 0: + raise RuntimeError("Failed to configure static ARP adddress.") class HoneycombStartupConfig(object):