示例#1
0
    def __stop_tunnel_from(self, gateway):
        options = WeaveTunnelStop.option()
        options["quiet"] = False
        options["border_gateway"] = gateway

        options["service_dir"] = self.use_service_dir

        self.weave_tunnel = WeaveTunnelStop.WeaveTunnelStop(options)
        ret = self.weave_tunnel.run()

        value = ret.Value()
        data = ret.Data()

        return value, data
示例#2
0
    def __stop_tunnel_between(self, gateway, service, num_iterations=1, faults={}, test_tag=""):
        options = WeaveTunnelStop.option()
        options["border_gateway"] = gateway
        options["service"] = service
        options["gateway_faults"] = faults.get("gateway")
        options["service_faults"] = faults.get("service")
        options["iterations"] = num_iterations
        options["test_tag"] = test_tag

        weave_tunnel = WeaveTunnelStop.WeaveTunnelStop(options)
        ret = weave_tunnel.run()

        value = ret.Value()
        data = ret.Data()

        return value, data
示例#3
0
#
#    @file
#       A Happy command line utility that stops Weave Tunnel between border-gateway and a service.
#
#       The command is executed by instantiating and running WeaveTunnelStop class.
#

import getopt
import sys
import set_test_path

import WeaveTunnelStop
from happy.Utils import *

if __name__ == "__main__":
    options = WeaveTunnelStop.option()

    try:
        opts, args = getopt.getopt(
            sys.argv[1:], "hb:s:q",
            ["help", "border_gateway=", "service=", "quiet"])

    except getopt.GetoptError as err:
        print WeaveTunnelStop.WeaveTunnelStop.__doc__
        print hred(str(err))
        sys.exit(hred("%s: Failed to parse arguments." % (__file__)))

    for o, a in opts:
        if o in ("-h", "--help"):
            print WeaveTunnelStop.WeaveTunnelStop.__doc__
            sys.exit(0)