ptf/saiqosmap.py [3153:3221]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.test_pfc_to_pg_map_id = [0] * 4
        self.test_tc_to_pg_map_id = [0] * 4
        self.test_pfc_to_queue_map_id = []
        ingress_key_list = [0, 1, 2, 3, 4, 5, 6, 7]
        ingress_tc_list = [0, 1, 2, 3, 4, 5, 6, 7]
        self.qos_dscp_tc_map_id = create_and_verify_qos_map(
            self.client, SAI_QOS_MAP_TYPE_DSCP_TO_TC, ingress_key_list,
            ingress_tc_list)
        self.assertTrue(self.qos_dscp_tc_map_id != 0,
                        "Failed to create qos_map")
        self.dot1_to_tc_map_id = create_and_verify_qos_map(
            self.client, SAI_QOS_MAP_TYPE_DOT1P_TO_TC, ingress_key_list,
            ingress_tc_list)
        self.assertTrue(self.dot1_to_tc_map_id != 0,
                        "Failed to create qos_map")
        self.ppg_list = []
        self.ppg_list = [0] * 8
        p = 0
        for port in [self.port0, self.port1, self.port2, self.port3]:
            self.ppg_list[p] = []
            for ppg_index in range(8):
                ppg = sai_thrift_create_ingress_priority_group(
                    self.client, port, ppg_index)
                self.assertNotEqual(ppg, 0, "Failed to create priority group")
                self.ppg_list[p].append(ppg)
            p += 1
            # verify number of ppg groups
            attr = sai_thrift_get_port_attribute(
                self.client, port, number_of_ingress_priority_groups=True)
            nbr_groups = attr['number_of_ingress_priority_groups']
            ingress_priority_group_list = sai_thrift_u32_list_t(
                count=nbr_groups, uint32list=[])
            attr = sai_thrift_get_port_attribute(
                self.client,
                port,
                ingress_priority_group_list=ingress_priority_group_list)
            self.assertTrue(
                attr['ingress_priority_group_list'].count == nbr_groups,
                "Failed to verify ingress priority groups")
            self.assertTrue(nbr_groups == 8,
                            "Failed to verify ingress priority groups")
        ingress_pfc_prio_list = [0]
        ingress_pg_list = [0]
        self.pfc_to_pg_map_id = [0] * 8
        test_dev_ports = [self.dev_port0, self.dev_port1,
                          self.dev_port2, self.dev_port3]
        for port in range(0, len(test_dev_ports)):
            self.pfc_to_pg_map_id[port] = create_and_verify_qos_map(
                self.client, SAI_QOS_MAP_TYPE_PFC_PRIORITY_TO_PRIORITY_GROUP,
                ingress_pfc_prio_list, ingress_pg_list)
            self.assertTrue(self.pfc_to_pg_map_id[port] != 0,
                            "Failed to create qos_map")
        self.tc_to_pg_map_id = [0] * 8
        ingress_tc_list = [0]
        ingress_pg_list = [0]
        for port in range(0, len(test_dev_ports)):
            self.tc_to_pg_map_id[port] = create_and_verify_qos_map(
                self.client, SAI_QOS_MAP_TYPE_TC_TO_PRIORITY_GROUP,
                ingress_tc_list, ingress_pg_list)
            self.assertTrue(self.tc_to_pg_map_id[port] != 0,
                            "Failed to create qos_map")
        # test default IPv4 frame
        self.ipv4_pkt = simple_tcp_packet(eth_dst=ROUTER_MAC,
                                          eth_src='00:22:22:22:22:22',
                                          ip_dst='10.10.10.11',
                                          ip_src='192.168.0.1',
                                          ip_dscp=0,
                                          ip_id=105,
                                          ip_ttl=64)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ptf/saiqosmap.py [4798:4866]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.test_pfc_to_pg_map_id = [0] * 4
        self.test_tc_to_pg_map_id = [0] * 4
        self.test_pfc_to_queue_map_id = []
        ingress_key_list = [0, 1, 2, 3, 4, 5, 6, 7]
        ingress_tc_list = [0, 1, 2, 3, 4, 5, 6, 7]
        self.qos_dscp_tc_map_id = create_and_verify_qos_map(
            self.client, SAI_QOS_MAP_TYPE_DSCP_TO_TC, ingress_key_list,
            ingress_tc_list)
        self.assertTrue(self.qos_dscp_tc_map_id != 0,
                        "Failed to create qos_map")
        self.dot1_to_tc_map_id = create_and_verify_qos_map(
            self.client, SAI_QOS_MAP_TYPE_DOT1P_TO_TC, ingress_key_list,
            ingress_tc_list)
        self.assertTrue(self.dot1_to_tc_map_id != 0,
                        "Failed to create qos_map")
        self.ppg_list = []
        self.ppg_list = [0] * 8
        p = 0
        for port in [self.port0, self.port1, self.port2, self.port3]:
            self.ppg_list[p] = []
            for ppg_index in range(8):
                ppg = sai_thrift_create_ingress_priority_group(
                    self.client, port, ppg_index)
                self.assertNotEqual(ppg, 0, "Failed to create priority group")
                self.ppg_list[p].append(ppg)
            p += 1
            # verify number of ppg groups
            attr = sai_thrift_get_port_attribute(
                self.client, port, number_of_ingress_priority_groups=True)
            nbr_groups = attr['number_of_ingress_priority_groups']
            ingress_priority_group_list = sai_thrift_u32_list_t(
                count=nbr_groups, uint32list=[])
            attr = sai_thrift_get_port_attribute(
                self.client,
                port,
                ingress_priority_group_list=ingress_priority_group_list)
            self.assertTrue(
                attr['ingress_priority_group_list'].count == nbr_groups,
                "Failed to verify ingress priority groups")
            self.assertTrue(nbr_groups == 8,
                            "Failed to verify ingress priority groups")
        ingress_pfc_prio_list = [0]
        ingress_pg_list = [0]
        self.pfc_to_pg_map_id = [0] * 8
        test_dev_ports = [self.dev_port0, self.dev_port1,
                          self.dev_port2, self.dev_port3]
        for port in range(0, len(test_dev_ports)):
            self.pfc_to_pg_map_id[port] = create_and_verify_qos_map(
                self.client, SAI_QOS_MAP_TYPE_PFC_PRIORITY_TO_PRIORITY_GROUP,
                ingress_pfc_prio_list, ingress_pg_list)
            self.assertTrue(self.pfc_to_pg_map_id[port] != 0,
                            "Failed to create qos_map")
        self.tc_to_pg_map_id = [0] * 8
        ingress_tc_list = [0]
        ingress_pg_list = [0]
        for port in range(0, len(test_dev_ports)):
            self.tc_to_pg_map_id[port] = create_and_verify_qos_map(
                self.client, SAI_QOS_MAP_TYPE_TC_TO_PRIORITY_GROUP,
                ingress_tc_list, ingress_pg_list)
            self.assertTrue(self.tc_to_pg_map_id[port] != 0,
                            "Failed to create qos_map")
        # test default IPv4 frame
        self.ipv4_pkt = simple_tcp_packet(eth_dst=ROUTER_MAC,
                                          eth_src='00:22:22:22:22:22',
                                          ip_dst='10.10.10.11',
                                          ip_src='192.168.0.1',
                                          ip_dscp=0,
                                          ip_id=105,
                                          ip_ttl=64)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



