diff --git a/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java b/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java index 315777ff5dccbfdfba0f07c52962ffc88e137fcc..c89791326d16ac83ad2b9e90116a57796ce6927a 100644 --- a/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java +++ b/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java @@ -16,12 +16,10 @@ package net.floodlightcontroller.loadbalancer; -import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; -import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -77,7 +75,6 @@ import net.floodlightcontroller.topology.NodePortTuple; import net.floodlightcontroller.util.ActionUtils; import net.floodlightcontroller.util.FlowModUtils; 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 @@ -539,9 +536,9 @@ public class LoadBalancer implements IFloodlightModule, + MatchUtils.STR_IN_PORT + "="+path.get(i).getPortId().toString(); if (sw.equals(pinSwitch.getId())) { - actionString = ActionUtils.STR_NW_SRC_SET + "="+IPv4.fromIPv4Address(vips.get(member.vipId).address)+"," - + ActionUtils.STR_DL_SRC_SET + "="+vips.get(member.vipId).proxyMac.toString()+"," - + ActionUtils.STR_OUTPUT + "="+path.get(i+1).getPortId(); + actionString = ActionUtils.STR_FIELD_SET + "=" + MatchUtils.STR_NW_SRC + MatchUtils.SET_FIELD_DELIM + IPv4.fromIPv4Address(vips.get(member.vipId).address)+"," + + 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(); } else { actionString = ActionUtils.STR_OUTPUT + "="+path.get(i+1).getPortId(); } diff --git a/src/test/java/net/floodlightcontroller/loadbalancer/LoadBalancerTest.java b/src/test/java/net/floodlightcontroller/loadbalancer/LoadBalancerTest.java index 132e991218e98231643b7e06a46d18ddd8914d8d..b15dc9e60e5e7b4ddaf30f79b7c36cb204c6aea5 100644 --- a/src/test/java/net/floodlightcontroller/loadbalancer/LoadBalancerTest.java +++ b/src/test/java/net/floodlightcontroller/loadbalancer/LoadBalancerTest.java @@ -29,6 +29,7 @@ import static org.junit.Assert.*; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -562,6 +563,12 @@ public class LoadBalancerTest extends FloodlightTestCase { // Skip arpRequest2 test - in reality this will happen, but for unit test the same logic // 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 icmpPacket1 = new Ethernet()