示例#1
0
    def runTest(self):
        queue_id = QUEUE_ID
        sup_acts = supported_actions_get(self)
        if not (sup_acts & 1<<ofp.OFPAT_SET_QUEUE):
            skip_message_emit(self, "Forward to queue test")
            return
        of_ports = pa_port_map.keys()
        of_ports.sort()
        self.assertTrue(len(of_ports) > 2, "Not enough ports for test")

        pkt = simple_tcp_packet(pktlen = 100)
        queue_act = action.action_set_queue()
        queue_act.queue_id = queue_id
        flow_match_test_port_pair(parent=self, ing_port=of_ports[0], egr_port=of_ports[1], pkt=pkt, exp_pkt=pkt, apply_action_list = [queue_act])


        stat_req = message.queue_stats_request()
        stat_req.port_no = ofp.OFPP_ANY
        stat_req.queue_id = ofp.OFPQ_ALL

        pa_logger.info("Sending stats request")
        do_barrier(self.controller)

        (response, raw) = self.controller.transact(stat_req)
        self.assertTrue(response,"Got no queue stats reply")
        queue_stats = response.stats[0]
        self.assertTrue(queue_stats.tx_bytes == 100,"Queue Stats Incorrect")
示例#2
0
    def runTest(self):
        queue_id = QUEUE_ID
        sup_acts = supported_actions_get(self)
        if not (sup_acts & 1 << ofp.OFPAT_SET_QUEUE):
            skip_message_emit(self, "Forward to queue test")
            return
        of_ports = pa_port_map.keys()
        of_ports.sort()
        self.assertTrue(len(of_ports) > 2, "Not enough ports for test")

        pkt = simple_tcp_packet(pktlen=100)
        queue_act = action.action_set_queue()
        queue_act.queue_id = queue_id
        flow_match_test_port_pair(parent=self,
                                  ing_port=of_ports[0],
                                  egr_port=of_ports[1],
                                  pkt=pkt,
                                  exp_pkt=pkt,
                                  apply_action_list=[queue_act])

        stat_req = message.queue_stats_request()
        stat_req.port_no = ofp.OFPP_ANY
        stat_req.queue_id = ofp.OFPQ_ALL

        pa_logger.info("Sending stats request")
        do_barrier(self.controller)

        (response, raw) = self.controller.transact(stat_req)
        self.assertTrue(response, "Got no queue stats reply")
        queue_stats = response.stats[0]
        self.assertTrue(queue_stats.tx_bytes == 100, "Queue Stats Incorrect")
示例#3
0
 def runTest(self):
     queue_id = QUEUE_ID
     sup_acts = supported_actions_get(self)
     if not (sup_acts & 1<<ofp.OFPAT_SET_QUEUE):
         skip_message_emit(self, "Forward to queue test")
         return
     
     pkt = simple_tcp_packet(pktlen = 100)
     queue_act = action.action_set_queue()
     queue_act.queue_id = queue_id
     flow_match_test(self, pa_port_map, pkt=pkt, apply_action_list = [queue_act])
示例#4
0
    def runTest(self):
        queue_id = QUEUE_ID
        sup_acts = supported_actions_get(self)
        if not (sup_acts & 1 << ofp.OFPAT_SET_QUEUE):
            skip_message_emit(self, "Forward to queue test")
            return

        pkt = simple_tcp_packet(pktlen=100)
        queue_act = action.action_set_queue()
        queue_act.queue_id = queue_id
        flow_match_test(self,
                        pa_port_map,
                        pkt=pkt,
                        apply_action_list=[queue_act])