Exemplo n.º 1
0
 def setUp(self):
     global interface_to_front_mapping
     BaseTest.setUp(self)
     self.test_params = testutils.test_params_get()
     self.loadPortMap()
     self.createRpcClient()
     return
Exemplo n.º 2
0
    def __init__(self):
        BaseTest.__init__(self)

        self.test_params = testutils.test_params_get()

        self.myip = self.my_ip
        self.peerip = self.peer_ip
        self.init_interfaces()
        return
Exemplo n.º 3
0
    def setUp(self):
        BaseTest.setUp(self)

        # Set up thrift client and contact server
        self.transport = TSocket.TSocket('localhost', 9092)
        self.transport = TTransport.TBufferedTransport(self.transport)
        self.protocol = TBinaryProtocol.TBinaryProtocol(self.transport)

        self.client = switch_sai_rpc.Client(self.protocol)
        self.transport.open()
Exemplo n.º 4
0
    def setUp(self):
        BaseTest.setUp(self)

        self.test_params = testutils.test_params_get()
        if self.test_params.has_key("server"):
            server = self.test_params['server']
        else:
            server = 'localhost'

        # Set up thrift client and contact server
        self.transport = TSocket.TSocket(server, 9092)
        self.transport = TTransport.TBufferedTransport(self.transport)
        self.protocol = TBinaryProtocol.TBinaryProtocol(self.transport)

        self.client = switch_sai_rpc.Client(self.protocol)
        self.transport.open()
Exemplo n.º 5
0
    def setUp(self):
        BaseTest.setUp(self)

        # Set up thrift client and contact server
        self.transport = TSocket.TSocket('localhost', 9090)
        self.transport = TTransport.TBufferedTransport(self.transport)
        bprotocol = TBinaryProtocol.TBinaryProtocol(self.transport)

        self.mc_protocol = TMultiplexedProtocol.TMultiplexedProtocol(bprotocol, "mc")
        self.conn_mgr_protocol = TMultiplexedProtocol.TMultiplexedProtocol(bprotocol, "conn_mgr")
        self.p4_protocol = TMultiplexedProtocol.TMultiplexedProtocol(bprotocol, self.p4_name)

        self.client = self.p4_client_module.Client(self.p4_protocol)
        self.mc = self.mc_client_module.Client(self.mc_protocol)
        self.conn_mgr = self.conn_mgr_client_module.Client(self.conn_mgr_protocol)
        self.transport.open()
Exemplo n.º 6
0
    def setUp(self):
        BaseTest.setUp(self)

        test_params = testutils.test_params_get()
        print
        print "You specified the following test-params when invoking ptf:"
        for k, v in test_params.items():
            print k, ":\t\t\t", v

        # Set up thrift client and contact server
        self.transport = TSocket.TSocket('localhost', 9092)
        self.transport = TTransport.TBufferedTransport(self.transport)
        self.protocol = TBinaryProtocol.TBinaryProtocol(self.transport)

        self.client = switch_sai_rpc.Client(self.protocol)
        self.transport.open()
Exemplo n.º 7
0
    def setUp(self):
        global interface_to_front_mapping

        BaseTest.setUp(self)

        self.test_params = testutils.test_params_get()
        if self.test_params.has_key("server"):
            server = self.test_params['server']
        else:
            server = 'localhost'

        if self.test_params.has_key("port_map"):
            user_input = self.test_params['port_map']
            splitted_map = user_input.split(",")
            for item in splitted_map:
                interface_front_pair = item.split("@")
                interface_to_front_mapping[interface_front_pair[0]] = interface_front_pair[1]
        elif self.test_params.has_key("port_map_file"):
            user_input = self.test_params['port_map_file']
            f = open(user_input, 'r')
            for line in f:
                if (len(line) > 0 and (line[0] == '#' or line[0] == ';' or line[0]=='/')):
                    continue;
                interface_front_pair = line.split("@")
                interface_to_front_mapping[interface_front_pair[0]] = interface_front_pair[1].strip()
        else:
            exit("No ptf interface<-> switch front port mapping, please specify as parameter or in external file")	    
            
        print interface_to_front_mapping

        # Set up thrift client and contact server
        self.transport = TSocket.TSocket(server, 9092)
        self.transport = TTransport.TBufferedTransport(self.transport)
        self.protocol = TBinaryProtocol.TBinaryProtocol(self.transport)

        self.client = switch_sai_rpc.Client(self.protocol)
        self.transport.open()
Exemplo n.º 8
0
 def tearDown(self):
     if config["log_dir"] != None:
         self.dataplane.stop_pcap()
     BaseTest.tearDown(self)
     self.transport.close()
Exemplo n.º 9
0
 def __init__(self, p4_name):
     BaseTest.__init__(self)
     self.p4_name = p4_name
     self.p4_client_module = importlib.import_module(".".join(["p4_pd_rpc", p4_name]))
     self.mc_client_module = importlib.import_module(".".join(["mc_pd_rpc", "mc"]))
     self.conn_mgr_client_module = importlib.import_module(".".join(["conn_mgr_pd_rpc", "conn_mgr"]))
Exemplo n.º 10
0
 def __init__(self):
     BaseTest.__init__(self)
Exemplo n.º 11
0
 def tearDown(self):
     BaseTest.tearDown(self)
     self.transport.close()
Exemplo n.º 12
0
 def __init__(self):
     BaseTest.__init__(self)
Exemplo n.º 13
0
 def __init__(self):
     '''
     @summary: constructor
     '''
     BaseTest.__init__(self)
     self.test_params = testutils.test_params_get()
Exemplo n.º 14
0
 def __init__(self):
     BaseTest.__init__(self)
     self.test_params = testutils.test_params_get()
Exemplo n.º 15
0
 def tearDown(self):
     if config["log_dir"] != None:
         self.dataplane.stop_pcap()
     BaseTest.tearDown(self)
     self.transport.close()
Exemplo n.º 16
0
 def tearDown(self):
     if config["log_dir"] != None:
         self.dataplane.stop_pcap()
     reset_filters()
     BaseTest.tearDown(self)