Skip to content
Snippets Groups Projects
Commit f9e6c237 authored by Ryan Izard's avatar Ryan Izard
Browse files

Fixed LoadBalancer unit tests! TODO: Need to change the LB to not compose...

Fixed LoadBalancer unit tests! TODO: Need to change the LB to not compose flows with strings...yuck. This will make OF1.0/OF1.1+ support integration easier.
parent ccc14a39
No related branches found
No related tags found
No related merge requests found
...@@ -16,12 +16,10 @@ ...@@ -16,12 +16,10 @@
package net.floodlightcontroller.loadbalancer; package net.floodlightcontroller.loadbalancer;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Comparator; import java.util.Comparator;
import java.util.EnumSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
...@@ -77,7 +75,6 @@ import net.floodlightcontroller.topology.NodePortTuple; ...@@ -77,7 +75,6 @@ import net.floodlightcontroller.topology.NodePortTuple;
import net.floodlightcontroller.util.ActionUtils; import net.floodlightcontroller.util.ActionUtils;
import net.floodlightcontroller.util.FlowModUtils; import net.floodlightcontroller.util.FlowModUtils;
import net.floodlightcontroller.util.MatchUtils; import net.floodlightcontroller.util.MatchUtils;
import net.floodlightcontroller.util.OFMessageDamper;
/** /**
* A simple load balancer module for ping, tcp, and udp flows. This module is accessed * A simple load balancer module for ping, tcp, and udp flows. This module is accessed
...@@ -539,9 +536,9 @@ public class LoadBalancer implements IFloodlightModule, ...@@ -539,9 +536,9 @@ public class LoadBalancer implements IFloodlightModule,
+ MatchUtils.STR_IN_PORT + "="+path.get(i).getPortId().toString(); + MatchUtils.STR_IN_PORT + "="+path.get(i).getPortId().toString();
if (sw.equals(pinSwitch.getId())) { if (sw.equals(pinSwitch.getId())) {
actionString = ActionUtils.STR_NW_SRC_SET + "="+IPv4.fromIPv4Address(vips.get(member.vipId).address)+"," actionString = ActionUtils.STR_FIELD_SET + "=" + MatchUtils.STR_NW_SRC + MatchUtils.SET_FIELD_DELIM + IPv4.fromIPv4Address(vips.get(member.vipId).address)+","
+ ActionUtils.STR_DL_SRC_SET + "="+vips.get(member.vipId).proxyMac.toString()+"," + ActionUtils.STR_FIELD_SET + "=" + MatchUtils.STR_DL_SRC + MatchUtils.SET_FIELD_DELIM + vips.get(member.vipId).proxyMac.toString()+","
+ ActionUtils.STR_OUTPUT + "="+path.get(i+1).getPortId(); + ActionUtils.STR_OUTPUT + "=" + path.get(i+1).getPortId();
} else { } else {
actionString = ActionUtils.STR_OUTPUT + "="+path.get(i+1).getPortId(); actionString = ActionUtils.STR_OUTPUT + "="+path.get(i+1).getPortId();
} }
......
...@@ -29,6 +29,7 @@ import static org.junit.Assert.*; ...@@ -29,6 +29,7 @@ import static org.junit.Assert.*;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -562,6 +563,12 @@ public class LoadBalancerTest extends FloodlightTestCase { ...@@ -562,6 +563,12 @@ public class LoadBalancerTest extends FloodlightTestCase {
// Skip arpRequest2 test - in reality this will happen, but for unit test the same logic // Skip arpRequest2 test - in reality this will happen, but for unit test the same logic
// is already validated with arpRequest1 test above // is already validated with arpRequest1 test above
// //
// Keep the StaticFlowEntryPusher happy with a switch in the switch service
Map<DatapathId, IOFSwitch> switches = new HashMap<DatapathId, IOFSwitch>(1);
switches.put(DatapathId.of(1), sw1);
getMockSwitchService().setSwitches(switches);
// Build icmp packets // Build icmp packets
icmpPacket1 = new Ethernet() icmpPacket1 = new Ethernet()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment