Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
PAL: Add processing of PPS and CPS tests
[csit.git]
/
resources
/
libraries
/
python
/
IPUtil.py
diff --git
a/resources/libraries/python/IPUtil.py
b/resources/libraries/python/IPUtil.py
index
10a231f
..
552ba27
100644
(file)
--- a/
resources/libraries/python/IPUtil.py
+++ b/
resources/libraries/python/IPUtil.py
@@
-326,18
+326,24
@@
class IPUtil:
return None
@staticmethod
return None
@staticmethod
- def set_linux_interface_up(node, interface):
+ def set_linux_interface_up(
+ node, interface, namespace=None):
"""Set the specified interface up.
"""Set the specified interface up.
-
:param node: VPP/TG node.
:param interface: Interface in namespace.
:param node: VPP/TG node.
:param interface: Interface in namespace.
+ :param namespace: Execute command in namespace. Optional
:type node: dict
:type interface: str
:type node: dict
:type interface: str
+ :type namespace: str
:raises RuntimeError: If the interface could not be set up.
"""
:raises RuntimeError: If the interface could not be set up.
"""
- cmd = f"ip link set {interface} up"
+ if namespace is not None:
+ cmd = f"ip netns exec {namespace} ip link set dev {interface} up"
+ else:
+ cmd = f"ip link set dev {interface} up"
exec_cmd_no_error(node, cmd, timeout=30, sudo=True)
exec_cmd_no_error(node, cmd, timeout=30, sudo=True)
+
@staticmethod
def set_linux_interface_ip(
node, interface, ip_addr, prefix, namespace=None):
@staticmethod
def set_linux_interface_ip(
node, interface, ip_addr, prefix, namespace=None):