blob: d6c00438e47fc822a1fda9c66867123edd7d00db [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001/**
Ray Milkey269ffb92014-04-03 14:43:30 -07002 * Copyright 2011, Big Switch Networks, Inc.
3 * Originally created by David Erickson, Stanford University
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may
6 * not use this file except in compliance with the License. You may obtain
7 * a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations
15 * under the License.
16 **/
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080017
Jonathan Hart284e70f2014-07-05 12:32:51 -070018package net.onrc.onos.core.linkdiscovery;
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080019
Jonathan Hart2fa28062013-11-25 20:16:28 -080020import static org.easymock.EasyMock.createNiceMock;
21import static org.easymock.EasyMock.expect;
22import static org.easymock.EasyMock.replay;
23import static org.easymock.EasyMock.verify;
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080024
srikanth9f383342014-06-12 11:49:00 -070025import java.io.IOException;
Jonathan Hart2fa28062013-11-25 20:16:28 -080026import java.util.Collections;
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080027import java.util.HashMap;
28import java.util.Map;
29
srikanth9f383342014-06-12 11:49:00 -070030import net.floodlightcontroller.core.FloodlightContext;
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080031import net.floodlightcontroller.core.IFloodlightProviderService;
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080032import net.floodlightcontroller.core.IOFSwitch;
33import net.floodlightcontroller.core.module.FloodlightModuleContext;
34import net.floodlightcontroller.core.test.MockThreadPoolService;
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080035import net.floodlightcontroller.restserver.IRestApiService;
36import net.floodlightcontroller.restserver.RestApiServer;
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080037import net.floodlightcontroller.test.FloodlightTestCase;
38import net.floodlightcontroller.threadpool.IThreadPoolService;
Jonathan Hartcd1ab172014-07-03 14:59:48 -070039import net.onrc.onos.core.registry.IControllerRegistryService;
Jonathan Hart2fa28062013-11-25 20:16:28 -080040
srikanth9f383342014-06-12 11:49:00 -070041import org.easymock.EasyMock;
Jonathan Hart2fa28062013-11-25 20:16:28 -080042import org.junit.Before;
43import org.junit.Test;
srikanth9f383342014-06-12 11:49:00 -070044import org.openflow.protocol.OFMessage;
45import org.openflow.protocol.OFPhysicalPort;
Jonathan Hartcd1ab172014-07-03 14:59:48 -070046import org.openflow.protocol.OFPortStatus;
47import org.openflow.protocol.OFPortStatus.OFPortReason;
Jonathan Hart2fa28062013-11-25 20:16:28 -080048import org.slf4j.Logger;
49import org.slf4j.LoggerFactory;
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080050
Yuta HIGUCHIaa132f52014-06-26 10:18:39 -070051// CHECKSTYLE IGNORE WriteTag FOR NEXT 2 LINES
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080052/**
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080053 * @author David Erickson (daviderickson@cs.stanford.edu)
54 */
55public class LinkDiscoveryManagerTest extends FloodlightTestCase {
56
57 private TestLinkDiscoveryManager ldm;
Yuta HIGUCHI44a0b352014-05-14 21:32:48 -070058 protected static final Logger log = LoggerFactory.getLogger(LinkDiscoveryManagerTest.class);
Ray Milkey269ffb92014-04-03 14:43:30 -070059
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080060 public class TestLinkDiscoveryManager extends LinkDiscoveryManager {
61 public boolean isSendLLDPsCalled = false;
62 public boolean isClearLinksCalled = false;
63
64 @Override
65 protected void discoverOnAllPorts() {
66 isSendLLDPsCalled = true;
67 super.discoverOnAllPorts();
68 }
69
70 public void reset() {
71 isSendLLDPsCalled = false;
72 isClearLinksCalled = false;
73 }
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080074 }
Ray Milkey269ffb92014-04-03 14:43:30 -070075
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080076 public LinkDiscoveryManager getTopology() {
77 return ldm;
78 }
79
80 public IOFSwitch createMockSwitch(Long id) {
81 IOFSwitch mockSwitch = createNiceMock(IOFSwitch.class);
82 expect(mockSwitch.getId()).andReturn(id).anyTimes();
83 return mockSwitch;
84 }
85
Yuta HIGUCHI44a0b352014-05-14 21:32:48 -070086 @Override
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080087 @Before
88 public void setUp() throws Exception {
89 super.setUp();
90 FloodlightModuleContext cntx = new FloodlightModuleContext();
91 ldm = new TestLinkDiscoveryManager();
Jonathan Hart284e70f2014-07-05 12:32:51 -070092 //ldm.linkDiscoveryAware = new ArrayList<ILinkDiscoveryListener>();
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080093 MockThreadPoolService tp = new MockThreadPoolService();
94 RestApiServer restApi = new RestApiServer();
Jonathan Hartcd1ab172014-07-03 14:59:48 -070095 IControllerRegistryService registry =
96 EasyMock.createMock(IControllerRegistryService.class);
97 expect(registry.hasControl(EasyMock.anyLong())).andReturn(true).anyTimes();
98 replay(registry);
99 cntx.addService(IControllerRegistryService.class, registry);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800100 cntx.addService(IRestApiService.class, restApi);
101 cntx.addService(IThreadPoolService.class, tp);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800102 cntx.addService(ILinkDiscoveryService.class, ldm);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800103 cntx.addService(IFloodlightProviderService.class, getMockFloodlightProvider());
104 restApi.init(cntx);
105 tp.init(cntx);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800106 ldm.init(cntx);
107 restApi.startUp(cntx);
108 tp.startUp(cntx);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800109 ldm.startUp(cntx);
110
111 IOFSwitch sw1 = createMockSwitch(1L);
112 IOFSwitch sw2 = createMockSwitch(2L);
113 Map<Long, IOFSwitch> switches = new HashMap<Long, IOFSwitch>();
114 switches.put(1L, sw1);
115 switches.put(2L, sw2);
116 getMockFloodlightProvider().setSwitches(switches);
117 replay(sw1, sw2);
118 }
119
120 @Test
121 public void testAddOrUpdateLink() throws Exception {
122 LinkDiscoveryManager topology = getTopology();
123
124 Link lt = new Link(1L, 2, 2L, 1);
Jonathan Hartcd1ab172014-07-03 14:59:48 -0700125 long firstSeenTime = System.currentTimeMillis();
126 LinkInfo info = new LinkInfo(firstSeenTime,
Jonathan Hartba354e02014-06-30 19:18:16 -0700127 System.currentTimeMillis(), 0, 0);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800128 topology.addOrUpdateLink(lt, info);
129
130
131 NodePortTuple srcNpt = new NodePortTuple(1L, 2);
132 NodePortTuple dstNpt = new NodePortTuple(2L, 1);
133
134 // check invariants hold
135 assertNotNull(topology.switchLinks.get(lt.getSrc()));
136 assertTrue(topology.switchLinks.get(lt.getSrc()).contains(lt));
137 assertNotNull(topology.portLinks.get(srcNpt));
138 assertTrue(topology.portLinks.get(srcNpt).contains(lt));
139 assertNotNull(topology.portLinks.get(dstNpt));
140 assertTrue(topology.portLinks.get(dstNpt).contains(lt));
141 assertTrue(topology.links.containsKey(lt));
Jonathan Hartcd1ab172014-07-03 14:59:48 -0700142
143 LinkInfo infoToVerify = topology.links.get(lt);
144 assertEquals(firstSeenTime, infoToVerify.getFirstSeenTime());
145 assertEquals(0, infoToVerify.getSrcPortState());
146 assertEquals(0, infoToVerify.getDstPortState());
147
148 // Arbitrary new port states to verify that the port state is updated
149 final int newSrcPortState = 1;
150 final int newDstPortState = 2;
151
152 // Update the last received probe timestamp and the port states
153 LinkInfo infoWithStateChange = new LinkInfo(System.currentTimeMillis(),
154 System.currentTimeMillis(), newSrcPortState, newDstPortState);
155
156 topology.addOrUpdateLink(lt, infoWithStateChange);
157
158 assertNotNull(topology.links.get(lt));
159 infoToVerify = topology.links.get(lt);
160 // First seen time should be the original time, not the second update time
161 assertEquals(firstSeenTime, infoToVerify.getFirstSeenTime());
162 // Both port states should have been updated
163 assertEquals(newSrcPortState, infoToVerify.getSrcPortState());
164 assertEquals(newDstPortState, infoToVerify.getDstPortState());
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800165 }
166
167 @Test
168 public void testDeleteLink() throws Exception {
169 LinkDiscoveryManager topology = getTopology();
170
171 Link lt = new Link(1L, 2, 2L, 1);
172 LinkInfo info = new LinkInfo(System.currentTimeMillis(),
Jonathan Hartba354e02014-06-30 19:18:16 -0700173 System.currentTimeMillis(), 0, 0);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800174 topology.addOrUpdateLink(lt, info);
Jonathan Hart284e70f2014-07-05 12:32:51 -0700175 topology.deleteLinks(Collections.singletonList(lt));
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800176
177 // check invariants hold
178 assertNull(topology.switchLinks.get(lt.getSrc()));
179 assertNull(topology.switchLinks.get(lt.getDst()));
180 assertNull(topology.portLinks.get(lt.getSrc()));
181 assertNull(topology.portLinks.get(lt.getDst()));
182 assertTrue(topology.links.isEmpty());
183 }
184
185 @Test
186 public void testAddOrUpdateLinkToSelf() throws Exception {
187 LinkDiscoveryManager topology = getTopology();
188
189 Link lt = new Link(1L, 2, 2L, 3);
190 NodePortTuple srcNpt = new NodePortTuple(1L, 2);
191 NodePortTuple dstNpt = new NodePortTuple(2L, 3);
192
193 LinkInfo info = new LinkInfo(System.currentTimeMillis(),
Jonathan Hartba354e02014-06-30 19:18:16 -0700194 System.currentTimeMillis(), 0, 0);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800195 topology.addOrUpdateLink(lt, info);
196
197 // check invariants hold
198 assertNotNull(topology.switchLinks.get(lt.getSrc()));
199 assertTrue(topology.switchLinks.get(lt.getSrc()).contains(lt));
200 assertNotNull(topology.portLinks.get(srcNpt));
201 assertTrue(topology.portLinks.get(srcNpt).contains(lt));
202 assertNotNull(topology.portLinks.get(dstNpt));
203 assertTrue(topology.portLinks.get(dstNpt).contains(lt));
204 assertTrue(topology.links.containsKey(lt));
205 }
206
207 @Test
208 public void testDeleteLinkToSelf() throws Exception {
209 LinkDiscoveryManager topology = getTopology();
210
211 Link lt = new Link(1L, 2, 1L, 3);
212 NodePortTuple srcNpt = new NodePortTuple(1L, 2);
213 NodePortTuple dstNpt = new NodePortTuple(2L, 3);
214
215 LinkInfo info = new LinkInfo(System.currentTimeMillis(),
Jonathan Hartba354e02014-06-30 19:18:16 -0700216 System.currentTimeMillis(), 0, 0);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800217 topology.addOrUpdateLink(lt, info);
Jonathan Hart284e70f2014-07-05 12:32:51 -0700218 topology.deleteLinks(Collections.singletonList(lt));
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800219
220 // check invariants hold
221 assertNull(topology.switchLinks.get(lt.getSrc()));
222 assertNull(topology.switchLinks.get(lt.getDst()));
223 assertNull(topology.portLinks.get(srcNpt));
224 assertNull(topology.portLinks.get(dstNpt));
225 assertTrue(topology.links.isEmpty());
226 }
227
228 @Test
229 public void testRemovedSwitch() {
230 LinkDiscoveryManager topology = getTopology();
231
232 Link lt = new Link(1L, 2, 2L, 1);
233 NodePortTuple srcNpt = new NodePortTuple(1L, 2);
234 NodePortTuple dstNpt = new NodePortTuple(2L, 1);
235 LinkInfo info = new LinkInfo(System.currentTimeMillis(),
Jonathan Hartba354e02014-06-30 19:18:16 -0700236 System.currentTimeMillis(), 0, 0);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800237 topology.addOrUpdateLink(lt, info);
238
239 IOFSwitch sw1 = getMockFloodlightProvider().getSwitches().get(1L);
240 IOFSwitch sw2 = getMockFloodlightProvider().getSwitches().get(2L);
241 // Mock up our expected behavior
242 topology.removedSwitch(sw1);
243 verify(sw1, sw2);
244
245 // check invariants hold
246 assertNull(topology.switchLinks.get(lt.getSrc()));
247 assertNull(topology.switchLinks.get(lt.getDst()));
248 assertNull(topology.portLinks.get(srcNpt));
249 assertNull(topology.portLinks.get(dstNpt));
250 assertTrue(topology.links.isEmpty());
251 }
252
253 @Test
254 public void testRemovedSwitchSelf() {
255 LinkDiscoveryManager topology = getTopology();
256 IOFSwitch sw1 = createMockSwitch(1L);
257 replay(sw1);
258 Link lt = new Link(1L, 2, 1L, 3);
259 LinkInfo info = new LinkInfo(System.currentTimeMillis(),
Jonathan Hartba354e02014-06-30 19:18:16 -0700260 System.currentTimeMillis(), 0, 0);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800261 topology.addOrUpdateLink(lt, info);
262
263 // Mock up our expected behavior
264 topology.removedSwitch(sw1);
265
266 verify(sw1);
267 // check invariants hold
268 assertNull(topology.switchLinks.get(lt.getSrc()));
269 assertNull(topology.portLinks.get(lt.getSrc()));
270 assertNull(topology.portLinks.get(lt.getDst()));
271 assertTrue(topology.links.isEmpty());
272 }
273
274 @Test
275 public void testAddUpdateLinks() throws Exception {
276 LinkDiscoveryManager topology = getTopology();
277
278 Link lt = new Link(1L, 1, 2L, 1);
279 NodePortTuple srcNpt = new NodePortTuple(1L, 1);
280 NodePortTuple dstNpt = new NodePortTuple(2L, 1);
Ray Milkey269ffb92014-04-03 14:43:30 -0700281
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800282 LinkInfo info;
283
284 info = new LinkInfo(System.currentTimeMillis() - 40000,
Jonathan Hartba354e02014-06-30 19:18:16 -0700285 System.currentTimeMillis() - 40000, 0, 0);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800286 topology.addOrUpdateLink(lt, info);
287
288 // check invariants hold
289 assertNotNull(topology.switchLinks.get(lt.getSrc()));
290 assertTrue(topology.switchLinks.get(lt.getSrc()).contains(lt));
291 assertNotNull(topology.portLinks.get(srcNpt));
292 assertTrue(topology.portLinks.get(srcNpt).contains(lt));
293 assertNotNull(topology.portLinks.get(dstNpt));
294 assertTrue(topology.portLinks.get(dstNpt).contains(lt));
295 assertTrue(topology.links.containsKey(lt));
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800296
Jonathan Hart284e70f2014-07-05 12:32:51 -0700297 topology.timeOutLinks();
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800298
Jonathan Hartba354e02014-06-30 19:18:16 -0700299 // Add a link info based on info that would be obtained from unicast LLDP
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800300 // Setting the unicast LLDP reception time to be 40 seconds old, so we can use
Jonathan Hartcd1ab172014-07-03 14:59:48 -0700301 // this to test timeout after this test.
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800302 info = new LinkInfo(System.currentTimeMillis() - 40000,
Jonathan Hartba354e02014-06-30 19:18:16 -0700303 System.currentTimeMillis() - 40000, 0, 0);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800304 topology.addOrUpdateLink(lt, info);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800305
Jonathan Hartcd1ab172014-07-03 14:59:48 -0700306 // Expect to timeout the unicast Valid Time, so the link should disappear
Jonathan Hart284e70f2014-07-05 12:32:51 -0700307 topology.timeOutLinks();
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800308 assertTrue(topology.links.get(lt) == null);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800309 }
srikanth9f383342014-06-12 11:49:00 -0700310
311 /**
312 * This test case verifies that LinkDiscoveryManager.sendDiscoveryMessage()
Yuta HIGUCHI91a8f502014-06-17 10:15:29 -0700313 * performs "write" operation on the specified IOFSwitch object
314 * with a LLDP packet.
315 *
srikanth9f383342014-06-12 11:49:00 -0700316 * @throws IOException
317 */
318 @Test
Yuta HIGUCHI91a8f502014-06-17 10:15:29 -0700319 public void testSendDiscoveryMessage() throws IOException {
Jonathan Hart299d1132014-06-27 09:25:28 -0700320 byte[] macAddress = new byte[] {0x0, 0x0, 0x0, 0x0, 0x0, 0x1};
321
srikanth9f383342014-06-12 11:49:00 -0700322 LinkDiscoveryManager topology = getTopology();
323
324 // Mock up our expected behavior
325 IOFSwitch swTest = createMockSwitch(3L);
326 getMockFloodlightProvider().getSwitches().put(3L, swTest);
Yuta HIGUCHI91a8f502014-06-17 10:15:29 -0700327
srikanth9f383342014-06-12 11:49:00 -0700328 short portNum = 1;
329 OFPhysicalPort ofpPort = new OFPhysicalPort();
330 ofpPort.setPortNumber(portNum);
Jonathan Hart299d1132014-06-27 09:25:28 -0700331 ofpPort.setHardwareAddress(macAddress);
Yuta HIGUCHI91a8f502014-06-17 10:15:29 -0700332
333 /* sendDiscoverMessage() should perform the following actions on
srikanth9f383342014-06-12 11:49:00 -0700334 * IOFSwitch object
Yuta HIGUCHI91a8f502014-06-17 10:15:29 -0700335 * - getPort() with argument as "1"
336 * - write() with OFPacketOut
337 * - flush()
srikanth9f383342014-06-12 11:49:00 -0700338 */
339 expect(swTest.getPort(portNum)).andReturn(ofpPort).atLeastOnce();
340 swTest.write(EasyMock.anyObject(OFMessage.class), EasyMock.anyObject(FloodlightContext.class));
341 EasyMock.expectLastCall().times(1);
342 swTest.flush();
343 EasyMock.expectLastCall().once();
344 replay(swTest);
Yuta HIGUCHI91a8f502014-06-17 10:15:29 -0700345
Jonathan Hartba354e02014-06-30 19:18:16 -0700346 topology.sendDiscoveryMessage(3L, portNum, false);
Yuta HIGUCHI91a8f502014-06-17 10:15:29 -0700347
srikanth9f383342014-06-12 11:49:00 -0700348 verify(swTest);
349 }
Jonathan Hartcd1ab172014-07-03 14:59:48 -0700350
351 @Test
352 public void testHandlePortStatusForNewPort() throws IOException {
353 byte[] macAddress = new byte[] {0x0, 0x0, 0x0, 0x0, 0x0, 0x1};
354
355 LinkDiscoveryManager linkDiscovery = getTopology();
356
357 long dpid = 3L;
358 IOFSwitch sw = createMockSwitch(dpid);
359 getMockFloodlightProvider().getSwitches().put(dpid, sw);
360
361 short portNum = 1;
362 OFPhysicalPort ofpPort = new OFPhysicalPort();
363 ofpPort.setPortNumber(portNum);
364 ofpPort.setHardwareAddress(macAddress);
365
366 OFPortStatus portStatus = new OFPortStatus();
367 portStatus.setDesc(ofpPort);
368 portStatus.setReason((byte) OFPortReason.OFPPR_ADD.ordinal());
369
370 expect(sw.getPort(portNum)).andReturn(ofpPort).anyTimes();
371 sw.write(EasyMock.anyObject(OFMessage.class),
372 EasyMock.anyObject(FloodlightContext.class));
373 sw.flush();
374
375 replay(sw);
376
377 linkDiscovery.handlePortStatus(sw, portStatus);
378
379 verify(sw);
380 }
381
382 @Test
383 public void testHandlePortStatusForExistingPort() {
384 byte[] macAddress = new byte[] {0x0, 0x0, 0x0, 0x0, 0x0, 0x1};
385
386 LinkDiscoveryManager linkDiscovery = getTopology();
387
388 // Add a link that we can update later during the test
389 Link lt = new Link(1L, 1, 2L, 1);
390 LinkInfo info = new LinkInfo(System.currentTimeMillis(),
391 System.currentTimeMillis(), 0, 0);
392 linkDiscovery.addOrUpdateLink(lt, info);
393
394 short portNum = 1;
395 // src port
396 int srcPortState = 2;
397 OFPhysicalPort srcPort = new OFPhysicalPort();
398 srcPort.setPortNumber(portNum);
399 srcPort.setHardwareAddress(macAddress);
400 srcPort.setState(srcPortState);
401
402 // dst port
403 int dstPortState = 4;
404 OFPhysicalPort dstPort = new OFPhysicalPort();
405 dstPort.setPortNumber(portNum);
406 dstPort.setHardwareAddress(macAddress);
407 dstPort.setState(dstPortState);
408
409 OFPortStatus srcPortStatus = new OFPortStatus();
410 srcPortStatus.setDesc(srcPort);
411 srcPortStatus.setReason((byte) OFPortReason.OFPPR_MODIFY.ordinal());
412
413 OFPortStatus dstPortStatus = new OFPortStatus();
414 dstPortStatus.setDesc(dstPort);
415 dstPortStatus.setReason((byte) OFPortReason.OFPPR_MODIFY.ordinal());
416
417 linkDiscovery.handlePortStatus(
418 getMockFloodlightProvider().getSwitches().get(1L), srcPortStatus);
419
420
421 LinkInfo newInfo = linkDiscovery.links.get(lt);
422 assertEquals(srcPortState, newInfo.getSrcPortState());
423 assertEquals(0, newInfo.getDstPortState());
424
425
426 linkDiscovery.handlePortStatus(
427 getMockFloodlightProvider().getSwitches().get(2L), dstPortStatus);
428
429 newInfo = linkDiscovery.links.get(lt);
430 assertEquals(srcPortState, newInfo.getSrcPortState());
431 assertEquals(dstPortState, newInfo.getDstPortState());
432 }
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -0800433}