Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014-2015 Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
| 5 | * the License. You may obtain a copy of the License at |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
| 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 11 | * specific language governing permissions and limitations under the License. |
| 12 | */ |
| 13 | package org.onosproject.provider.bgp.topology.impl; |
| 14 | |
| 15 | import static org.junit.Assert.assertNotNull; |
| 16 | import static org.junit.Assert.assertNull; |
| 17 | import static org.junit.Assert.assertTrue; |
| 18 | |
| 19 | import java.util.Collection; |
| 20 | import java.util.HashSet; |
| 21 | import java.util.LinkedList; |
| 22 | import java.util.List; |
| 23 | import java.util.Map; |
| 24 | import java.util.Set; |
| 25 | import java.util.concurrent.CopyOnWriteArraySet; |
| 26 | |
| 27 | import org.junit.After; |
| 28 | import org.junit.Before; |
| 29 | import org.junit.Test; |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 30 | import org.onosproject.bgp.controller.BgpCfg; |
| 31 | import org.onosproject.bgp.controller.BgpController; |
| 32 | import org.onosproject.bgp.controller.BgpId; |
| 33 | import org.onosproject.bgp.controller.BgpPeer; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 34 | import org.onosproject.bgp.controller.BgpLinkListener; |
| 35 | import org.onosproject.bgp.controller.BgpNodeListener; |
| 36 | import org.onosproject.bgp.controller.BgpPeerManager; |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 37 | import org.onosproject.bgpio.exceptions.BgpParseException; |
| 38 | import org.onosproject.bgpio.protocol.BgpMessage; |
| 39 | import org.onosproject.bgpio.protocol.linkstate.BgpLinkLSIdentifier; |
| 40 | import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSIdentifier; |
| 41 | import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 42 | import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4; |
| 43 | import org.onosproject.bgpio.protocol.linkstate.NodeDescriptors; |
| 44 | import org.onosproject.bgpio.types.AutonomousSystemTlv; |
| 45 | import org.onosproject.bgpio.types.LinkLocalRemoteIdentifiersTlv; |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 46 | import org.onosproject.bgpio.types.BgpValueType; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 47 | import org.onosproject.bgpio.types.RouteDistinguisher; |
| 48 | import org.onosproject.bgpio.util.Constants; |
| 49 | import org.onosproject.net.ConnectPoint; |
| 50 | import org.onosproject.net.DeviceId; |
| 51 | import org.onosproject.net.MastershipRole; |
| 52 | import org.onosproject.net.device.DeviceDescription; |
| 53 | import org.onosproject.net.device.DeviceProvider; |
| 54 | import org.onosproject.net.device.DeviceProviderRegistry; |
| 55 | import org.onosproject.net.device.DeviceProviderService; |
| 56 | import org.onosproject.net.device.PortDescription; |
| 57 | import org.onosproject.net.device.PortStatistics; |
| 58 | import org.onosproject.net.link.LinkDescription; |
| 59 | import org.onosproject.net.link.LinkProvider; |
| 60 | import org.onosproject.net.link.LinkProviderRegistry; |
| 61 | import org.onosproject.net.link.LinkProviderService; |
| 62 | import org.onosproject.net.provider.ProviderId; |
| 63 | |
| 64 | public class BgpTopologyProviderTest { |
| 65 | |
| 66 | private static final DeviceId DID1 = DeviceId |
| 67 | .deviceId("bgp:bgpls://0:direct:0/&=bgpnodelsidentifier%7bnodedescriptors=nodedescriptors%7bdestype=512," |
| 68 | + "%20deslength=4,%20subtlvs=[autonomoussystemtlv%7btype=512,%20length=4,%20asnum=100%7d]%7d%7d"); |
| 69 | private static final DeviceId DID2 = DeviceId |
| 70 | .deviceId("bgp:bgpls://0:direct:0/&=bgpnodelsidentifier%7bnodedescriptors=nodedescriptors%7bdestype=512," |
| 71 | + "%20deslength=4,%20subtlvs=[autonomoussystemtlv%7btype=512,%20length=4,%20asnum=10%7d]%7d%7d"); |
| 72 | private static final DeviceId DID3 = DeviceId |
| 73 | .deviceId("bgp:bgpls://direct:0/&=nodedescriptors%7bdestype=512,%20deslength=4," |
| 74 | + "%20subtlvs=[autonomoussystemtlv%7btype=512,%20length=4,%20asnum=100%7d]%7d"); |
| 75 | private final BgpTopologyProvider provider = new BgpTopologyProvider(); |
| 76 | private final TestDeviceRegistry nodeRegistry = new TestDeviceRegistry(); |
| 77 | private final TestLinkRegistry linkRegistry = new TestLinkRegistry(); |
| 78 | private final TestController controller = new TestController(); |
| 79 | |
| 80 | @Before |
| 81 | public void startUp() { |
| 82 | provider.deviceProviderRegistry = nodeRegistry; |
| 83 | provider.linkProviderRegistry = linkRegistry; |
| 84 | provider.controller = controller; |
| 85 | provider.activate(); |
| 86 | assertNotNull("provider should be registered", nodeRegistry.provider); |
| 87 | assertNotNull("provider should be registered", linkRegistry.provider); |
| 88 | assertNotNull("listener should be registered", controller.nodeListener); |
| 89 | } |
| 90 | |
| 91 | @After |
| 92 | public void tearDown() { |
| 93 | provider.deactivate(); |
| 94 | assertNull("listener should be removed", controller.nodeListener); |
| 95 | provider.controller = null; |
| 96 | provider.deviceProviderRegistry = null; |
| 97 | provider.linkProviderRegistry = null; |
| 98 | } |
| 99 | |
| 100 | /* Class implement device test registry */ |
| 101 | private class TestDeviceRegistry implements DeviceProviderRegistry { |
| 102 | DeviceProvider provider; |
| 103 | |
| 104 | Set<DeviceId> connected = new HashSet<>(); |
| 105 | |
| 106 | @Override |
| 107 | public DeviceProviderService register(DeviceProvider provider) { |
| 108 | this.provider = provider; |
| 109 | return new TestProviderService(); |
| 110 | } |
| 111 | |
| 112 | @Override |
| 113 | public void unregister(DeviceProvider provider) { |
| 114 | } |
| 115 | |
| 116 | @Override |
| 117 | public Set<ProviderId> getProviders() { |
| 118 | return null; |
| 119 | } |
| 120 | |
| 121 | private class TestProviderService implements DeviceProviderService { |
| 122 | |
| 123 | @Override |
| 124 | public DeviceProvider provider() { |
| 125 | return null; |
| 126 | } |
| 127 | |
| 128 | @Override |
| 129 | public void deviceConnected(DeviceId deviceId, DeviceDescription deviceDescription) { |
| 130 | if (deviceId.equals(DID1)) { |
| 131 | connected.add(deviceId); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | @Override |
| 136 | public void deviceDisconnected(DeviceId deviceId) { |
| 137 | if (deviceId.equals(DID1)) { |
| 138 | connected.remove(deviceId); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | @Override |
| 143 | public void updatePorts(DeviceId deviceId, List<PortDescription> portDescriptions) { |
| 144 | // TODO Auto-generated method stub |
| 145 | |
| 146 | } |
| 147 | |
| 148 | @Override |
| 149 | public void portStatusChanged(DeviceId deviceId, PortDescription portDescription) { |
| 150 | // TODO Auto-generated method stub |
| 151 | |
| 152 | } |
| 153 | |
| 154 | @Override |
| 155 | public void receivedRoleReply(DeviceId deviceId, MastershipRole requested, MastershipRole response) { |
| 156 | // TODO Auto-generated method stub |
| 157 | |
| 158 | } |
| 159 | |
| 160 | @Override |
| 161 | public void updatePortStatistics(DeviceId deviceId, Collection<PortStatistics> portStatistics) { |
| 162 | // TODO Auto-generated method stub |
| 163 | |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | /* class implement link test registery */ |
| 169 | private class TestLinkRegistry implements LinkProviderRegistry { |
| 170 | LinkProvider provider; |
| 171 | |
| 172 | Set<DeviceId> connected = new HashSet<>(); |
| 173 | |
| 174 | @Override |
| 175 | public LinkProviderService register(LinkProvider provider) { |
| 176 | this.provider = provider; |
| 177 | return new TestProviderService(); |
| 178 | } |
| 179 | |
| 180 | @Override |
| 181 | public void unregister(LinkProvider provider) { |
| 182 | } |
| 183 | |
| 184 | @Override |
| 185 | public Set<ProviderId> getProviders() { |
| 186 | return null; |
| 187 | } |
| 188 | |
| 189 | private class TestProviderService implements LinkProviderService { |
| 190 | |
| 191 | @Override |
| 192 | public LinkProvider provider() { |
| 193 | // TODO Auto-generated method stub |
| 194 | return null; |
| 195 | } |
| 196 | |
| 197 | @Override |
| 198 | public void linkDetected(LinkDescription linkDescription) { |
| 199 | if ((linkDescription.src().deviceId().equals(DID3)) |
| 200 | && (linkDescription.dst().deviceId().equals(DID3))) { |
| 201 | connected.add(linkDescription.src().deviceId()); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | @Override |
| 206 | public void linkVanished(LinkDescription linkDescription) { |
| 207 | if ((linkDescription.src().deviceId().equals(DID3)) |
| 208 | && (linkDescription.dst().deviceId().equals(DID3))) { |
| 209 | connected.remove(linkDescription.src().deviceId()); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | @Override |
| 214 | public void linksVanished(ConnectPoint connectPoint) { |
| 215 | // TODO Auto-generated method stub |
| 216 | |
| 217 | } |
| 218 | |
| 219 | @Override |
| 220 | public void linksVanished(DeviceId deviceId) { |
| 221 | connected.remove(deviceId); |
| 222 | } |
| 223 | |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | /* class implement test controller */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 228 | private class TestController implements BgpController { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 229 | protected Set<BgpNodeListener> nodeListener = new CopyOnWriteArraySet<>(); |
| 230 | protected Set<BgpLinkListener> linkListener = new CopyOnWriteArraySet<>(); |
| 231 | |
| 232 | @Override |
| 233 | public void addListener(BgpNodeListener nodeListener) { |
| 234 | this.nodeListener.add(nodeListener); |
| 235 | } |
| 236 | |
| 237 | @Override |
| 238 | public void removeListener(BgpNodeListener nodeListener) { |
| 239 | this.nodeListener = null; |
| 240 | } |
| 241 | |
| 242 | @Override |
| 243 | public void addLinkListener(BgpLinkListener linkListener) { |
| 244 | this.linkListener.add(linkListener); |
| 245 | } |
| 246 | |
| 247 | @Override |
| 248 | public void removeLinkListener(BgpLinkListener linkListener) { |
| 249 | this.linkListener = null; |
| 250 | } |
| 251 | |
| 252 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 253 | public Iterable<BgpPeer> getPeers() { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 254 | // TODO Auto-generated method stub |
| 255 | return null; |
| 256 | } |
| 257 | |
| 258 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 259 | public BgpPeer getPeer(BgpId bgpId) { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 260 | // TODO Auto-generated method stub |
| 261 | return null; |
| 262 | } |
| 263 | |
| 264 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 265 | public void writeMsg(BgpId bgpId, BgpMessage msg) { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 266 | // TODO Auto-generated method stub |
| 267 | |
| 268 | } |
| 269 | |
| 270 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 271 | public void processBGPPacket(BgpId bgpId, BgpMessage msg) throws BgpParseException { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 272 | // TODO Auto-generated method stub |
| 273 | |
| 274 | } |
| 275 | |
| 276 | @Override |
| 277 | public void closeConnectedPeers() { |
| 278 | // TODO Auto-generated method stub |
| 279 | |
| 280 | } |
| 281 | |
| 282 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 283 | public BgpCfg getConfig() { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 284 | // TODO Auto-generated method stub |
| 285 | return null; |
| 286 | } |
| 287 | |
| 288 | @Override |
| 289 | public int connectedPeerCount() { |
| 290 | // TODO Auto-generated method stub |
| 291 | return 0; |
| 292 | } |
| 293 | |
| 294 | |
| 295 | @Override |
| 296 | public BgpPeerManager peerManager() { |
| 297 | // TODO Auto-generated method stub |
| 298 | return null; |
| 299 | } |
| 300 | |
| 301 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 302 | public Map<BgpId, BgpPeer> connectedPeers() { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 303 | // TODO Auto-generated method stub |
| 304 | return null; |
| 305 | } |
| 306 | |
| 307 | @Override |
| 308 | public Set<BgpNodeListener> listener() { |
| 309 | // TODO Auto-generated method stub |
| 310 | return null; |
| 311 | } |
| 312 | |
| 313 | @Override |
| 314 | public Set<BgpLinkListener> linkListener() { |
| 315 | // TODO Auto-generated method stub |
| 316 | return null; |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | /* Validate node is added to the device validating URI, RIB should get updated properly */ |
| 321 | @Test |
| 322 | public void bgpTopologyProviderTestAddDevice1() { |
| 323 | int deviceAddCount = 0; |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 324 | LinkedList<BgpValueType> subTlvs; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 325 | subTlvs = new LinkedList<>(); |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 326 | BgpValueType tlv = new AutonomousSystemTlv(100); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 327 | short deslength = AutonomousSystemTlv.LENGTH; |
| 328 | short desType = AutonomousSystemTlv.TYPE; |
| 329 | |
| 330 | subTlvs.add(tlv); |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 331 | BgpNodeLSIdentifier localNodeDescriptors = new BgpNodeLSIdentifier(new NodeDescriptors(subTlvs, deslength, |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 332 | desType)); |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 333 | BgpNodeLSNlriVer4 nodeNlri = new BgpNodeLSNlriVer4(0, (byte) Constants.DIRECT, localNodeDescriptors, false, |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 334 | new RouteDistinguisher()); |
| 335 | |
| 336 | nodeNlri.setNodeLSIdentifier(localNodeDescriptors); |
| 337 | for (BgpNodeListener l : controller.nodeListener) { |
| 338 | l.addNode(nodeNlri); |
| 339 | deviceAddCount = nodeRegistry.connected.size(); |
| 340 | assertTrue(deviceAddCount == 1); |
| 341 | l.deleteNode(nodeNlri); |
| 342 | deviceAddCount = nodeRegistry.connected.size(); |
| 343 | assertTrue(deviceAddCount == 0); |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | /* Validate node is not added to the device for invalid URI, RIB count should be zero */ |
| 348 | @Test |
| 349 | public void bgpTopologyProviderTestAddDevice2() { |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 350 | LinkedList<BgpValueType> subTlvs; |
| 351 | BgpValueType tlv = new AutonomousSystemTlv(10); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 352 | short deslength = AutonomousSystemTlv.LENGTH; |
| 353 | short desType = AutonomousSystemTlv.TYPE; |
| 354 | |
| 355 | subTlvs = new LinkedList<>(); |
| 356 | subTlvs.add(tlv); |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 357 | BgpNodeLSIdentifier localNodeDescriptors = new BgpNodeLSIdentifier(new NodeDescriptors(subTlvs, deslength, |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 358 | desType)); |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 359 | BgpNodeLSNlriVer4 nodeNlri = new BgpNodeLSNlriVer4(0, (byte) Constants.DIRECT, localNodeDescriptors, false, |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 360 | new RouteDistinguisher()); |
| 361 | |
| 362 | nodeNlri.setNodeLSIdentifier(localNodeDescriptors); |
| 363 | for (BgpNodeListener l : controller.nodeListener) { |
| 364 | l.addNode(nodeNlri); |
| 365 | assertTrue("Failed to add device", (nodeRegistry.connected.size() == 0)); |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | /* Delete node when node does not exist, RIB count should be zero */ |
| 370 | @Test |
| 371 | public void bgpTopologyProviderTestAddDevice3() { |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 372 | LinkedList<BgpValueType> subTlvs; |
| 373 | BgpValueType tlv = new AutonomousSystemTlv(10); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 374 | short deslength = AutonomousSystemTlv.LENGTH; |
| 375 | short desType = AutonomousSystemTlv.TYPE; |
| 376 | |
| 377 | subTlvs = new LinkedList<>(); |
| 378 | subTlvs.add(tlv); |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 379 | BgpNodeLSIdentifier localNodeDescriptors = new BgpNodeLSIdentifier(new NodeDescriptors(subTlvs, deslength, |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 380 | desType)); |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 381 | BgpNodeLSNlriVer4 nodeNlri = new BgpNodeLSNlriVer4(0, (byte) Constants.DIRECT, localNodeDescriptors, false, |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 382 | new RouteDistinguisher()); |
| 383 | |
| 384 | nodeNlri.setNodeLSIdentifier(localNodeDescriptors); |
| 385 | for (BgpNodeListener l : controller.nodeListener) { |
| 386 | l.deleteNode(nodeNlri); |
| 387 | assertTrue("Failed to add device", (nodeRegistry.connected.size() == 0)); |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | /* Validate link is added to the device validating URI, RIB should get updated properly */ |
| 392 | @Test |
| 393 | public void bgpTopologyProviderTestAddLink1() { |
| 394 | |
| 395 | NodeDescriptors localNodeDescriptors; |
| 396 | NodeDescriptors remoteNodeDescriptors; |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 397 | LinkedList<BgpValueType> subTlvs; |
| 398 | LinkedList<BgpValueType> linkDescriptor = new LinkedList<>(); |
| 399 | BgpValueType tlvLocalRemoteId; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 400 | short deslength = AutonomousSystemTlv.LENGTH; |
| 401 | short desType = AutonomousSystemTlv.TYPE; |
| 402 | |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 403 | BgpValueType tlv = new AutonomousSystemTlv(100); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 404 | subTlvs = new LinkedList<>(); |
| 405 | subTlvs.add(tlv); |
| 406 | |
| 407 | localNodeDescriptors = new NodeDescriptors(subTlvs, deslength, desType); |
| 408 | remoteNodeDescriptors = new NodeDescriptors(subTlvs, deslength, desType); |
| 409 | tlvLocalRemoteId = new LinkLocalRemoteIdentifiersTlv(1, 2); |
| 410 | linkDescriptor.add(tlvLocalRemoteId); |
| 411 | |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame^] | 412 | BgpLinkLSIdentifier linkLSIdentifier = new BgpLinkLSIdentifier(localNodeDescriptors, remoteNodeDescriptors, |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 413 | linkDescriptor); |
| 414 | BgpLinkLsNlriVer4 linkNlri = new BgpLinkLsNlriVer4((byte) Constants.DIRECT, 0, linkLSIdentifier, null, false); |
| 415 | |
| 416 | for (BgpLinkListener l : controller.linkListener) { |
| 417 | l.addLink(linkNlri); |
| 418 | assertTrue(linkRegistry.connected.size() == 1); |
| 419 | l.deleteLink(linkNlri); |
| 420 | assertTrue(linkRegistry.connected.size() == 0); |
| 421 | } |
| 422 | } |
| 423 | } |