Same thing as before
diff --git a/ofdpa/flows.py b/ofdpa/flows.py
index 00e8587..675b1f9 100755
--- a/ofdpa/flows.py
+++ b/ofdpa/flows.py
@@ -560,31 +560,30 @@
intf_src_mac=[0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
dst_mac=[0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
dip=0xc0a80001
- index=1
+ #Hashes Test Name and uses it as id for installing unique groups
+ class_id=abs(hash(inspect.stack()[0][3])) % (256)
ports = config["port_map"].keys()
for port in ports:
#add l2 interface group
+ id=port+class_id<<8
vlan_id=port
l2_gid, l2_msg = add_one_l2_interface_group(self.controller, port, vlan_id, True, True)
dst_mac[5]=vlan_id
#add MPLS interface group
- mpls_gid, mpls_msg = add_mpls_intf_group(self.controller, l2_gid, dst_mac, intf_src_mac, vlan_id, port)
+ mpls_gid, mpls_msg = add_mpls_intf_group(self.controller, l2_gid, dst_mac, intf_src_mac, vlan_id, id)
#add MPLS L3 VPN group
mpls_label_gid, mpls_label_msg = add_mpls_label_group(self.controller, subtype=OFDPA_MPLS_GROUP_SUBTYPE_L3_VPN_LABEL,
- index=port, ref_gid= mpls_gid, push_mpls_header=True, set_mpls_label=port, set_bos=1, set_ttl=32)
- ecmp_msg=add_l3_ecmp_group(self.controller, vlan_id, [mpls_label_gid])
+ index=id, ref_gid= mpls_gid, push_mpls_header=True, set_mpls_label=port, set_bos=1, set_ttl=32)
+ ecmp_msg=add_l3_ecmp_group(self.controller, id, [mpls_label_gid])
do_barrier(self.controller)
#add vlan flow table
- add_one_vlan_table_flow(self.controller, port, vlan_id, vrf=2, flag=VLAN_TABLE_FLAG_ONLY_TAG)
+ add_one_vlan_table_flow(self.controller, port, vlan_id, vrf=0, flag=VLAN_TABLE_FLAG_ONLY_TAG)
#add termination flow
add_termination_flow(self.controller, port, 0x0800, intf_src_mac, vlan_id)
#add routing flow
dst_ip = dip + (vlan_id<<8)
#add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0, mpls_label_gid, vrf=2)
- add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0xffffff00, ecmp_msg.group_id, vrf=2)
- #add entries in the Bridging table to avoid packet-in from mac learning
- group_id = encode_l2_interface_group_id(vlan_id, port)
- add_bridge_flow(self.controller, dst_mac, vlan_id, group_id, True)
+ add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0xffffff00, ecmp_msg.group_id, vrf=0)
do_barrier(self.controller)