summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/topotest.py
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2018-07-24 18:20:08 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-11-27 20:22:14 -0500
commitf561216813efa3cb41d44f320981491f3c0115cf (patch)
treebec7e73e7dfc18f05cc58d13054cc7da51144e44 /tests/topotests/lib/topotest.py
parent918138769cd1ca0bb21c5e824795205a88489c74 (diff)
lib: add zebra api to shutdown an interface
this function operates on vtysh, and performs a shutdown on an interface. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'tests/topotests/lib/topotest.py')
-rw-r--r--tests/topotests/lib/topotest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py
index 84b185d7ea..dc67342fc1 100644
--- a/tests/topotests/lib/topotest.py
+++ b/tests/topotests/lib/topotest.py
@@ -404,6 +404,17 @@ def version_cmp(v1, v2):
return -1
return 0
+def interface_set_status(node, ifacename, ifaceaction=False, vrf_name=None):
+ if ifaceaction:
+ str_ifaceaction = 'no shutdown'
+ else:
+ str_ifaceaction = 'shutdown'
+ if vrf_name == None:
+ cmd = 'vtysh -c \"configure terminal\" -c \"interface {0}\" -c \"{1}\"'.format(ifacename, str_ifaceaction)
+ else:
+ cmd = 'vtysh -c \"configure terminal\" -c \"interface {0} vrf {1}\" -c \"{2}\"'.format(ifacename, vrf_name, str_ifaceaction)
+ node.run(cmd)
+
def ip4_route_zebra(node, vrf_name=None):
"""
Gets an output of 'show ip route' command. It can be used