Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add vxlan tests using xconnect
[csit.git]
/
resources
/
libraries
/
python
/
InterfaceUtil.py
diff --git
a/resources/libraries/python/InterfaceUtil.py
b/resources/libraries/python/InterfaceUtil.py
index
aeb54be
..
be12650
100644
(file)
--- a/
resources/libraries/python/InterfaceUtil.py
+++ b/
resources/libraries/python/InterfaceUtil.py
@@
-30,10
+30,10
@@
class InterfaceUtil(object):
Function can be used for DUTs as well as for TGs.
:param node: node where the interface is
Function can be used for DUTs as well as for TGs.
:param node: node where the interface is
- :param interface: interface name
+ :param interface: interface name
or sw_if_index
:param state: one of 'up' or 'down'
:type node: dict
:param state: one of 'up' or 'down'
:type node: dict
- :type interface: str
+ :type interface: str
or int
:type state: str
:return: nothing
"""
:type state: str
:return: nothing
"""
@@
-45,7
+45,11
@@
class InterfaceUtil(object):
else:
raise ValueError('Unexpected interface state: {}'.format(state))
else:
raise ValueError('Unexpected interface state: {}'.format(state))
- sw_if_index = Topology.get_interface_sw_index(node, interface)
+ if isinstance(interface, basestring):
+ sw_if_index = Topology.get_interface_sw_index(node, interface)
+ else:
+ sw_if_index = interface
+
VatExecutor.cmd_from_template(node, 'set_if_state.vat',
sw_if_index=sw_if_index, state=state)
VatExecutor.cmd_from_template(node, 'set_if_state.vat',
sw_if_index=sw_if_index, state=state)