Committed by
Gerrit Code Review
Fix for SDN-IP installing wrong point-to-point intents.
Fixes ONOS-2514. Change-Id: I0d3d6012daa8dd2a45707a58cf6e745314f6dc24
Showing
6 changed files
with
79 additions
and
170 deletions
... | @@ -90,6 +90,14 @@ public interface RoutingConfigurationService { | ... | @@ -90,6 +90,14 @@ public interface RoutingConfigurationService { |
90 | Interface getInterface(ConnectPoint connectPoint); | 90 | Interface getInterface(ConnectPoint connectPoint); |
91 | 91 | ||
92 | /** | 92 | /** |
93 | + * Retrieves the interface associated with the given IP address. | ||
94 | + * | ||
95 | + * @param ip IP address of the interface | ||
96 | + * @return the interface | ||
97 | + */ | ||
98 | + Interface getInterface(IpAddress ip); | ||
99 | + | ||
100 | + /** | ||
93 | * Retrieves the interface that matches the given IP address. Matching | 101 | * Retrieves the interface that matches the given IP address. Matching |
94 | * means that the IP address is in one of the interface's assigned subnets. | 102 | * means that the IP address is in one of the interface's assigned subnets. |
95 | * | 103 | * | ... | ... |
... | @@ -63,6 +63,20 @@ public class HostToInterfaceAdaptor { | ... | @@ -63,6 +63,20 @@ public class HostToInterfaceAdaptor { |
63 | return null; | 63 | return null; |
64 | } | 64 | } |
65 | 65 | ||
66 | + public Interface getInterface(IpAddress ip) { | ||
67 | + Set<PortAddresses> portAddresses = hostService.getAddressBindings(); | ||
68 | + | ||
69 | + for (PortAddresses portAddress : portAddresses) { | ||
70 | + for (InterfaceIpAddress portIp : portAddress.ipAddresses()) { | ||
71 | + if (portIp.ipAddress().equals(ip)) { | ||
72 | + return new Interface(portAddress); | ||
73 | + } | ||
74 | + } | ||
75 | + } | ||
76 | + | ||
77 | + return null; | ||
78 | + } | ||
79 | + | ||
66 | public Interface getMatchingInterface(IpAddress ipAddress) { | 80 | public Interface getMatchingInterface(IpAddress ipAddress) { |
67 | checkNotNull(ipAddress); | 81 | checkNotNull(ipAddress); |
68 | 82 | ... | ... |
... | @@ -159,6 +159,11 @@ public class RoutingConfigurationImpl implements RoutingConfigurationService { | ... | @@ -159,6 +159,11 @@ public class RoutingConfigurationImpl implements RoutingConfigurationService { |
159 | } | 159 | } |
160 | 160 | ||
161 | @Override | 161 | @Override |
162 | + public Interface getInterface(IpAddress ip) { | ||
163 | + return hostAdaptor.getInterface(ip); | ||
164 | + } | ||
165 | + | ||
166 | + @Override | ||
162 | public Interface getMatchingInterface(IpAddress ipAddress) { | 167 | public Interface getMatchingInterface(IpAddress ipAddress) { |
163 | return hostAdaptor.getMatchingInterface(ipAddress); | 168 | return hostAdaptor.getMatchingInterface(ipAddress); |
164 | } | 169 | } | ... | ... |
... | @@ -173,7 +173,8 @@ public class HostToInterfaceAdaptorTest { | ... | @@ -173,7 +173,8 @@ public class HostToInterfaceAdaptorTest { |
173 | */ | 173 | */ |
174 | @Test(expected = NullPointerException.class) | 174 | @Test(expected = NullPointerException.class) |
175 | public void testGetInterfaceNull() { | 175 | public void testGetInterfaceNull() { |
176 | - adaptor.getInterface(null); | 176 | + ConnectPoint c = null; |
177 | + adaptor.getInterface(c); | ||
177 | } | 178 | } |
178 | 179 | ||
179 | /** | 180 | /** | ... | ... |
... | @@ -139,24 +139,22 @@ public class PeerConnectivityManager { | ... | @@ -139,24 +139,22 @@ public class PeerConnectivityManager { |
139 | List<InterfaceAddress> interfaceAddresses = | 139 | List<InterfaceAddress> interfaceAddresses = |
140 | bgpSpeaker.interfaceAddresses(); | 140 | bgpSpeaker.interfaceAddresses(); |
141 | 141 | ||
142 | - Interface peerInterface = configService.getInterface( | 142 | + IpAddress bgpdAddress = null; |
143 | - bgpPeer.connectPoint()); | 143 | + for (InterfaceAddress interfaceAddress : interfaceAddresses) { |
144 | - | 144 | + Interface peerInterface = configService.getInterface(interfaceAddress.ipAddress()); |
145 | if (peerInterface == null) { | 145 | if (peerInterface == null) { |
146 | - log.error("No interface found for peer {}", bgpPeer.ipAddress()); | 146 | + continue; |
147 | - return intents; | ||
148 | } | 147 | } |
149 | 148 | ||
150 | - IpAddress bgpdAddress = null; | ||
151 | - for (InterfaceAddress interfaceAddress : interfaceAddresses) { | ||
152 | - if (interfaceAddress.connectPoint().equals(peerInterface.connectPoint())) { | ||
153 | for (InterfaceIpAddress interfaceIpAddress : peerInterface.ipAddresses()) { | 149 | for (InterfaceIpAddress interfaceIpAddress : peerInterface.ipAddresses()) { |
154 | // Only add intents where the peer and ONOS's addresses are | 150 | // Only add intents where the peer and ONOS's addresses are |
155 | // in the same subnet | 151 | // in the same subnet |
156 | if (interfaceIpAddress.subnetAddress().contains(bgpPeer.ipAddress())) { | 152 | if (interfaceIpAddress.subnetAddress().contains(bgpPeer.ipAddress())) { |
157 | bgpdAddress = interfaceAddress.ipAddress(); | 153 | bgpdAddress = interfaceAddress.ipAddress(); |
154 | + break; | ||
158 | } | 155 | } |
159 | } | 156 | } |
157 | + if (bgpdAddress != null) { | ||
160 | break; | 158 | break; |
161 | } | 159 | } |
162 | } | 160 | } |
... | @@ -167,7 +165,7 @@ public class PeerConnectivityManager { | ... | @@ -167,7 +165,7 @@ public class PeerConnectivityManager { |
167 | } | 165 | } |
168 | 166 | ||
169 | IpAddress bgpdPeerAddress = bgpPeer.ipAddress(); | 167 | IpAddress bgpdPeerAddress = bgpPeer.ipAddress(); |
170 | - ConnectPoint bgpdPeerConnectPoint = peerInterface.connectPoint(); | 168 | + ConnectPoint bgpdPeerConnectPoint = bgpPeer.connectPoint(); |
171 | 169 | ||
172 | if (bgpdAddress.version() != bgpdPeerAddress.version()) { | 170 | if (bgpdAddress.version() != bgpdPeerAddress.version()) { |
173 | return intents; | 171 | return intents; | ... | ... |
... | @@ -15,13 +15,7 @@ | ... | @@ -15,13 +15,7 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.sdnip; | 16 | package org.onosproject.sdnip; |
17 | 17 | ||
18 | -import java.util.ArrayList; | 18 | +import com.google.common.collect.Sets; |
19 | -import java.util.Collections; | ||
20 | -import java.util.HashMap; | ||
21 | -import java.util.LinkedList; | ||
22 | -import java.util.List; | ||
23 | -import java.util.Map; | ||
24 | - | ||
25 | import org.junit.Before; | 19 | import org.junit.Before; |
26 | import org.junit.Ignore; | 20 | import org.junit.Ignore; |
27 | import org.junit.Test; | 21 | import org.junit.Test; |
... | @@ -52,7 +46,12 @@ import org.onosproject.routing.config.Interface; | ... | @@ -52,7 +46,12 @@ import org.onosproject.routing.config.Interface; |
52 | import org.onosproject.routing.config.InterfaceAddress; | 46 | import org.onosproject.routing.config.InterfaceAddress; |
53 | import org.onosproject.routing.config.RoutingConfigurationService; | 47 | import org.onosproject.routing.config.RoutingConfigurationService; |
54 | 48 | ||
55 | -import com.google.common.collect.Sets; | 49 | +import java.util.ArrayList; |
50 | +import java.util.Collections; | ||
51 | +import java.util.HashMap; | ||
52 | +import java.util.LinkedList; | ||
53 | +import java.util.List; | ||
54 | +import java.util.Map; | ||
56 | 55 | ||
57 | import static org.easymock.EasyMock.createMock; | 56 | import static org.easymock.EasyMock.createMock; |
58 | import static org.easymock.EasyMock.expect; | 57 | import static org.easymock.EasyMock.expect; |
... | @@ -144,7 +143,6 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { | ... | @@ -144,7 +143,6 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { |
144 | "00:00:00:00:00:01"); | 143 | "00:00:00:00:00:01"); |
145 | List<InterfaceAddress> interfaceAddresses1 = new LinkedList<>(); | 144 | List<InterfaceAddress> interfaceAddresses1 = new LinkedList<>(); |
146 | interfaceAddresses1.add(new InterfaceAddress(dpid1, 1, "192.168.10.101")); | 145 | interfaceAddresses1.add(new InterfaceAddress(dpid1, 1, "192.168.10.101")); |
147 | - interfaceAddresses1.add(new InterfaceAddress(dpid2, 1, "192.168.20.101")); | ||
148 | bgpSpeaker1.setInterfaceAddresses(interfaceAddresses1); | 146 | bgpSpeaker1.setInterfaceAddresses(interfaceAddresses1); |
149 | configuredBgpSpeakers.put(bgpSpeaker1.name(), bgpSpeaker1); | 147 | configuredBgpSpeakers.put(bgpSpeaker1.name(), bgpSpeaker1); |
150 | 148 | ||
... | @@ -154,21 +152,11 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { | ... | @@ -154,21 +152,11 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { |
154 | "00:00:00:00:00:00:00:01", 100, | 152 | "00:00:00:00:00:00:00:01", 100, |
155 | "00:00:00:00:00:02"); | 153 | "00:00:00:00:00:02"); |
156 | List<InterfaceAddress> interfaceAddresses2 = new LinkedList<>(); | 154 | List<InterfaceAddress> interfaceAddresses2 = new LinkedList<>(); |
157 | - interfaceAddresses2.add(new InterfaceAddress(dpid1, 1, "192.168.10.102")); | 155 | + interfaceAddresses2.add(new InterfaceAddress(dpid2, 1, "192.168.20.101")); |
158 | - interfaceAddresses2.add(new InterfaceAddress(dpid2, 1, "192.168.20.102")); | 156 | + interfaceAddresses2.add(new InterfaceAddress(dpid2, 1, "192.168.30.101")); |
159 | bgpSpeaker2.setInterfaceAddresses(interfaceAddresses2); | 157 | bgpSpeaker2.setInterfaceAddresses(interfaceAddresses2); |
160 | configuredBgpSpeakers.put(bgpSpeaker2.name(), bgpSpeaker2); | 158 | configuredBgpSpeakers.put(bgpSpeaker2.name(), bgpSpeaker2); |
161 | 159 | ||
162 | - BgpSpeaker bgpSpeaker3 = new BgpSpeaker( | ||
163 | - "bgpSpeaker3", | ||
164 | - "00:00:00:00:00:00:00:02", 100, | ||
165 | - "00:00:00:00:00:03"); | ||
166 | - List<InterfaceAddress> interfaceAddresses3 = new LinkedList<>(); | ||
167 | - interfaceAddresses3.add(new InterfaceAddress(dpid1, 1, "192.168.10.103")); | ||
168 | - interfaceAddresses3.add(new InterfaceAddress(dpid2, 1, "192.168.20.103")); | ||
169 | - bgpSpeaker3.setInterfaceAddresses(interfaceAddresses3); | ||
170 | - configuredBgpSpeakers.put(bgpSpeaker3.name(), bgpSpeaker3); | ||
171 | - | ||
172 | return configuredBgpSpeakers; | 160 | return configuredBgpSpeakers; |
173 | } | 161 | } |
174 | 162 | ||
... | @@ -184,7 +172,7 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { | ... | @@ -184,7 +172,7 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { |
184 | 172 | ||
185 | String interfaceSw1Eth1 = "s1-eth1"; | 173 | String interfaceSw1Eth1 = "s1-eth1"; |
186 | InterfaceIpAddress ia1 = | 174 | InterfaceIpAddress ia1 = |
187 | - new InterfaceIpAddress(IpAddress.valueOf("192.168.10.1"), | 175 | + new InterfaceIpAddress(IpAddress.valueOf("192.168.10.101"), |
188 | IpPrefix.valueOf("192.168.10.0/24")); | 176 | IpPrefix.valueOf("192.168.10.0/24")); |
189 | Interface intfsw1eth1 = new Interface(s1Eth1, | 177 | Interface intfsw1eth1 = new Interface(s1Eth1, |
190 | Collections.singleton(ia1), | 178 | Collections.singleton(ia1), |
... | @@ -194,7 +182,7 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { | ... | @@ -194,7 +182,7 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { |
194 | configuredInterfaces.put(interfaceSw1Eth1, intfsw1eth1); | 182 | configuredInterfaces.put(interfaceSw1Eth1, intfsw1eth1); |
195 | String interfaceSw2Eth1 = "s2-eth1"; | 183 | String interfaceSw2Eth1 = "s2-eth1"; |
196 | InterfaceIpAddress ia2 = | 184 | InterfaceIpAddress ia2 = |
197 | - new InterfaceIpAddress(IpAddress.valueOf("192.168.20.2"), | 185 | + new InterfaceIpAddress(IpAddress.valueOf("192.168.20.101"), |
198 | IpPrefix.valueOf("192.168.20.0/24")); | 186 | IpPrefix.valueOf("192.168.20.0/24")); |
199 | Interface intfsw2eth1 = new Interface(s2Eth1, | 187 | Interface intfsw2eth1 = new Interface(s2Eth1, |
200 | Collections.singleton(ia2), | 188 | Collections.singleton(ia2), |
... | @@ -202,10 +190,28 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { | ... | @@ -202,10 +190,28 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { |
202 | VlanId.NONE); | 190 | VlanId.NONE); |
203 | configuredInterfaces.put(interfaceSw2Eth1, intfsw2eth1); | 191 | configuredInterfaces.put(interfaceSw2Eth1, intfsw2eth1); |
204 | 192 | ||
193 | + String interfaceSw2Eth1intf2 = "s2-eth1_2"; | ||
194 | + InterfaceIpAddress ia3 = | ||
195 | + new InterfaceIpAddress(IpAddress.valueOf("192.168.30.101"), | ||
196 | + IpPrefix.valueOf("192.168.30.0/24")); | ||
197 | + Interface intfsw2eth1intf2 = new Interface(s2Eth1, | ||
198 | + Collections.singleton(ia3), | ||
199 | + MacAddress.valueOf("00:00:00:00:00:03"), | ||
200 | + VlanId.NONE); | ||
201 | + configuredInterfaces.put(interfaceSw2Eth1intf2, intfsw2eth1intf2); | ||
202 | + | ||
205 | expect(routingConfig.getInterface(s1Eth1)) | 203 | expect(routingConfig.getInterface(s1Eth1)) |
206 | .andReturn(intfsw1eth1).anyTimes(); | 204 | .andReturn(intfsw1eth1).anyTimes(); |
205 | + expect(routingConfig.getInterface(IpAddress.valueOf("192.168.10.101"))) | ||
206 | + .andReturn(intfsw1eth1).anyTimes(); | ||
207 | expect(routingConfig.getInterface(s2Eth1)) | 207 | expect(routingConfig.getInterface(s2Eth1)) |
208 | .andReturn(intfsw2eth1).anyTimes(); | 208 | .andReturn(intfsw2eth1).anyTimes(); |
209 | + expect(routingConfig.getInterface(IpAddress.valueOf("192.168.20.101"))) | ||
210 | + .andReturn(intfsw2eth1).anyTimes(); | ||
211 | + //expect(routingConfig.getInterface(s2Eth1)) | ||
212 | + // .andReturn(intfsw2eth1intf2).anyTimes(); | ||
213 | + expect(routingConfig.getInterface(IpAddress.valueOf("192.168.30.101"))) | ||
214 | + .andReturn(intfsw2eth1intf2).anyTimes(); | ||
209 | 215 | ||
210 | // Non-existent interface used during one of the tests | 216 | // Non-existent interface used during one of the tests |
211 | expect(routingConfig.getInterface(new ConnectPoint( | 217 | expect(routingConfig.getInterface(new ConnectPoint( |
... | @@ -237,7 +243,7 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { | ... | @@ -237,7 +243,7 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { |
237 | configuredPeers.put(IpAddress.valueOf(peer1Sw2Eth1), | 243 | configuredPeers.put(IpAddress.valueOf(peer1Sw2Eth1), |
238 | new BgpPeer(dpid2, 1, peer1Sw2Eth1)); | 244 | new BgpPeer(dpid2, 1, peer1Sw2Eth1)); |
239 | 245 | ||
240 | - String peer2Sw2Eth1 = "192.168.20.2"; | 246 | + String peer2Sw2Eth1 = "192.168.30.1"; |
241 | configuredPeers.put(IpAddress.valueOf(peer2Sw2Eth1), | 247 | configuredPeers.put(IpAddress.valueOf(peer2Sw2Eth1), |
242 | new BgpPeer(dpid2, 1, peer2Sw2Eth1)); | 248 | new BgpPeer(dpid2, 1, peer2Sw2Eth1)); |
243 | 249 | ||
... | @@ -338,111 +344,21 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { | ... | @@ -338,111 +344,21 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { |
338 | "192.168.20.1/32", "192.168.20.101/32", bgpPort, null, | 344 | "192.168.20.1/32", "192.168.20.101/32", bgpPort, null, |
339 | s2Eth1, s1Eth100); | 345 | s2Eth1, s1Eth100); |
340 | 346 | ||
341 | - // Start to build intents between BGP speaker1 and BGP peer3 | ||
342 | - bgpPathintentConstructor( | ||
343 | - "192.168.20.101/32", "192.168.20.2/32", null, bgpPort, | ||
344 | - s1Eth100, s2Eth1); | ||
345 | - bgpPathintentConstructor( | ||
346 | - "192.168.20.101/32", "192.168.20.2/32", bgpPort, null, | ||
347 | - s1Eth100, s2Eth1); | ||
348 | - | ||
349 | - bgpPathintentConstructor( | ||
350 | - "192.168.20.2/32", "192.168.20.101/32", null, bgpPort, | ||
351 | - s2Eth1, s1Eth100); | ||
352 | - bgpPathintentConstructor( | ||
353 | - "192.168.20.2/32", "192.168.20.101/32", bgpPort, null, | ||
354 | - s2Eth1, s1Eth100); | ||
355 | - | ||
356 | // | 347 | // |
357 | - // Start to build intents between BGP speaker2 and BGP peer1 | 348 | + // Start to build intents between BGP speaker3 and BGP peer1 |
358 | - bgpPathintentConstructor( | ||
359 | - "192.168.10.102/32", "192.168.10.1/32", null, bgpPort, | ||
360 | - s1Eth100, s1Eth1); | ||
361 | - bgpPathintentConstructor( | ||
362 | - "192.168.10.102/32", "192.168.10.1/32", bgpPort, null, | ||
363 | - s1Eth100, s1Eth1); | ||
364 | - | ||
365 | - bgpPathintentConstructor( | ||
366 | - "192.168.10.1/32", "192.168.10.102/32", null, bgpPort, | ||
367 | - s1Eth1, s1Eth100); | ||
368 | - bgpPathintentConstructor( | ||
369 | - "192.168.10.1/32", "192.168.10.102/32", bgpPort, null, | ||
370 | - s1Eth1, s1Eth100); | ||
371 | - // Start to build intents between BGP speaker2 and BGP peer2 | ||
372 | - bgpPathintentConstructor( | ||
373 | - "192.168.20.102/32", "192.168.20.1/32", null, bgpPort, | ||
374 | - s1Eth100, s2Eth1); | ||
375 | - bgpPathintentConstructor( | ||
376 | - "192.168.20.102/32", "192.168.20.1/32", bgpPort, null, | ||
377 | - s1Eth100, s2Eth1); | ||
378 | - | ||
379 | - bgpPathintentConstructor( | ||
380 | - "192.168.20.1/32", "192.168.20.102/32", null, bgpPort, | ||
381 | - s2Eth1, s1Eth100); | ||
382 | - bgpPathintentConstructor( | ||
383 | - "192.168.20.1/32", "192.168.20.102/32", bgpPort, null, | ||
384 | - s2Eth1, s1Eth100); | ||
385 | - | ||
386 | - // Start to build intents between BGP speaker2 and BGP peer3 | ||
387 | bgpPathintentConstructor( | 349 | bgpPathintentConstructor( |
388 | - "192.168.20.102/32", "192.168.20.2/32", null, bgpPort, | 350 | + "192.168.30.101/32", "192.168.30.1/32", null, bgpPort, |
389 | s1Eth100, s2Eth1); | 351 | s1Eth100, s2Eth1); |
390 | bgpPathintentConstructor( | 352 | bgpPathintentConstructor( |
391 | - "192.168.20.102/32", "192.168.20.2/32", bgpPort, null, | 353 | + "192.168.30.101/32", "192.168.30.1/32", bgpPort, null, |
392 | s1Eth100, s2Eth1); | 354 | s1Eth100, s2Eth1); |
393 | 355 | ||
394 | bgpPathintentConstructor( | 356 | bgpPathintentConstructor( |
395 | - "192.168.20.2/32", "192.168.20.102/32", null, bgpPort, | 357 | + "192.168.30.1/32", "192.168.30.101/32", null, bgpPort, |
396 | s2Eth1, s1Eth100); | 358 | s2Eth1, s1Eth100); |
397 | bgpPathintentConstructor( | 359 | bgpPathintentConstructor( |
398 | - "192.168.20.2/32", "192.168.20.102/32", bgpPort, null, | 360 | + "192.168.30.1/32", "192.168.30.101/32", bgpPort, null, |
399 | s2Eth1, s1Eth100); | 361 | s2Eth1, s1Eth100); |
400 | - | ||
401 | - // | ||
402 | - // Start to build intents between BGP speaker3 and BGP peer1 | ||
403 | - bgpPathintentConstructor( | ||
404 | - "192.168.10.103/32", "192.168.10.1/32", null, bgpPort, | ||
405 | - s2Eth100, s1Eth1); | ||
406 | - bgpPathintentConstructor( | ||
407 | - "192.168.10.103/32", "192.168.10.1/32", bgpPort, null, | ||
408 | - s2Eth100, s1Eth1); | ||
409 | - | ||
410 | - bgpPathintentConstructor( | ||
411 | - "192.168.10.1/32", "192.168.10.103/32", null, bgpPort, | ||
412 | - s1Eth1, s2Eth100); | ||
413 | - bgpPathintentConstructor( | ||
414 | - "192.168.10.1/32", "192.168.10.103/32", bgpPort, null, | ||
415 | - s1Eth1, s2Eth100); | ||
416 | - | ||
417 | - // Start to build intents between BGP speaker3 and BGP peer2 | ||
418 | - bgpPathintentConstructor( | ||
419 | - "192.168.20.103/32", "192.168.20.1/32", null, bgpPort, | ||
420 | - s2Eth100, s2Eth1); | ||
421 | - bgpPathintentConstructor( | ||
422 | - "192.168.20.103/32", "192.168.20.1/32", bgpPort, null, | ||
423 | - s2Eth100, s2Eth1); | ||
424 | - | ||
425 | - bgpPathintentConstructor( | ||
426 | - "192.168.20.1/32", "192.168.20.103/32", null, bgpPort, | ||
427 | - s2Eth1, s2Eth100); | ||
428 | - bgpPathintentConstructor( | ||
429 | - "192.168.20.1/32", "192.168.20.103/32", bgpPort, null, | ||
430 | - s2Eth1, s2Eth100); | ||
431 | - | ||
432 | - // Start to build intents between BGP speaker3 and BGP peer3 | ||
433 | - bgpPathintentConstructor( | ||
434 | - "192.168.20.103/32", "192.168.20.2/32", null, bgpPort, | ||
435 | - s2Eth100, s2Eth1); | ||
436 | - bgpPathintentConstructor( | ||
437 | - "192.168.20.103/32", "192.168.20.2/32", bgpPort, null, | ||
438 | - s2Eth100, s2Eth1); | ||
439 | - | ||
440 | - bgpPathintentConstructor( | ||
441 | - "192.168.20.2/32", "192.168.20.103/32", null, bgpPort, | ||
442 | - s2Eth1, s2Eth100); | ||
443 | - bgpPathintentConstructor( | ||
444 | - "192.168.20.2/32", "192.168.20.103/32", bgpPort, null, | ||
445 | - s2Eth1, s2Eth100); | ||
446 | } | 362 | } |
447 | 363 | ||
448 | /** | 364 | /** |
... | @@ -494,49 +410,10 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { | ... | @@ -494,49 +410,10 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { |
494 | icmpPathintentConstructor( | 410 | icmpPathintentConstructor( |
495 | "192.168.20.1/32", "192.168.20.101/32", s2Eth1, s1Eth100); | 411 | "192.168.20.1/32", "192.168.20.101/32", s2Eth1, s1Eth100); |
496 | 412 | ||
497 | - // Start to build intents between BGP speaker1 and BGP peer3 | ||
498 | icmpPathintentConstructor( | 413 | icmpPathintentConstructor( |
499 | - "192.168.20.101/32", "192.168.20.2/32", s1Eth100, s2Eth1); | 414 | + "192.168.30.101/32", "192.168.30.1/32", s1Eth100, s2Eth1); |
500 | icmpPathintentConstructor( | 415 | icmpPathintentConstructor( |
501 | - "192.168.20.2/32", "192.168.20.101/32", s2Eth1, s1Eth100); | 416 | + "192.168.30.1/32", "192.168.30.101/32", s2Eth1, s1Eth100); |
502 | - | ||
503 | - // | ||
504 | - // Start to build intents between BGP speaker2 and BGP peer1 | ||
505 | - icmpPathintentConstructor( | ||
506 | - "192.168.10.102/32", "192.168.10.1/32", s1Eth100, s1Eth1); | ||
507 | - icmpPathintentConstructor( | ||
508 | - "192.168.10.1/32", "192.168.10.102/32", s1Eth1, s1Eth100); | ||
509 | - | ||
510 | - // Start to build intents between BGP speaker2 and BGP peer2 | ||
511 | - icmpPathintentConstructor( | ||
512 | - "192.168.20.102/32", "192.168.20.1/32", s1Eth100, s2Eth1); | ||
513 | - icmpPathintentConstructor( | ||
514 | - "192.168.20.1/32", "192.168.20.102/32", s2Eth1, s1Eth100); | ||
515 | - | ||
516 | - // Start to build intents between BGP speaker2 and BGP peer3 | ||
517 | - icmpPathintentConstructor( | ||
518 | - "192.168.20.102/32", "192.168.20.2/32", s1Eth100, s2Eth1); | ||
519 | - icmpPathintentConstructor( | ||
520 | - "192.168.20.2/32", "192.168.20.102/32", s2Eth1, s1Eth100); | ||
521 | - | ||
522 | - // | ||
523 | - // Start to build intents between BGP speaker3 and BGP peer1 | ||
524 | - icmpPathintentConstructor( | ||
525 | - "192.168.10.103/32", "192.168.10.1/32", s2Eth100, s1Eth1); | ||
526 | - icmpPathintentConstructor( | ||
527 | - "192.168.10.1/32", "192.168.10.103/32", s1Eth1, s2Eth100); | ||
528 | - | ||
529 | - // Start to build intents between BGP speaker3 and BGP peer2 | ||
530 | - icmpPathintentConstructor( | ||
531 | - "192.168.20.103/32", "192.168.20.1/32", s2Eth100, s2Eth1); | ||
532 | - icmpPathintentConstructor( | ||
533 | - "192.168.20.1/32", "192.168.20.103/32", s2Eth1, s2Eth100); | ||
534 | - | ||
535 | - // Start to build intents between BGP speaker3 and BGP peer3 | ||
536 | - icmpPathintentConstructor( | ||
537 | - "192.168.20.103/32", "192.168.20.2/32", s2Eth100, s2Eth1); | ||
538 | - icmpPathintentConstructor( | ||
539 | - "192.168.20.2/32", "192.168.20.103/32", s2Eth1, s2Eth100); | ||
540 | 417 | ||
541 | } | 418 | } |
542 | 419 | ||
... | @@ -601,6 +478,12 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { | ... | @@ -601,6 +478,12 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest { |
601 | .andReturn(null).anyTimes(); | 478 | .andReturn(null).anyTimes(); |
602 | expect(routingConfig.getInterface(s1Eth1)) | 479 | expect(routingConfig.getInterface(s1Eth1)) |
603 | .andReturn(null).anyTimes(); | 480 | .andReturn(null).anyTimes(); |
481 | + expect(routingConfig.getInterface(IpAddress.valueOf("192.168.10.101"))) | ||
482 | + .andReturn(null).anyTimes(); | ||
483 | + expect(routingConfig.getInterface(IpAddress.valueOf("192.168.20.101"))) | ||
484 | + .andReturn(null).anyTimes(); | ||
485 | + expect(routingConfig.getInterface(IpAddress.valueOf("192.168.30.101"))) | ||
486 | + .andReturn(null).anyTimes(); | ||
604 | 487 | ||
605 | expect(routingConfig.getBgpPeers()).andReturn(peers).anyTimes(); | 488 | expect(routingConfig.getBgpPeers()).andReturn(peers).anyTimes(); |
606 | expect(routingConfig.getBgpSpeakers()).andReturn(bgpSpeakers).anyTimes(); | 489 | expect(routingConfig.getBgpSpeakers()).andReturn(bgpSpeakers).anyTimes(); | ... | ... |
-
Please register or login to post a comment