aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
authorselias <samuel.elias@pantheon.tech>2016-03-01 10:56:40 +0100
committerStefan Kobza <skobza@cisco.com>2016-03-07 17:22:34 +0100
commit8120dcdc84da7ff1dee097240bc1ecf18914397c (patch)
treee4b2743e885cb0d72eaba56d6187678258f3095c /resources/libraries/python
parent4fc12a553db78ff2ad293e7a87845b365a53d736 (diff)
change interface up calls to explicit keywords
Remove implicit "set interface state" calls from ipv4 and ipv6 test keywords. Use robot keyword instead. Change-Id: I535a7a967910e77dded39eb167fb9c164187566e Signed-off-by: selias <samuel.elias@pantheon.tech>
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/IPv4Setup.py12
-rw-r--r--resources/libraries/python/IPv6Setup.py12
2 files changed, 19 insertions, 5 deletions
diff --git a/resources/libraries/python/IPv4Setup.py b/resources/libraries/python/IPv4Setup.py
index ed65518254..a9d9caa51c 100644
--- a/resources/libraries/python/IPv4Setup.py
+++ b/resources/libraries/python/IPv4Setup.py
@@ -231,14 +231,18 @@ class IPv4Setup(object):
"""IPv4 setup in topology."""
@staticmethod
- def vpp_nodes_setup_ipv4_addresses(nodes, nodes_addr):
- """Setup IPv4 addresses on all VPP nodes in topology.
+ def vpp_nodes_set_ipv4_addresses(nodes, nodes_addr):
+ """Set IPv4 addresses on all VPP nodes in topology.
:param nodes: Nodes of the test topology.
:param nodes_addr: Available nodes IPv4 adresses.
:type nodes: dict
:type nodes_addr: dict
+ :return: affected interfaces as list of (node, interface) tuples
+ :rtype: list
"""
+
+ interfaces = []
for net in nodes_addr.values():
for port in net['ports'].values():
host = port.get('node')
@@ -251,7 +255,9 @@ class IPv4Setup(object):
if node['type'] != NodeType.DUT:
continue
get_node(node).set_ip(port['if'], port['addr'], net['prefix'])
- InterfaceUtil.set_interface_state(node, port['if'], 'up')
+ interfaces.append((node, port['if']))
+
+ return interfaces
@staticmethod
@keyword('Get IPv4 address of node "${node}" interface "${port}" '
diff --git a/resources/libraries/python/IPv6Setup.py b/resources/libraries/python/IPv6Setup.py
index e04668f953..598905735a 100644
--- a/resources/libraries/python/IPv6Setup.py
+++ b/resources/libraries/python/IPv6Setup.py
@@ -55,14 +55,19 @@ class IPv6Setup(object):
def __init__(self):
pass
- def nodes_setup_ipv6_addresses(self, nodes, nodes_addr):
- """Setup IPv6 addresses on all VPP nodes in topology.
+ def nodes_set_ipv6_addresses(self, nodes, nodes_addr):
+ """Set IPv6 addresses on all VPP nodes in topology.
:param nodes: Nodes of the test topology.
:param nodes_addr: Available nodes IPv6 adresses.
:type nodes: dict
:type nodes_addr: dict
+ :return: affected interfaces as list of (node, interface) tuples
+ :rtype: list
"""
+
+ interfaces = []
+
for net in nodes_addr.values():
for port in net['ports'].values():
host = port.get('node')
@@ -76,6 +81,9 @@ class IPv6Setup(object):
self.vpp_set_if_ipv6_addr(node, port['if'], port['addr'],
net['prefix'])
+ interfaces.append((node, port['if']))
+
+ return interfaces
def nodes_clear_ipv6_addresses(self, nodes, nodes_addr):
"""Remove IPv6 addresses from all VPP nodes in topology.