Modified Vlan support test
diff --git a/ofdpa/README.md b/ofdpa/README.md
index d3e90b5..cd6204a 100644
--- a/ofdpa/README.md
+++ b/ofdpa/README.md
@@ -8,13 +8,17 @@
The following test cases are implemented:
-Flow Test
-1) PacketInSrcMacMiss
-2) L2FloodTagged
-3) L2Flood Tagged Unknown Src
-4) L2 Unicast Tagged
-5) L3 Unicast Tagged
-6) MTU 1500
-7) MTU 4100
-8) MTU 4500
+The following tests are being done here
+1. PacketInSrcMacMiss
+2. VlanSupport
+3. L2FloodQinQ
+4. L2FloodTagged
+5. L2Flood Tagged Unknown Src
+6. L2 Unicast Tagged
+7. MTU 1500
+8. MTU 4100
+9. MTU 4500
+10. L3UnicastTagged
+11. L3VPNMPLS
+12. MPLS Termination
diff --git a/ofdpa/accton_util.py b/ofdpa/accton_util.py
index 342800c..338ab91 100755
--- a/ofdpa/accton_util.py
+++ b/ofdpa/accton_util.py
@@ -569,8 +569,10 @@
def add_bridge_flow(ctrl, dst_mac, vlanid, group_id, send_barrier=False):
match = ofp.match()
+ priority=1000
if dst_mac!=None:
match.oxm_list.append(ofp.oxm.eth_dst(dst_mac))
+ priority=2000
match.oxm_list.append(ofp.oxm.vlan_vid(0x1000+vlanid))
@@ -585,7 +587,7 @@
ofp.instruction.goto_table(60)
],
buffer_id=ofp.OFP_NO_BUFFER,
- priority=1000)
+ priority=priority)
logging.info("Inserting Brdige flow vlan %d, mac %s", vlanid, dst_mac)
ctrl.message_send(request)
diff --git a/ofdpa/onos.py b/ofdpa/onos.py
index 02cd550..caac2d5 100644
--- a/ofdpa/onos.py
+++ b/ofdpa/onos.py
@@ -53,9 +53,9 @@
class VlanSupport(base_tests.SimpleDataPlane):
"""
- Test L2 forwarding of both, untagged and tagged packets
+ Test L2 forwarding of both, untagged and double-tagged packets
Sends a packet and expects the same packet on the other port
- Repeats for tagged
+ Repeats for double tagged
"""
def runTest(self):
delete_all_flows(self.controller)
@@ -64,16 +64,15 @@
# group table
# set up untag groups for each port
add_l2_interface_grouop(self.controller, config["port_map"].keys(), 4093, False, 1)
- #set up tagged groups
- add_l2_interface_grouop(self.controller, config["port_map"].keys(), 300, True, 1)
for port in ports:
add_one_vlan_table_flow(self.controller, port, 4093, flag=VLAN_TABLE_FLAG_ONLY_BOTH)
group_id = encode_l2_interface_group_id(4093, port)
add_bridge_flow(self.controller, [0x00, 0x12, 0x34, 0x56, 0x78, port], 4093, group_id, True)
#add flow match for vlan 300
+ add_one_l2_interface_group(self.controller, port, 300, True, False)
add_one_vlan_table_flow(self.controller, port, 300, flag=VLAN_TABLE_FLAG_ONLY_TAG)
- group_id = encode_l2_interface_group_id(300, port)
- add_bridge_flow(self.controller, [0x00, 0x12, 0x34, 0x56, 0x78, port], 300, group_id, True)
+ msg=add_l2_flood_group(self.controller, ports, 300, 1)
+ add_bridge_flow(self.controller, None, 300, msg.group_id, True)
do_barrier(self.controller)
for out_port in ports:
@@ -98,8 +97,9 @@
verify_no_packet(self, pkt, ofport)
verify_no_other_packets(self)
- # sends a tagged packet
- parsed_pkt = simple_tcp_packet(dl_vlan_enable=True, vlan_vid=300, eth_dst=mac_dst, eth_src=mac_src)
+ # sends a double tagged packet
+ parsed_pkt = simple_tcp_packet_two_vlan(pktlen=108, out_dl_vlan_enable=True, out_vlan_vid=300,
+ in_dl_vlan_enable=True, in_vlan_vid=10, eth_dst='00:12:34:56:78:9a', eth_src=mac_src)
pkt = str(parsed_pkt)
logging.info("OutputExact test, ports %d to %d", in_port, out_port)
self.dataplane.send(in_port, pkt)