Skip to content

Commit

Permalink
Create fdb using vlan object id instead of vlan id. (#829)
Browse files Browse the repository at this point in the history
Create fdb using vlan object id instead of vlan id.
  • Loading branch information
MELLANOX-zhichenr authored and lguohan committed Jun 19, 2018
1 parent 739d46b commit 95eb274
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions test/saithrift/tests/saimirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ def runTest(self):
mirror_type=SAI_MIRROR_SESSION_TYPE_LOCAL
mac_action = SAI_PACKET_ACTION_FORWARD
vlan_remote_id = 2
sai_thrift_create_fdb(self.client, vlan_remote_id, mac3, port3, mac_action)
sai_thrift_create_fdb(self.client, vlan_remote_id, mac2, port2, mac_action)

# Put ports under test in VLAN 2
vlan_id = 1
Expand All @@ -57,6 +55,9 @@ def runTest(self):
vlan_member3 = sai_thrift_create_vlan_member(self.client, vlan_remote_oid, port3, SAI_VLAN_TAGGING_MODE_TAGGED)
vlan_member3a = sai_thrift_create_vlan_member(self.client, vlan_oid, port3, SAI_VLAN_TAGGING_MODE_TAGGED)

sai_thrift_create_fdb(self.client, vlan_remote_oid, mac3, port3, mac_action)
sai_thrift_create_fdb(self.client, vlan_remote_oid, mac2, port2, mac_action)

# Remove ports from default VLAN
self.client.sai_thrift_remove_vlan_member(vlan_member1a)
self.client.sai_thrift_remove_vlan_member(vlan_member2a)
Expand Down Expand Up @@ -194,9 +195,6 @@ def runTest(self):
vlan_remote_id = 3
mac_action = SAI_PACKET_ACTION_FORWARD

sai_thrift_create_fdb(self.client, vlan_remote_id, mac3, port3, mac_action)
sai_thrift_create_fdb(self.client, vlan_remote_id, mac2, port2, mac_action)

# Put ports under test in VLAN 3
vlan_id = 1
vlan_oid = sai_thrift_create_vlan(self.client, vlan_id)
Expand All @@ -208,6 +206,9 @@ def runTest(self):
vlan_member3 = sai_thrift_create_vlan_member(self.client, vlan_remote_oid, port3, SAI_VLAN_TAGGING_MODE_TAGGED)
vlan_member3a = sai_thrift_create_vlan_member(self.client, vlan_oid, port3, SAI_VLAN_TAGGING_MODE_TAGGED)

sai_thrift_create_fdb(self.client, vlan_remote_oid, mac3, port3, mac_action)
sai_thrift_create_fdb(self.client, vlan_remote_oid, mac2, port2, mac_action)

# Remove ports from default VLAN
self.client.sai_thrift_remove_vlan_member(vlan_member1a)
self.client.sai_thrift_remove_vlan_member(vlan_member2a)
Expand Down Expand Up @@ -405,9 +406,6 @@ def runTest(self):
vlan_remote_id = 3
mac_action = SAI_PACKET_ACTION_FORWARD

sai_thrift_create_fdb(self.client, vlan_remote_id, mac3, port3, mac_action)
sai_thrift_create_fdb(self.client, vlan_remote_id, mac2, port2, mac_action)

# Put ports under test in VLAN 3
vlan_id = 1
vlan_oid = sai_thrift_create_vlan(self.client, vlan_id)
Expand All @@ -419,6 +417,9 @@ def runTest(self):
vlan_member3 = sai_thrift_create_vlan_member(self.client, vlan_remote_oid, port3, SAI_VLAN_TAGGING_MODE_TAGGED)
vlan_member3a = sai_thrift_create_vlan_member(self.client, vlan_oid, port3, SAI_VLAN_TAGGING_MODE_TAGGED)

sai_thrift_create_fdb(self.client, vlan_remote_oid, mac3, port3, mac_action)
sai_thrift_create_fdb(self.client, vlan_remote_oid, mac2, port2, mac_action)

# Remove ports from default VLAN
self.client.sai_thrift_remove_vlan_member(vlan_member1a)
self.client.sai_thrift_remove_vlan_member(vlan_member2a)
Expand Down Expand Up @@ -607,8 +608,8 @@ def runTest(self):
attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value)
self.client.sai_thrift_set_port_attribute(port1, attr)

sai_thrift_create_fdb(self.client, vlan_id, mac1, port1, mac_action)
sai_thrift_create_fdb(self.client, vlan_id, mac2, port2, mac_action)
sai_thrift_create_fdb(self.client, vlan_oid, mac1, port1, mac_action)
sai_thrift_create_fdb(self.client, vlan_oid, mac2, port2, mac_action)

# setup local mirror session
mirror_type = SAI_MIRROR_SESSION_TYPE_LOCAL
Expand Down Expand Up @@ -720,8 +721,8 @@ def runTest(self):
attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value)
self.client.sai_thrift_set_port_attribute(port1, attr)

sai_thrift_create_fdb(self.client, vlan_id, mac1, port1, mac_action)
sai_thrift_create_fdb(self.client, vlan_id, mac2, port2, mac_action)
sai_thrift_create_fdb(self.client, vlan_oid, mac1, port1, mac_action)
sai_thrift_create_fdb(self.client, vlan_oid, mac2, port2, mac_action)

# setup remote mirror session
mirror_type = SAI_MIRROR_SESSION_TYPE_REMOTE
Expand Down Expand Up @@ -816,8 +817,8 @@ def runTest(self):
attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value)
self.client.sai_thrift_set_port_attribute(port1, attr)

sai_thrift_create_fdb(self.client, vlan_id, mac1, port1, mac_action)
sai_thrift_create_fdb(self.client, vlan_id, mac2, port2, mac_action)
sai_thrift_create_fdb(self.client, vlan_oid, mac1, port1, mac_action)
sai_thrift_create_fdb(self.client, vlan_oid, mac2, port2, mac_action)

# setup enhanced remote mirror session
mirror_type = SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE
Expand Down Expand Up @@ -941,8 +942,8 @@ def runTest(self):
attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value)
self.client.sai_thrift_set_port_attribute(port1, attr)

sai_thrift_create_fdb(self.client, vlan_id, mac1, port1, mac_action)
sai_thrift_create_fdb(self.client, vlan_id, mac2, port2, mac_action)
sai_thrift_create_fdb(self.client, vlan_oid, mac1, port1, mac_action)
sai_thrift_create_fdb(self.client, vlan_oid, mac2, port2, mac_action)

# setup local mirror session
mirror_type = SAI_MIRROR_SESSION_TYPE_LOCAL
Expand Down Expand Up @@ -1027,8 +1028,8 @@ def runTest(self):
attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value)
self.client.sai_thrift_set_port_attribute(port1, attr)

sai_thrift_create_fdb(self.client, vlan_id, mac1, port1, mac_action)
sai_thrift_create_fdb(self.client, vlan_id, mac2, port2, mac_action)
sai_thrift_create_fdb(self.client, vlan_oid, mac1, port1, mac_action)
sai_thrift_create_fdb(self.client, vlan_oid, mac2, port2, mac_action)

# setup enhanced remote mirror session
mirror_type = SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE
Expand Down

0 comments on commit 95eb274

Please sign in to comment.