Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 1 | /* |
Ray Milkey | 34c9590 | 2015-04-15 09:47:53 -0700 | [diff] [blame] | 2 | * Copyright 2014-2015 Open Networking Laboratory |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.sdnip; |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 17 | |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 18 | import com.google.common.collect.Sets; |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 19 | import org.junit.Before; |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 20 | import org.junit.Test; |
Pavlin Radoslavov | a7243cc | 2014-11-22 21:38:02 -0800 | [diff] [blame] | 21 | import org.onlab.junit.TestUtils.TestUtilsException; |
Jonathan Hart | 5137218 | 2014-12-03 21:32:34 -0800 | [diff] [blame] | 22 | import org.onlab.packet.Ethernet; |
| 23 | import org.onlab.packet.IPv4; |
| 24 | import org.onlab.packet.IpAddress; |
| 25 | import org.onlab.packet.IpPrefix; |
| 26 | import org.onlab.packet.MacAddress; |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 27 | import org.onlab.packet.TpPort; |
Jonathan Hart | 6cd2f35 | 2015-01-13 17:44:45 -0800 | [diff] [blame] | 28 | import org.onlab.packet.VlanId; |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 29 | import org.onosproject.TestApplicationId; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 30 | import org.onosproject.core.ApplicationId; |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 31 | import org.onosproject.incubator.net.intf.Interface; |
Jonathan Hart | b14221c | 2016-03-07 09:55:50 -0800 | [diff] [blame^] | 32 | import org.onosproject.incubator.net.intf.InterfaceListener; |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 33 | import org.onosproject.incubator.net.intf.InterfaceService; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 34 | import org.onosproject.net.ConnectPoint; |
| 35 | import org.onosproject.net.DeviceId; |
| 36 | import org.onosproject.net.PortNumber; |
Jonathan Hart | 08105be | 2015-10-10 18:31:06 -0700 | [diff] [blame] | 37 | import org.onosproject.net.config.NetworkConfigListener; |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 38 | import org.onosproject.net.config.NetworkConfigService; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 39 | import org.onosproject.net.flow.DefaultTrafficSelector; |
| 40 | import org.onosproject.net.flow.DefaultTrafficTreatment; |
| 41 | import org.onosproject.net.flow.TrafficSelector; |
| 42 | import org.onosproject.net.flow.TrafficTreatment; |
| 43 | import org.onosproject.net.host.InterfaceIpAddress; |
| 44 | import org.onosproject.net.intent.AbstractIntentTest; |
| 45 | import org.onosproject.net.intent.Intent; |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 46 | import org.onosproject.net.intent.Key; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 47 | import org.onosproject.net.intent.PointToPointIntent; |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 48 | import org.onosproject.routing.IntentSynchronizationService; |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 49 | import org.onosproject.routing.config.BgpConfig; |
Jonathan Hart | 2da1e60 | 2015-02-18 19:09:24 -0800 | [diff] [blame] | 50 | import org.onosproject.routing.config.BgpPeer; |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 51 | |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 52 | import java.util.ArrayList; |
| 53 | import java.util.Collections; |
| 54 | import java.util.HashMap; |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 55 | import java.util.List; |
| 56 | import java.util.Map; |
Jonathan Hart | a862548 | 2015-09-08 16:14:56 -0700 | [diff] [blame] | 57 | import java.util.Optional; |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 58 | import java.util.Set; |
Jonathan Hart | 552e31f | 2015-02-06 11:11:59 -0800 | [diff] [blame] | 59 | |
Jonathan Hart | 08105be | 2015-10-10 18:31:06 -0700 | [diff] [blame] | 60 | import static org.easymock.EasyMock.anyObject; |
Ray Milkey | 3e3ec5f | 2015-03-17 17:00:38 -0700 | [diff] [blame] | 61 | import static org.easymock.EasyMock.createMock; |
| 62 | import static org.easymock.EasyMock.expect; |
Jonathan Hart | 08105be | 2015-10-10 18:31:06 -0700 | [diff] [blame] | 63 | import static org.easymock.EasyMock.expectLastCall; |
Ray Milkey | 3e3ec5f | 2015-03-17 17:00:38 -0700 | [diff] [blame] | 64 | import static org.easymock.EasyMock.replay; |
| 65 | import static org.easymock.EasyMock.reset; |
| 66 | import static org.easymock.EasyMock.verify; |
Jonathan Hart | 33b81f2 | 2016-02-05 09:25:50 -0800 | [diff] [blame] | 67 | import static org.onosproject.routing.TestIntentServiceHelper.eqExceptId; |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 68 | |
| 69 | /** |
Jonathan Hart | 5137218 | 2014-12-03 21:32:34 -0800 | [diff] [blame] | 70 | * Unit tests for PeerConnectivityManager. |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 71 | */ |
Brian O'Connor | 520c052 | 2014-11-23 23:50:47 -0800 | [diff] [blame] | 72 | public class PeerConnectivityManagerTest extends AbstractIntentTest { |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 73 | |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 74 | private static final ApplicationId APPID = TestApplicationId.create("foo"); |
Thomas Vachuska | b97cf28 | 2014-10-20 23:31:12 -0700 | [diff] [blame] | 75 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 76 | private static final ApplicationId CONFIG_APP_ID = APPID; |
| 77 | |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 78 | private PeerConnectivityManager peerConnectivityManager; |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 79 | private IntentSynchronizationService intentSynchronizer; |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 80 | private InterfaceService interfaceService; |
| 81 | private NetworkConfigService networkConfigService; |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 82 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 83 | private Set<BgpConfig.BgpSpeakerConfig> bgpSpeakers; |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 84 | private Map<String, Interface> interfaces; |
| 85 | private Map<IpAddress, BgpPeer> peers; |
| 86 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 87 | private BgpConfig bgpConfig; |
| 88 | |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 89 | private List<PointToPointIntent> intentList; |
| 90 | |
| 91 | private final String dpid1 = "00:00:00:00:00:00:00:01"; |
| 92 | private final String dpid2 = "00:00:00:00:00:00:00:02"; |
| 93 | |
| 94 | private final DeviceId deviceId1 = |
| 95 | DeviceId.deviceId(SdnIp.dpidToUri(dpid1)); |
| 96 | private final DeviceId deviceId2 = |
| 97 | DeviceId.deviceId(SdnIp.dpidToUri(dpid2)); |
| 98 | |
| 99 | // Interfaces connected to BGP speakers |
| 100 | private final ConnectPoint s1Eth100 = |
| 101 | new ConnectPoint(deviceId1, PortNumber.portNumber(100)); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 102 | |
| 103 | // Interfaces connected to BGP peers |
| 104 | private final ConnectPoint s1Eth1 = |
| 105 | new ConnectPoint(deviceId1, PortNumber.portNumber(1)); |
| 106 | private final ConnectPoint s2Eth1 = |
| 107 | new ConnectPoint(deviceId2, PortNumber.portNumber(1)); |
| 108 | |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 109 | private final TrafficTreatment noTreatment = |
Brian O'Connor | 6b52813 | 2015-03-10 16:39:52 -0700 | [diff] [blame] | 110 | DefaultTrafficTreatment.emptyTreatment(); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 111 | |
| 112 | @Before |
| 113 | public void setUp() throws Exception { |
Brian O'Connor | 520c052 | 2014-11-23 23:50:47 -0800 | [diff] [blame] | 114 | super.setUp(); |
Jonathan Hart | b14221c | 2016-03-07 09:55:50 -0800 | [diff] [blame^] | 115 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 116 | interfaceService = createMock(InterfaceService.class); |
Jonathan Hart | b14221c | 2016-03-07 09:55:50 -0800 | [diff] [blame^] | 117 | interfaceService.addListener(anyObject(InterfaceListener.class)); |
| 118 | expectLastCall().anyTimes(); |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 119 | networkConfigService = createMock(NetworkConfigService.class); |
Jonathan Hart | 08105be | 2015-10-10 18:31:06 -0700 | [diff] [blame] | 120 | networkConfigService.addListener(anyObject(NetworkConfigListener.class)); |
| 121 | expectLastCall().anyTimes(); |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 122 | bgpConfig = createMock(BgpConfig.class); |
Jonathan Hart | 90a02c2 | 2015-02-13 11:52:07 -0800 | [diff] [blame] | 123 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 124 | // These will set expectations on routingConfig and interfaceService |
| 125 | bgpSpeakers = setUpBgpSpeakers(); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 126 | interfaces = Collections.unmodifiableMap(setUpInterfaces()); |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 127 | peers = setUpPeers(); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 128 | |
| 129 | initPeerConnectivity(); |
| 130 | intentList = setUpIntentList(); |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * Sets up BGP speakers. |
| 135 | * |
| 136 | * @return configured BGP speakers as a map from speaker name to speaker |
| 137 | */ |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 138 | private Set<BgpConfig.BgpSpeakerConfig> setUpBgpSpeakers() { |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 139 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 140 | BgpConfig.BgpSpeakerConfig speaker1 = new BgpConfig.BgpSpeakerConfig( |
Jonathan Hart | a862548 | 2015-09-08 16:14:56 -0700 | [diff] [blame] | 141 | Optional.empty(), |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 142 | s1Eth100, Collections.singleton(IpAddress.valueOf("192.168.10.1"))); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 143 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 144 | BgpConfig.BgpSpeakerConfig speaker2 = new BgpConfig.BgpSpeakerConfig( |
Jonathan Hart | a862548 | 2015-09-08 16:14:56 -0700 | [diff] [blame] | 145 | Optional.empty(), |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 146 | s1Eth100, Sets.newHashSet(IpAddress.valueOf("192.168.20.1"), |
| 147 | IpAddress.valueOf("192.168.30.1"))); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 148 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 149 | Set<BgpConfig.BgpSpeakerConfig> bgpSpeakers = Sets.newHashSet(); |
| 150 | bgpSpeakers.add(speaker1); |
| 151 | bgpSpeakers.add(speaker2); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 152 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 153 | return bgpSpeakers; |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | /** |
| 157 | * Sets up logical interfaces, which emulate the configured interfaces |
| 158 | * in SDN-IP application. |
| 159 | * |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 160 | * @return configured interfaces as a map from interface name to Interface |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 161 | */ |
| 162 | private Map<String, Interface> setUpInterfaces() { |
| 163 | |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 164 | Map<String, Interface> configuredInterfaces = new HashMap<>(); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 165 | |
| 166 | String interfaceSw1Eth1 = "s1-eth1"; |
Pavlin Radoslavov | 76b0ae2 | 2014-10-27 15:33:19 -0700 | [diff] [blame] | 167 | InterfaceIpAddress ia1 = |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 168 | new InterfaceIpAddress(IpAddress.valueOf("192.168.10.101"), |
Pavlin Radoslavov | 76b0ae2 | 2014-10-27 15:33:19 -0700 | [diff] [blame] | 169 | IpPrefix.valueOf("192.168.10.0/24")); |
Jonathan Hart | b14221c | 2016-03-07 09:55:50 -0800 | [diff] [blame^] | 170 | Interface intfsw1eth1 = new Interface(interfaceSw1Eth1, s1Eth1, |
Jonathan Hart | 00cddda | 2016-02-16 10:30:37 -0800 | [diff] [blame] | 171 | Collections.singletonList(ia1), |
Jonathan Hart | 6cd2f35 | 2015-01-13 17:44:45 -0800 | [diff] [blame] | 172 | MacAddress.valueOf("00:00:00:00:00:01"), |
| 173 | VlanId.NONE); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 174 | |
| 175 | configuredInterfaces.put(interfaceSw1Eth1, intfsw1eth1); |
| 176 | String interfaceSw2Eth1 = "s2-eth1"; |
Pavlin Radoslavov | 76b0ae2 | 2014-10-27 15:33:19 -0700 | [diff] [blame] | 177 | InterfaceIpAddress ia2 = |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 178 | new InterfaceIpAddress(IpAddress.valueOf("192.168.20.101"), |
Pavlin Radoslavov | 76b0ae2 | 2014-10-27 15:33:19 -0700 | [diff] [blame] | 179 | IpPrefix.valueOf("192.168.20.0/24")); |
Jonathan Hart | b14221c | 2016-03-07 09:55:50 -0800 | [diff] [blame^] | 180 | Interface intfsw2eth1 = new Interface(interfaceSw2Eth1, s2Eth1, |
Jonathan Hart | 00cddda | 2016-02-16 10:30:37 -0800 | [diff] [blame] | 181 | Collections.singletonList(ia2), |
Jonathan Hart | 6cd2f35 | 2015-01-13 17:44:45 -0800 | [diff] [blame] | 182 | MacAddress.valueOf("00:00:00:00:00:02"), |
| 183 | VlanId.NONE); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 184 | configuredInterfaces.put(interfaceSw2Eth1, intfsw2eth1); |
| 185 | |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 186 | String interfaceSw2Eth1intf2 = "s2-eth1_2"; |
| 187 | InterfaceIpAddress ia3 = |
| 188 | new InterfaceIpAddress(IpAddress.valueOf("192.168.30.101"), |
| 189 | IpPrefix.valueOf("192.168.30.0/24")); |
Jonathan Hart | b14221c | 2016-03-07 09:55:50 -0800 | [diff] [blame^] | 190 | Interface intfsw2eth1intf2 = new Interface(interfaceSw2Eth1intf2, s2Eth1, |
Jonathan Hart | 00cddda | 2016-02-16 10:30:37 -0800 | [diff] [blame] | 191 | Collections.singletonList(ia3), |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 192 | MacAddress.valueOf("00:00:00:00:00:03"), |
| 193 | VlanId.NONE); |
| 194 | configuredInterfaces.put(interfaceSw2Eth1intf2, intfsw2eth1intf2); |
| 195 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 196 | expect(interfaceService.getInterfacesByPort(s1Eth1)) |
| 197 | .andReturn(Collections.singleton(intfsw1eth1)).anyTimes(); |
| 198 | expect(interfaceService.getInterfacesByIp(IpAddress.valueOf("192.168.10.101"))) |
| 199 | .andReturn(Collections.singleton(intfsw1eth1)).anyTimes(); |
| 200 | expect(interfaceService.getMatchingInterface(IpAddress.valueOf("192.168.10.1"))) |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 201 | .andReturn(intfsw1eth1).anyTimes(); |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 202 | expect(interfaceService.getInterfacesByPort(s2Eth1)) |
| 203 | .andReturn(Collections.singleton(intfsw2eth1)).anyTimes(); |
| 204 | expect(interfaceService.getInterfacesByIp(IpAddress.valueOf("192.168.20.101"))) |
| 205 | .andReturn(Collections.singleton(intfsw2eth1)).anyTimes(); |
| 206 | expect(interfaceService.getMatchingInterface(IpAddress.valueOf("192.168.20.1"))) |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 207 | .andReturn(intfsw2eth1).anyTimes(); |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 208 | |
| 209 | expect(interfaceService.getInterfacesByIp(IpAddress.valueOf("192.168.30.101"))) |
| 210 | .andReturn(Collections.singleton(intfsw2eth1intf2)).anyTimes(); |
| 211 | expect(interfaceService.getMatchingInterface(IpAddress.valueOf("192.168.30.1"))) |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 212 | .andReturn(intfsw2eth1intf2).anyTimes(); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 213 | |
| 214 | // Non-existent interface used during one of the tests |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 215 | expect(interfaceService.getInterfacesByPort(new ConnectPoint( |
| 216 | DeviceId.deviceId(SdnIp.dpidToUri("00:00:00:00:00:00:01:00")), |
| 217 | PortNumber.portNumber(1)))) |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 218 | .andReturn(null).anyTimes(); |
| 219 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 220 | expect(interfaceService.getInterfaces()).andReturn( |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 221 | Sets.newHashSet(configuredInterfaces.values())).anyTimes(); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 222 | |
| 223 | return configuredInterfaces; |
| 224 | } |
| 225 | |
| 226 | /** |
| 227 | * Sets up BGP daemon peers. |
| 228 | * |
| 229 | * @return configured BGP peers as a MAP from peer IP address to BgpPeer |
| 230 | */ |
| 231 | private Map<IpAddress, BgpPeer> setUpPeers() { |
| 232 | |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 233 | Map<IpAddress, BgpPeer> configuredPeers = new HashMap<>(); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 234 | |
| 235 | String peerSw1Eth1 = "192.168.10.1"; |
| 236 | configuredPeers.put(IpAddress.valueOf(peerSw1Eth1), |
| 237 | new BgpPeer(dpid1, 1, peerSw1Eth1)); |
| 238 | |
| 239 | // Two BGP peers are connected to switch 2 port 1. |
| 240 | String peer1Sw2Eth1 = "192.168.20.1"; |
| 241 | configuredPeers.put(IpAddress.valueOf(peer1Sw2Eth1), |
| 242 | new BgpPeer(dpid2, 1, peer1Sw2Eth1)); |
| 243 | |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 244 | String peer2Sw2Eth1 = "192.168.30.1"; |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 245 | configuredPeers.put(IpAddress.valueOf(peer2Sw2Eth1), |
| 246 | new BgpPeer(dpid2, 1, peer2Sw2Eth1)); |
| 247 | |
| 248 | return configuredPeers; |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * Sets up expected point to point intent list. |
| 253 | * |
| 254 | * @return point to point intent list |
| 255 | */ |
| 256 | private List<PointToPointIntent> setUpIntentList() { |
Jonathan Hart | 90a02c2 | 2015-02-13 11:52:07 -0800 | [diff] [blame] | 257 | intentList = new ArrayList<>(); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 258 | |
| 259 | setUpBgpIntents(); |
| 260 | setUpIcmpIntents(); |
| 261 | |
| 262 | return intentList; |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | /** |
| 266 | * Constructs a BGP intent and put it into the intentList. |
| 267 | * <p/> |
| 268 | * The purpose of this method is too simplify the setUpBgpIntents() method, |
| 269 | * and to make the setUpBgpIntents() easy to read. |
| 270 | * |
| 271 | * @param srcPrefix source IP prefix to match |
| 272 | * @param dstPrefix destination IP prefix to match |
| 273 | * @param srcTcpPort source TCP port to match |
| 274 | * @param dstTcpPort destination TCP port to match |
| 275 | * @param srcConnectPoint source connect point for PointToPointIntent |
| 276 | * @param dstConnectPoint destination connect point for PointToPointIntent |
| 277 | */ |
| 278 | private void bgpPathintentConstructor(String srcPrefix, String dstPrefix, |
| 279 | Short srcTcpPort, Short dstTcpPort, |
| 280 | ConnectPoint srcConnectPoint, ConnectPoint dstConnectPoint) { |
| 281 | |
| 282 | TrafficSelector.Builder builder = DefaultTrafficSelector.builder() |
| 283 | .matchEthType(Ethernet.TYPE_IPV4) |
| 284 | .matchIPProtocol(IPv4.PROTOCOL_TCP) |
| 285 | .matchIPSrc(IpPrefix.valueOf(srcPrefix)) |
| 286 | .matchIPDst(IpPrefix.valueOf(dstPrefix)); |
| 287 | |
| 288 | if (srcTcpPort != null) { |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 289 | builder.matchTcpSrc(TpPort.tpPort(srcTcpPort)); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 290 | } |
| 291 | if (dstTcpPort != null) { |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 292 | builder.matchTcpDst(TpPort.tpPort(dstTcpPort)); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 293 | } |
| 294 | |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 295 | Key key = Key.of(srcPrefix.split("/")[0] + "-" + dstPrefix.split("/")[0] |
| 296 | + "-" + ((srcTcpPort == null) ? "dst" : "src"), APPID); |
| 297 | |
Ray Milkey | 3e3ec5f | 2015-03-17 17:00:38 -0700 | [diff] [blame] | 298 | PointToPointIntent intent = PointToPointIntent.builder() |
| 299 | .appId(APPID) |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 300 | .key(key) |
Ray Milkey | 3e3ec5f | 2015-03-17 17:00:38 -0700 | [diff] [blame] | 301 | .selector(builder.build()) |
| 302 | .treatment(noTreatment) |
| 303 | .ingressPoint(srcConnectPoint) |
| 304 | .egressPoint(dstConnectPoint) |
| 305 | .build(); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 306 | |
| 307 | intentList.add(intent); |
| 308 | } |
| 309 | |
| 310 | /** |
| 311 | * Sets up intents for BGP paths. |
| 312 | */ |
| 313 | private void setUpBgpIntents() { |
| 314 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 315 | Short bgpPort = 179; |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 316 | |
| 317 | // Start to build intents between BGP speaker1 and BGP peer1 |
| 318 | bgpPathintentConstructor( |
| 319 | "192.168.10.101/32", "192.168.10.1/32", null, bgpPort, |
| 320 | s1Eth100, s1Eth1); |
| 321 | bgpPathintentConstructor( |
| 322 | "192.168.10.101/32", "192.168.10.1/32", bgpPort, null, |
| 323 | s1Eth100, s1Eth1); |
| 324 | |
| 325 | bgpPathintentConstructor( |
| 326 | "192.168.10.1/32", "192.168.10.101/32", null, bgpPort, |
| 327 | s1Eth1, s1Eth100); |
| 328 | bgpPathintentConstructor( |
| 329 | "192.168.10.1/32", "192.168.10.101/32", bgpPort, null, |
| 330 | s1Eth1, s1Eth100); |
| 331 | |
| 332 | // Start to build intents between BGP speaker1 and BGP peer2 |
| 333 | bgpPathintentConstructor( |
| 334 | "192.168.20.101/32", "192.168.20.1/32", null, bgpPort, |
| 335 | s1Eth100, s2Eth1); |
| 336 | bgpPathintentConstructor( |
| 337 | "192.168.20.101/32", "192.168.20.1/32", bgpPort, null, |
| 338 | s1Eth100, s2Eth1); |
| 339 | |
| 340 | bgpPathintentConstructor( |
| 341 | "192.168.20.1/32", "192.168.20.101/32", null, bgpPort, |
| 342 | s2Eth1, s1Eth100); |
| 343 | bgpPathintentConstructor( |
| 344 | "192.168.20.1/32", "192.168.20.101/32", bgpPort, null, |
| 345 | s2Eth1, s1Eth100); |
| 346 | |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 347 | // |
| 348 | // Start to build intents between BGP speaker3 and BGP peer1 |
| 349 | bgpPathintentConstructor( |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 350 | "192.168.30.101/32", "192.168.30.1/32", null, bgpPort, |
| 351 | s1Eth100, s2Eth1); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 352 | bgpPathintentConstructor( |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 353 | "192.168.30.101/32", "192.168.30.1/32", bgpPort, null, |
| 354 | s1Eth100, s2Eth1); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 355 | |
| 356 | bgpPathintentConstructor( |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 357 | "192.168.30.1/32", "192.168.30.101/32", null, bgpPort, |
| 358 | s2Eth1, s1Eth100); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 359 | bgpPathintentConstructor( |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 360 | "192.168.30.1/32", "192.168.30.101/32", bgpPort, null, |
| 361 | s2Eth1, s1Eth100); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 362 | } |
| 363 | |
| 364 | /** |
| 365 | * Constructs a BGP intent and put it into the intentList. |
| 366 | * <p/> |
| 367 | * The purpose of this method is too simplify the setUpBgpIntents() method, |
| 368 | * and to make the setUpBgpIntents() easy to read. |
| 369 | * |
| 370 | * @param srcPrefix source IP prefix to match |
| 371 | * @param dstPrefix destination IP prefix to match |
| 372 | * @param srcConnectPoint source connect point for PointToPointIntent |
| 373 | * @param dstConnectPoint destination connect point for PointToPointIntent |
| 374 | */ |
| 375 | private void icmpPathintentConstructor(String srcPrefix, String dstPrefix, |
| 376 | ConnectPoint srcConnectPoint, ConnectPoint dstConnectPoint) { |
| 377 | |
| 378 | TrafficSelector selector = DefaultTrafficSelector.builder() |
| 379 | .matchEthType(Ethernet.TYPE_IPV4) |
| 380 | .matchIPProtocol(IPv4.PROTOCOL_ICMP) |
| 381 | .matchIPSrc(IpPrefix.valueOf(srcPrefix)) |
| 382 | .matchIPDst(IpPrefix.valueOf(dstPrefix)) |
| 383 | .build(); |
| 384 | |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 385 | Key key = Key.of(srcPrefix.split("/")[0] + "-" + dstPrefix.split("/")[0] |
| 386 | + "-" + "icmp", APPID); |
| 387 | |
Ray Milkey | 3e3ec5f | 2015-03-17 17:00:38 -0700 | [diff] [blame] | 388 | PointToPointIntent intent = PointToPointIntent.builder() |
| 389 | .appId(APPID) |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 390 | .key(key) |
Ray Milkey | 3e3ec5f | 2015-03-17 17:00:38 -0700 | [diff] [blame] | 391 | .selector(selector) |
| 392 | .treatment(noTreatment) |
| 393 | .ingressPoint(srcConnectPoint) |
| 394 | .egressPoint(dstConnectPoint) |
| 395 | .build(); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 396 | |
| 397 | intentList.add(intent); |
| 398 | } |
| 399 | |
| 400 | /** |
| 401 | * Sets up intents for ICMP paths. |
| 402 | */ |
| 403 | private void setUpIcmpIntents() { |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 404 | // Start to build intents between BGP speaker1 and BGP peer1 |
| 405 | icmpPathintentConstructor( |
| 406 | "192.168.10.101/32", "192.168.10.1/32", s1Eth100, s1Eth1); |
| 407 | icmpPathintentConstructor( |
| 408 | "192.168.10.1/32", "192.168.10.101/32", s1Eth1, s1Eth100); |
| 409 | |
| 410 | // Start to build intents between BGP speaker1 and BGP peer2 |
| 411 | icmpPathintentConstructor( |
| 412 | "192.168.20.101/32", "192.168.20.1/32", s1Eth100, s2Eth1); |
| 413 | icmpPathintentConstructor( |
| 414 | "192.168.20.1/32", "192.168.20.101/32", s2Eth1, s1Eth100); |
| 415 | |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 416 | icmpPathintentConstructor( |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 417 | "192.168.30.101/32", "192.168.30.1/32", s1Eth100, s2Eth1); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 418 | icmpPathintentConstructor( |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 419 | "192.168.30.1/32", "192.168.30.101/32", s2Eth1, s1Eth100); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 420 | } |
| 421 | |
| 422 | /** |
| 423 | * Initializes peer connectivity testing environment. |
Pavlin Radoslavov | a7243cc | 2014-11-22 21:38:02 -0800 | [diff] [blame] | 424 | * |
| 425 | * @throws TestUtilsException if exceptions when using TestUtils |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 426 | */ |
Pavlin Radoslavov | a7243cc | 2014-11-22 21:38:02 -0800 | [diff] [blame] | 427 | private void initPeerConnectivity() throws TestUtilsException { |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 428 | expect(bgpConfig.bgpSpeakers()).andReturn(bgpSpeakers).anyTimes(); |
| 429 | replay(bgpConfig); |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 430 | expect(networkConfigService.getConfig(APPID, BgpConfig.class)) |
| 431 | .andReturn(bgpConfig).anyTimes(); |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 432 | replay(networkConfigService); |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 433 | replay(interfaceService); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 434 | |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 435 | intentSynchronizer = createMock(IntentSynchronizationService.class); |
| 436 | replay(intentSynchronizer); |
Pavlin Radoslavov | a7243cc | 2014-11-22 21:38:02 -0800 | [diff] [blame] | 437 | |
| 438 | peerConnectivityManager = |
| 439 | new PeerConnectivityManager(APPID, intentSynchronizer, |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 440 | networkConfigService, |
| 441 | CONFIG_APP_ID, |
| 442 | interfaceService); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 443 | } |
| 444 | |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 445 | /** |
| 446 | * Tests whether peer connectivity manager can set up correct BGP and |
| 447 | * ICMP intents according to specific configuration. |
| 448 | * <p/> |
| 449 | * Two tricky cases included in the configuration are: 2 peers on a same |
| 450 | * switch port, peer on the same switch with BGPd. |
| 451 | */ |
| 452 | @Test |
| 453 | public void testConnectionSetup() { |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 454 | reset(intentSynchronizer); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 455 | |
Pavlin Radoslavov | dde22ae | 2014-11-24 11:47:17 -0800 | [diff] [blame] | 456 | // Setup the expected intents |
Pavlin Radoslavov | dde22ae | 2014-11-24 11:47:17 -0800 | [diff] [blame] | 457 | for (Intent intent : intentList) { |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 458 | intentSynchronizer.submit(eqExceptId(intent)); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 459 | } |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 460 | replay(intentSynchronizer); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 461 | |
| 462 | // Running the interface to be tested. |
| 463 | peerConnectivityManager.start(); |
| 464 | |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 465 | verify(intentSynchronizer); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 466 | } |
| 467 | |
| 468 | /** |
| 469 | * Tests a corner case, when there are no interfaces in the configuration. |
| 470 | */ |
| 471 | @Test |
| 472 | public void testNullInterfaces() { |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 473 | reset(interfaceService); |
Jonathan Hart | b14221c | 2016-03-07 09:55:50 -0800 | [diff] [blame^] | 474 | interfaceService.addListener(anyObject(InterfaceListener.class)); |
| 475 | expectLastCall().anyTimes(); |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 476 | |
| 477 | expect(interfaceService.getInterfaces()).andReturn( |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 478 | Sets.newHashSet()).anyTimes(); |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 479 | expect(interfaceService.getInterfacesByPort(s2Eth1)) |
| 480 | .andReturn(Collections.emptySet()).anyTimes(); |
| 481 | expect(interfaceService.getInterfacesByPort(s1Eth1)) |
| 482 | .andReturn(Collections.emptySet()).anyTimes(); |
| 483 | expect(interfaceService.getInterfacesByIp(IpAddress.valueOf("192.168.10.101"))) |
| 484 | .andReturn(Collections.emptySet()).anyTimes(); |
| 485 | expect(interfaceService.getMatchingInterface(IpAddress.valueOf("192.168.10.1"))) |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 486 | .andReturn(null).anyTimes(); |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 487 | expect(interfaceService.getInterfacesByIp(IpAddress.valueOf("192.168.20.101"))) |
| 488 | .andReturn(Collections.emptySet()).anyTimes(); |
| 489 | expect(interfaceService.getMatchingInterface(IpAddress.valueOf("192.168.20.1"))) |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 490 | .andReturn(null).anyTimes(); |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 491 | expect(interfaceService.getInterfacesByIp(IpAddress.valueOf("192.168.30.101"))) |
| 492 | .andReturn(Collections.emptySet()).anyTimes(); |
| 493 | expect(interfaceService.getMatchingInterface(IpAddress.valueOf("192.168.30.1"))) |
Jonathan Hart | e30fcda | 2015-08-06 16:22:34 -0700 | [diff] [blame] | 494 | .andReturn(null).anyTimes(); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 495 | |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 496 | replay(interfaceService); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 497 | |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 498 | reset(intentSynchronizer); |
| 499 | replay(intentSynchronizer); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 500 | peerConnectivityManager.start(); |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 501 | verify(intentSynchronizer); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 502 | } |
| 503 | |
| 504 | /** |
| 505 | * Tests a corner case, when there is no BGP speakers in the configuration. |
| 506 | */ |
| 507 | @Test |
| 508 | public void testNullBgpSpeakers() { |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 509 | reset(bgpConfig); |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 510 | expect(bgpConfig.bgpSpeakers()).andReturn(Collections.emptySet()).anyTimes(); |
| 511 | replay(bgpConfig); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 512 | |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 513 | reset(intentSynchronizer); |
| 514 | replay(intentSynchronizer); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 515 | peerConnectivityManager.start(); |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 516 | verify(intentSynchronizer); |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 517 | } |
| 518 | |
| 519 | /** |
| 520 | * Tests a corner case, when there is no Interface configured for one BGP |
| 521 | * peer. |
| 522 | */ |
| 523 | @Test |
| 524 | public void testNoPeerInterface() { |
| 525 | String peerSw100Eth1 = "192.168.200.1"; |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 526 | peers.put(IpAddress.valueOf(peerSw100Eth1), |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 527 | new BgpPeer("00:00:00:00:00:00:01:00", 1, peerSw100Eth1)); |
| 528 | testConnectionSetup(); |
| 529 | } |
| 530 | |
Jonathan Hart | ce430a4 | 2014-10-16 20:44:29 -0700 | [diff] [blame] | 531 | } |