Skip to content
Snippets Groups Projects
Commit 3604d8d4 authored by abat's avatar abat
Browse files

Merge into master from pull request #124:

Fix test issue related to duplicate devices (https://github.com/floodlight/floodlight/pull/124)
parents 52cba5d7 58ca3353
No related branches found
No related tags found
No related merge requests found
......@@ -275,7 +275,11 @@ public class Device implements IDevice {
if (prev != null &&
!(dpid.equals(prev.getSwitchDPID()) &&
port.equals(prev.getSwitchPort()))) {
port.equals(prev.getSwitchPort())) &&
!topology.isInSameBroadcastDomain(dpid.longValue(),
port.shortValue(),
prev.getSwitchDPID().longValue(),
prev.getSwitchPort().shortValue())) {
long curActive =
deviceManager.apComparator.
getEffTS(cur, cur.getActiveSince());
......
......@@ -415,6 +415,8 @@ public class DeviceManagerImplTest extends FloodlightTestCase {
andReturn(10L).anyTimes();
expect(mockTopology.isBroadcastDomainPort(anyLong(), anyShort())).
andReturn(false).anyTimes();
expect(mockTopology.isInSameBroadcastDomain(anyLong(), anyShort(),
anyLong(), anyShort())).andReturn(false).anyTimes();
expect(mockTopology.isInternal(anyLong(),
anyShort())).andReturn(false).anyTimes();
......@@ -499,6 +501,10 @@ public class DeviceManagerImplTest extends FloodlightTestCase {
andReturn(false).anyTimes();
expect(mockTopology.isBroadcastDomainPort(1L, (short)2)).
andReturn(true).anyTimes();
expect(mockTopology.isInSameBroadcastDomain(1L, (short)1,
1L, (short)2)).andReturn(true).anyTimes();
expect(mockTopology.isInSameBroadcastDomain(1L, (short)2,
1L, (short)1)).andReturn(true).anyTimes();
replay(mockTopology);
......@@ -717,6 +723,8 @@ public class DeviceManagerImplTest extends FloodlightTestCase {
expect(mockTopology.isBroadcastDomainPort(anyLong(),
anyShort())).
andReturn(false).anyTimes();
expect(mockTopology.isInSameBroadcastDomain(anyLong(), anyShort(),
anyLong(), anyShort())).andReturn(false).anyTimes();
expect(mockTopology.getSwitchClusterId(anyLong())).
andReturn(1L).anyTimes();
replay(mockTopology);
......@@ -809,6 +817,8 @@ public class DeviceManagerImplTest extends FloodlightTestCase {
expect(mockTopology.isBroadcastDomainPort(anyLong(),
anyShort())).
andReturn(false).anyTimes();
expect(mockTopology.isInSameBroadcastDomain(anyLong(), anyShort(),
anyLong(), anyShort())).andReturn(false).anyTimes();
expect(mockTopology.getSwitchClusterId(1L)).
andReturn(1L).anyTimes();
expect(mockTopology.getSwitchClusterId(5L)).
......
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