additional changes
diff --git a/olt.py b/olt.py
index 843f92f..27858b0 100644
--- a/olt.py
+++ b/olt.py
@@ -13,7 +13,7 @@
from oftest.testutils import *
onu_port = test_param_get("onu_port", 130)
-onu_port2 = test_param_get("onu_port2", 131)
+onu_port2 = test_param_get("onu_port2", 130)
olt_port = test_param_get("olt_port", 258)
def double_vlan_udp_packet(pktlen=100,
@@ -117,7 +117,13 @@
ether = scapy.Ether(src="00:01:02:03:04:05")
ip = scapy.IP(src="1.2.3.4")
payload.igmpize(ip, ether)
- return ether / ip / payload
+ pkt = ether / ip / payload
+ if len(pkt) < 60:
+ pad_len = 60 - len(pkt)
+ pad = scapy.PAD()
+ pad.load = '\x00' * pad_len
+ pkt = pkt / pad
+ return pkt
class EapolPacketIn(base_tests.SimpleDataPlane):
@@ -133,21 +139,6 @@
testPacketIn(self, match, pkt)
-class ARPPacketIn(base_tests.SimpleDataPlane):
-
- """Verify packet-ins are sent for ARP packets """
-
- def runTest(self):
- logging.info("Running ARP Packet In test")
-
- match = ofp.match()
- match.oxm_list.append(ofp.oxm.eth_type(0x0806))
-
- # Use ethertype 0x0806
- pkt = simple_eth_packet(eth_type=0x0806)
-
- testPacketIn(self, match, pkt)
-
class IGMPPacketIn(base_tests.SimpleDataPlane):
"""Verify packet-ins are sent for IGMP packets """
@@ -178,7 +169,7 @@
msg = ofp.message.packet_out()
msg.in_port = ofp.OFPP_CONTROLLER
- #msg.buffer_id = 0xffffffff
+ msg.buffer_id = 0xffffffff
msg.data = str(pkt)
msg.actions = [ofp.action.output(
port=onu_port,
@@ -195,7 +186,7 @@
def runTest(self):
logging.info("Running Meter tests")
- dropMeterBand = ofp.meter_band.drop(rate = 64)
+ dropMeterBand = ofp.meter_band.drop(rate = 640)
meter_mod = ofp.message.meter_mod(xid = 1, command = ofp.OFPMC_ADD, meter_id = 1, meters = [ dropMeterBand ])
self.controller.message_send(meter_mod)
@@ -253,9 +244,9 @@
#self.dataplane.send(olt_port, str(inPkt))
#verify_packet(self, inPkt, onu_port)
# upstream
- for i in range(1,400):
- self.dataplane.send(onu_port, str(inPkt))
- verify_packet(self, inPkt, olt_port)
+ #for i in range(1,400):
+ # self.dataplane.send(onu_port, str(inPkt))
+ #verify_packet(self, inPkt, olt_port)
# clean up the test
meter_mod = ofp.message.meter_mod(xid = 2, command = ofp.OFPMC_DELETE, meter_id = 1)
@@ -338,7 +329,8 @@
self.controller.message_send(request)
do_barrier(self.controller)
time.sleep(5)
-
+
+
inPkt = simple_udp_packet(dl_vlan_enable=True, vlan_vid=0, vlan_pcp=0)
outPkt = simple_udp_packet(pktlen=100, dl_vlan_enable=True,
vlan_vid=vlan_id, vlan_pcp=0, dl_vlan_cfi=0)
@@ -368,7 +360,7 @@
for portNum in ports:
buckets.append(ofp.common.bucket(watch_port=ofp.OFPP_ANY, watch_group=ofp.OFPG_ANY,
- actions=[ofp.action.output(port=portNum)]))
+ actions=[ofp.action.pop_vlan(), ofp.action.output(port=portNum)]))
group_add = ofp.message.group_add(group_type = ofp.OFPGT_ALL, group_id=group_id, buckets=buckets)
@@ -578,7 +570,7 @@
def runTest(self):
logging.info("Running Group datapath forwarding tests")
delete_all_flows(self.controller)
- #delete_all_groups(self.controller)
+ delete_all_groups(self.controller)
vlan_id = 201
@@ -688,7 +680,7 @@
outPkt = inPkt
self.dataplane.send(olt_port, str(inPkt))
verify_packet(self, outPkt, onu_port)
- #verify_packet(self, outPkt, onu_port2)
+ verify_packet(self, outPkt, onu_port2)
# Now remove onu port 1 from the group and test that the input packet is no longer forwarded to onu port 1
group_mod = createAllGroupMod(test_group_id, ports=[onu_port2])
@@ -760,13 +752,12 @@
time.sleep(2)
inPkt = simple_udp_packet(dl_vlan_enable=True, vlan_vid=vlan_id, vlan_pcp=0)
- # downstream
- self.dataplane.send(olt_port, str(inPkt))
- verify_packet(self, inPkt, onu_port)
# upstream
self.dataplane.send(onu_port, str(inPkt))
verify_packet(self, inPkt, olt_port)
-
+ # downstream
+ self.dataplane.send(olt_port, str(inPkt))
+ verify_packet(self, inPkt, onu_port)
# clean up the test
delete_all_flows(self.controller)