aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/honeycomb/HoneycombSetup.py
diff options
context:
space:
mode:
authorselias <samelias@cisco.com>2017-10-09 16:36:16 +0200
committerTibor Frank <tifrank@cisco.com>2017-11-08 13:26:45 +0000
commit56dd61dee872da788e578129eed48a3158a5b566 (patch)
tree4f56e96f06f78a8180c800eceabc56ce7046b4f5 /resources/libraries/python/honeycomb/HoneycombSetup.py
parent2b8547bc50fd06ea936f096794b8c2a5e09c5f8b (diff)
CSIT-811 HC Test: BGP functional tests
Added traffic tests for Honeycomb's BGP feature. Change-Id: I5fa99908ab61d8bc9d2975e451917b98571b6aca Signed-off-by: selias <samelias@cisco.com>
Diffstat (limited to 'resources/libraries/python/honeycomb/HoneycombSetup.py')
-rw-r--r--resources/libraries/python/honeycomb/HoneycombSetup.py32
1 files changed, 28 insertions, 4 deletions
diff --git a/resources/libraries/python/honeycomb/HoneycombSetup.py b/resources/libraries/python/honeycomb/HoneycombSetup.py
index 7c3831ca04..d4175b13e4 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"
@@ -650,6 +654,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):