Avoid using reserved MPLS label in test case
Change-Id: Id2c44015f1bdf5440d5443081154319e5dcb010a
diff --git a/ofdpa/flows.py b/ofdpa/flows.py
index 0033468..2413d81 100755
--- a/ofdpa/flows.py
+++ b/ofdpa/flows.py
@@ -1164,12 +1164,15 @@
# Assigns unique hardcoded test_id to make sure tests don't overlap when writing rules
ports = config["port_map"].keys()
for port in ports:
+ # Shift MPLS label and VLAN ID by 16 to avoid reserved values
+ vlan_id = port + 16
+ mpls_label = port + 16
+
# add l2 interface group
id = port
- vlan_id = id
l2_gid, l2_msg = add_one_l2_interface_group(self.controller, port,
vlan_id, True, False)
- dst_mac[5] = vlan_id
+ dst_mac[5] = port
# add L3 Unicast group
l3_msg = add_l3_unicast_group(self.controller, port, vlanid=vlan_id,
id=id, src_mac=intf_src_mac,
@@ -1182,7 +1185,7 @@
# add termination flow
add_termination_flow(self.controller, port, 0x8847, intf_src_mac,
vlan_id, goto_table=24)
- add_mpls_flow(self.controller, ecmp_msg.group_id, port)
+ add_mpls_flow(self.controller, ecmp_msg.group_id, mpls_label)
Groups._put(l2_gid)
Groups._put(l3_msg.group_id)
Groups._put(ecmp_msg.group_id)
@@ -1194,11 +1197,16 @@
for out_port in ports:
if in_port == out_port:
continue
- ip_dst = '192.168.%02d.1' % (out_port)
- label = (out_port, 0, 1, 32)
+ # Shift MPLS label and VLAN ID by 16 to avoid reserved values
+ out_mpls_label = out_port + 16
+ in_vlan_vid = in_port + 16
+ out_vlan_vid = out_port + 16
+
+ ip_dst = '192.168.%02d.1' % (out_port)
+ label = (out_mpls_label, 0, 1, 32)
parsed_pkt = mpls_packet(pktlen=104, dl_vlan_enable=True,
- vlan_vid=(in_port), ip_src=ip_src,
+ vlan_vid=(in_vlan_vid), ip_src=ip_src,
ip_dst=ip_dst, eth_dst=switch_mac,
label=[label])
pkt = str(parsed_pkt)
@@ -1207,7 +1215,7 @@
# build expect packet
mac_dst = '00:00:00:22:22:%02X' % (out_port)
exp_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
- vlan_vid=(out_port),
+ vlan_vid=(out_vlan_vid),
eth_dst=mac_dst, eth_src=switch_mac,
ip_ttl=31, ip_src=ip_src,
ip_dst=ip_dst)