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")
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")
def vlan_action_support_check(parent): """ Check if the target switch supports particular actions """ sup_acts = pktact.supported_actions_get(parent) # if not(sup_acts & 1<<ofp.OFPAT_POP_VLAN): # sup_pop_vlan = False # else: sup_pop_vlan = True # if not(sup_acts & 1<<ofp.OFPAT_PUSH_VLAN): # sup_push_vlan = False # else: sup_push_vlan = True # if not(sup_acts & 1<<ofp.OFPXMT_OFB_VLAN_VID): # if not(sup_acts & 1<<ofp.OFPAT_SET_FIELD): # sup_set_vlan_vid = False # else: sup_set_vlan_vid = True # if not(sup_acts & 1<<ofp.OFPAT_SET_FIELD): # sup_set_vlan_pcp = False # else: sup_set_vlan_pcp = True return (sup_pop_vlan, sup_push_vlan, sup_set_vlan_vid, sup_set_vlan_pcp)
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])
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])
def mpls_action_support_check(parent): sup_acts = pktact.supported_actions_get(parent) sup_mpls_act = {} if (sup_acts & 1<<ofp.OFPAT_COPY_TTL_IN): sup_mpls_act['sup_copy_ttl_in'] = True if (sup_acts & 1<<ofp.OFPAT_COPY_TTL_OUT): sup_mpls_act['sup_copy_ttl_out'] = True if (sup_acts & 1<<ofp.OFPAT_SET_MPLS_LABEL): sup_mpls_act['sup_set_mpls_label'] = True if (sup_acts & 1<<ofp.OFPAT_SET_MPLS_TC): sup_mpls_act['sup_set_mpls_tc'] = True if (sup_acts & 1<<ofp.OFPAT_SET_MPLS_TTL): sup_mpls_act['sup_set_mpls_ttl'] = True if (sup_acts & 1<<ofp.OFPAT_DEC_MPLS_TTL): sup_mpls_act['sup_dec_mpls_ttl'] = True if (sup_acts & 1<<ofp.OFPAT_PUSH_MPLS): sup_mpls_act['sup_push_mpls'] = True if (sup_acts & 1<<ofp.OFPAT_POP_MPLS): sup_mpls_act['sup_pop_mpls'] = True return sup_mpls_act
def mpls_action_support_check(parent): sup_acts = pktact.supported_actions_get(parent) sup_mpls_act = {} if (sup_acts & 1 << ofp.OFPAT_COPY_TTL_IN): sup_mpls_act['sup_copy_ttl_in'] = True if (sup_acts & 1 << ofp.OFPAT_COPY_TTL_OUT): sup_mpls_act['sup_copy_ttl_out'] = True if (sup_acts & 1 << ofp.OFPAT_SET_MPLS_LABEL): sup_mpls_act['sup_set_mpls_label'] = True if (sup_acts & 1 << ofp.OFPAT_SET_MPLS_TC): sup_mpls_act['sup_set_mpls_tc'] = True if (sup_acts & 1 << ofp.OFPAT_SET_MPLS_TTL): sup_mpls_act['sup_set_mpls_ttl'] = True if (sup_acts & 1 << ofp.OFPAT_DEC_MPLS_TTL): sup_mpls_act['sup_dec_mpls_ttl'] = True if (sup_acts & 1 << ofp.OFPAT_PUSH_MPLS): sup_mpls_act['sup_push_mpls'] = True if (sup_acts & 1 << ofp.OFPAT_POP_MPLS): sup_mpls_act['sup_pop_mpls'] = True return sup_mpls_act