From 442a2a7b0dfd2f1cd5a4ba03fb91ed32c96f8965 Mon Sep 17 00:00:00 2001 From: selias Date: Tue, 15 Aug 2017 19:33:50 +0200 Subject: CSIT-775 HC Test: CRUD over IPv6 control-plane interface Adds new test suite which accesses Honeycomb's Restconf and Netconf northbound over IPv6. This is done by sending the requests to TG where an IPv4 to IPv6 tunnel is configured to the Honeycomb DUT. Change-Id: I3b7467d8108b0da9756e632851215c66ed41bb61 Signed-off-by: selias --- resources/libraries/python/VPPUtil.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'resources/libraries/python/VPPUtil.py') diff --git a/resources/libraries/python/VPPUtil.py b/resources/libraries/python/VPPUtil.py index da59d1958d..5881d18966 100644 --- a/resources/libraries/python/VPPUtil.py +++ b/resources/libraries/python/VPPUtil.py @@ -46,3 +46,35 @@ class VPPUtil(object): ssh.connect(node) for _, value in def_setting_tb_displayed.items(): ssh.exec_command_sudo('vppctl sh {}'.format(value)) + + @staticmethod + def stop_vpp_service(node): + """Stop VPP service on the specified node. + + :param node: VPP node. + :type node: dict + :raises RuntimeError: If VPP fails to stop. + """ + + ssh = SSH() + ssh.connect(node) + cmd = "service vpp stop" + ret_code, _, _ = ssh.exec_command_sudo(cmd, timeout=80) + if int(ret_code) != 0: + raise RuntimeError("VPP service did not shut down gracefully.") + + @staticmethod + def start_vpp_service(node): + """start VPP service on the specified node. + + :param node: VPP node. + :type node: dict + :raises RuntimeError: If VPP fails to start. + """ + + ssh = SSH() + ssh.connect(node) + cmd = "service vpp start" + ret_code, _, _ = ssh.exec_command_sudo(cmd) + if int(ret_code) != 0: + raise RuntimeError("VPP service did not start.") -- cgit 1.2.3-korg