def setUp()

in ptf/saivlan.py [0:0]


    def setUp(self):
        super(L2VlanTest, self).setUp()

        self.pkt = 0
        self.tagged_pkt = 0
        self.arp_resp = 0
        self.tagged_arp_resp = 0
        self.i_pkt_count = 0
        self.e_pkt_count = 0
        self.mac0 = '00:11:11:11:11:11:11'
        self.mac1 = '00:22:22:22:22:22:22'
        self.mac2 = '00:33:33:33:33:33:33'
        self.mac3 = '00:44:44:44:44:44:44'
        mac_action = SAI_PACKET_ACTION_FORWARD

        self.port24_bp = sai_thrift_create_bridge_port(
            self.client,
            bridge_id=self.default_1q_bridge,
            port_id=self.port24,
            type=SAI_BRIDGE_PORT_TYPE_PORT,
            admin_state=True)
        self.port25_bp = sai_thrift_create_bridge_port(
            self.client,
            bridge_id=self.default_1q_bridge,
            port_id=self.port25,
            type=SAI_BRIDGE_PORT_TYPE_PORT,
            admin_state=True)
        self.port26_bp = sai_thrift_create_bridge_port(
            self.client,
            bridge_id=self.default_1q_bridge,
            port_id=self.port26,
            type=SAI_BRIDGE_PORT_TYPE_PORT,
            admin_state=True)
        self.port27_bp = sai_thrift_create_bridge_port(
            self.client,
            bridge_id=self.default_1q_bridge,
            port_id=self.port27,
            type=SAI_BRIDGE_PORT_TYPE_PORT,
            admin_state=True)
        self.port28_bp = sai_thrift_create_bridge_port(
            self.client,
            bridge_id=self.default_1q_bridge,
            port_id=self.port28,
            type=SAI_BRIDGE_PORT_TYPE_PORT,
            admin_state=True)
        self.port29_bp = sai_thrift_create_bridge_port(
            self.client,
            bridge_id=self.default_1q_bridge,
            port_id=self.port29,
            type=SAI_BRIDGE_PORT_TYPE_PORT,
            admin_state=True)
        self.port30_bp = sai_thrift_create_bridge_port(
            self.client,
            bridge_id=self.default_1q_bridge,
            port_id=self.port30,
            type=SAI_BRIDGE_PORT_TYPE_PORT,
            admin_state=True)
        self.port31_bp = sai_thrift_create_bridge_port(
            self.client,
            bridge_id=self.default_1q_bridge,
            port_id=self.port31,
            type=SAI_BRIDGE_PORT_TYPE_PORT,
            admin_state=True)

        self.vlan10_member3 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan10,
            bridge_port_id=self.port24_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_UNTAGGED)
        self.vlan10_member4 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan10,
            bridge_port_id=self.port25_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)

        sai_thrift_set_port_attribute(
            self.client, self.port24, port_vlan_id=10)

        self.fdb_entry0 = sai_thrift_fdb_entry_t(
            switch_id=self.switch_id, mac_address=self.mac0, bv_id=self.vlan10)
        sai_thrift_create_fdb_entry(
            self.client,
            self.fdb_entry0,
            type=SAI_FDB_ENTRY_TYPE_STATIC,
            bridge_port_id=self.port0_bp,
            packet_action=mac_action)
        self.fdb_entry1 = sai_thrift_fdb_entry_t(
            switch_id=self.switch_id, mac_address=self.mac1, bv_id=self.vlan10)
        sai_thrift_create_fdb_entry(
            self.client,
            self.fdb_entry1,
            type=SAI_FDB_ENTRY_TYPE_STATIC,
            bridge_port_id=self.port1_bp,
            packet_action=mac_action)
        self.fdb_entry24 = sai_thrift_fdb_entry_t(
            switch_id=self.switch_id, mac_address=self.mac2, bv_id=self.vlan10)
        sai_thrift_create_fdb_entry(
            self.client,
            self.fdb_entry24,
            type=SAI_FDB_ENTRY_TYPE_STATIC,
            bridge_port_id=self.port24_bp,
            packet_action=mac_action)
        self.fdb_entry25 = sai_thrift_fdb_entry_t(
            switch_id=self.switch_id, mac_address=self.mac3, bv_id=self.vlan10)
        sai_thrift_create_fdb_entry(
            self.client,
            self.fdb_entry25,
            type=SAI_FDB_ENTRY_TYPE_STATIC,
            bridge_port_id=self.port25_bp,
            packet_action=mac_action)

        self.lag10 = sai_thrift_create_lag(self.client)
        self.lag_mbr31 = sai_thrift_create_lag_member(
            self.client, lag_id=self.lag10, port_id=self.port28)

        self.lag11 = sai_thrift_create_lag(self.client)
        self.lag_mbr41 = sai_thrift_create_lag_member(
            self.client, lag_id=self.lag11, port_id=self.port29)

        self.lag10_bp = sai_thrift_create_bridge_port(
            self.client,
            bridge_id=self.default_1q_bridge,
            port_id=self.lag10,
            type=SAI_BRIDGE_PORT_TYPE_PORT,
            admin_state=True)
        self.lag11_bp = sai_thrift_create_bridge_port(
            self.client,
            bridge_id=self.default_1q_bridge,
            port_id=self.lag11,
            type=SAI_BRIDGE_PORT_TYPE_PORT,
            admin_state=True)

        # vlan40
        self.vlan40 = sai_thrift_create_vlan(self.client, vlan_id=40)
        self.vlan_member41 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan40,
            bridge_port_id=self.port26_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_UNTAGGED)
        self.vlan_member42 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan40,
            bridge_port_id=self.port27_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)
        self.vlan_member43 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan40,
            bridge_port_id=self.lag10_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)
        self.vlan_member44 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan40,
            bridge_port_id=self.lag11_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)

        # vlan50
        self.vlan50 = sai_thrift_create_vlan(self.client, vlan_id=50)
        self.vlan_member51 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan50,
            bridge_port_id=self.port26_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)
        self.vlan_member52 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan50,
            bridge_port_id=self.port27_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_UNTAGGED)
        self.vlan_member53 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan50,
            bridge_port_id=self.lag10_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)
        self.vlan_member54 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan50,
            bridge_port_id=self.lag11_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)

        # vlan60
        self.vlan60 = sai_thrift_create_vlan(self.client, vlan_id=60)
        self.vlan_member61 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan60,
            bridge_port_id=self.port26_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)
        self.vlan_member62 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan60,
            bridge_port_id=self.port27_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)
        self.vlan_member63 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan60,
            bridge_port_id=self.lag10_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_UNTAGGED)
        self.vlan_member64 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan60,
            bridge_port_id=self.lag11_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)

        # vlan70
        self.vlan70 = sai_thrift_create_vlan(self.client, vlan_id=70)
        self.vlan_member71 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan70,
            bridge_port_id=self.port26_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)
        self.vlan_member72 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan70,
            bridge_port_id=self.port27_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)
        self.vlan_member73 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan70,
            bridge_port_id=self.lag10_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_TAGGED)
        self.vlan_member74 = sai_thrift_create_vlan_member(
            self.client,
            vlan_id=self.vlan70,
            bridge_port_id=self.lag11_bp,
            vlan_tagging_mode=SAI_VLAN_TAGGING_MODE_UNTAGGED)