alshabib | ab98466 | 2014-12-04 18:56:18 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Open Networking Laboratory |
| 3 | * |
| 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 |
| 7 | * |
| 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. |
| 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.sdnip; |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 17 | |
Jonathan Hart | 552e31f | 2015-02-06 11:11:59 -0800 | [diff] [blame] | 18 | import com.google.common.collect.Sets; |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 19 | import org.junit.Before; |
| 20 | import org.junit.Test; |
| 21 | import org.onlab.junit.TestUtils; |
| 22 | import org.onlab.junit.TestUtils.TestUtilsException; |
Jonathan Hart | 6cd2f35 | 2015-01-13 17:44:45 -0800 | [diff] [blame] | 23 | import org.onlab.packet.Ethernet; |
| 24 | import org.onlab.packet.Ip4Address; |
| 25 | import org.onlab.packet.Ip4Prefix; |
| 26 | import org.onlab.packet.IpAddress; |
| 27 | import org.onlab.packet.IpPrefix; |
| 28 | import org.onlab.packet.MacAddress; |
| 29 | import org.onlab.packet.VlanId; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 30 | import org.onosproject.core.ApplicationId; |
| 31 | import org.onosproject.net.ConnectPoint; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 32 | import org.onosproject.net.DeviceId; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 33 | import org.onosproject.net.PortNumber; |
| 34 | import org.onosproject.net.flow.DefaultTrafficSelector; |
| 35 | import org.onosproject.net.flow.DefaultTrafficTreatment; |
| 36 | import org.onosproject.net.flow.TrafficSelector; |
| 37 | import org.onosproject.net.flow.TrafficTreatment; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 38 | import org.onosproject.net.host.InterfaceIpAddress; |
| 39 | import org.onosproject.net.intent.AbstractIntentTest; |
| 40 | import org.onosproject.net.intent.Intent; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 41 | import org.onosproject.net.intent.IntentService; |
| 42 | import org.onosproject.net.intent.IntentState; |
| 43 | import org.onosproject.net.intent.MultiPointToSinglePointIntent; |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 44 | import org.onosproject.routingapi.FibEntry; |
| 45 | import org.onosproject.routingapi.FibUpdate; |
| 46 | import org.onosproject.routingapi.RouteEntry; |
| 47 | import org.onosproject.sdnip.IntentSynchronizer.IntentKey; |
| 48 | import org.onosproject.sdnip.config.BgpPeer; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 49 | import org.onosproject.sdnip.config.Interface; |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 50 | import org.onosproject.sdnip.config.SdnIpConfigurationService; |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 51 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 52 | import java.util.Collections; |
| 53 | import java.util.HashMap; |
Jonathan Hart | 552e31f | 2015-02-06 11:11:59 -0800 | [diff] [blame] | 54 | import java.util.HashSet; |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 55 | import java.util.Map; |
Jonathan Hart | 552e31f | 2015-02-06 11:11:59 -0800 | [diff] [blame] | 56 | import java.util.Set; |
| 57 | import java.util.concurrent.ConcurrentHashMap; |
| 58 | |
| 59 | import static org.easymock.EasyMock.*; |
| 60 | import static org.hamcrest.Matchers.is; |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 61 | import static org.junit.Assert.*; |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 62 | |
| 63 | /** |
Pavlin Radoslavov | a071b1e | 2014-11-17 13:37:57 -0800 | [diff] [blame] | 64 | * This class tests the intent synchronization function in the |
| 65 | * IntentSynchronizer class. |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 66 | */ |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 67 | @Ignore //FIXME |
Brian O'Connor | 520c052 | 2014-11-23 23:50:47 -0800 | [diff] [blame] | 68 | public class IntentSyncTest extends AbstractIntentTest { |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 69 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 70 | private SdnIpConfigurationService sdnIpConfigService; |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 71 | private InterfaceService interfaceService; |
| 72 | private IntentService intentService; |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 73 | |
| 74 | private static final ConnectPoint SW1_ETH1 = new ConnectPoint( |
| 75 | DeviceId.deviceId("of:0000000000000001"), |
| 76 | PortNumber.portNumber(1)); |
| 77 | |
| 78 | private static final ConnectPoint SW2_ETH1 = new ConnectPoint( |
| 79 | DeviceId.deviceId("of:0000000000000002"), |
| 80 | PortNumber.portNumber(1)); |
| 81 | |
| 82 | private static final ConnectPoint SW3_ETH1 = new ConnectPoint( |
| 83 | DeviceId.deviceId("of:0000000000000003"), |
| 84 | PortNumber.portNumber(1)); |
| 85 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 86 | private static final ConnectPoint SW4_ETH1 = new ConnectPoint( |
| 87 | DeviceId.deviceId("of:0000000000000004"), |
| 88 | PortNumber.portNumber(1)); |
| 89 | |
Pavlin Radoslavov | a071b1e | 2014-11-17 13:37:57 -0800 | [diff] [blame] | 90 | private IntentSynchronizer intentSynchronizer; |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 91 | |
| 92 | private static final ApplicationId APPID = new ApplicationId() { |
| 93 | @Override |
| 94 | public short id() { |
| 95 | return 1; |
| 96 | } |
| 97 | |
| 98 | @Override |
| 99 | public String name() { |
| 100 | return "SDNIP"; |
| 101 | } |
| 102 | }; |
| 103 | |
| 104 | @Before |
| 105 | public void setUp() throws Exception { |
Brian O'Connor | 520c052 | 2014-11-23 23:50:47 -0800 | [diff] [blame] | 106 | super.setUp(); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 107 | setUpInterfaceService(); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 108 | |
| 109 | setUpBgpPeers(); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 110 | intentService = createMock(IntentService.class); |
| 111 | |
Jonathan Hart | 552e31f | 2015-02-06 11:11:59 -0800 | [diff] [blame] | 112 | intentSynchronizer = new IntentSynchronizer(APPID, intentService, |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 113 | sdnIpConfigService, interfaceService); |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Sets up BGP peers in external networks. |
| 118 | */ |
| 119 | private void setUpBgpPeers() { |
| 120 | |
| 121 | Map<IpAddress, BgpPeer> peers = new HashMap<>(); |
| 122 | |
| 123 | String peerSw1Eth1 = "192.168.10.1"; |
| 124 | peers.put(IpAddress.valueOf(peerSw1Eth1), |
| 125 | new BgpPeer("00:00:00:00:00:00:00:01", 1, peerSw1Eth1)); |
| 126 | |
| 127 | // Two BGP peers are connected to switch 2 port 1. |
| 128 | String peer1Sw2Eth1 = "192.168.20.1"; |
| 129 | peers.put(IpAddress.valueOf(peer1Sw2Eth1), |
| 130 | new BgpPeer("00:00:00:00:00:00:00:02", 1, peer1Sw2Eth1)); |
| 131 | |
| 132 | String peer2Sw2Eth1 = "192.168.20.2"; |
| 133 | peers.put(IpAddress.valueOf(peer2Sw2Eth1), |
| 134 | new BgpPeer("00:00:00:00:00:00:00:02", 1, peer2Sw2Eth1)); |
| 135 | |
| 136 | String peer1Sw4Eth1 = "192.168.40.1"; |
| 137 | peers.put(IpAddress.valueOf(peer1Sw4Eth1), |
| 138 | new BgpPeer("00:00:00:00:00:00:00:04", 1, peer1Sw4Eth1)); |
| 139 | |
| 140 | sdnIpConfigService = createMock(SdnIpConfigurationService.class); |
| 141 | expect(sdnIpConfigService.getBgpPeers()).andReturn(peers).anyTimes(); |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 142 | replay(sdnIpConfigService); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 143 | |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Sets up InterfaceService. |
| 148 | */ |
| 149 | private void setUpInterfaceService() { |
| 150 | |
| 151 | interfaceService = createMock(InterfaceService.class); |
| 152 | |
| 153 | Set<Interface> interfaces = Sets.newHashSet(); |
| 154 | |
| 155 | Set<InterfaceIpAddress> interfaceIpAddresses1 = Sets.newHashSet(); |
| 156 | interfaceIpAddresses1.add(new InterfaceIpAddress( |
| 157 | IpAddress.valueOf("192.168.10.101"), |
| 158 | IpPrefix.valueOf("192.168.10.0/24"))); |
| 159 | Interface sw1Eth1 = new Interface(SW1_ETH1, |
Jonathan Hart | 6cd2f35 | 2015-01-13 17:44:45 -0800 | [diff] [blame] | 160 | interfaceIpAddresses1, MacAddress.valueOf("00:00:00:00:00:01"), |
| 161 | VlanId.NONE); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 162 | interfaces.add(sw1Eth1); |
| 163 | |
| 164 | Set<InterfaceIpAddress> interfaceIpAddresses2 = Sets.newHashSet(); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 165 | interfaceIpAddresses2.add( |
| 166 | new InterfaceIpAddress(IpAddress.valueOf("192.168.20.101"), |
| 167 | IpPrefix.valueOf("192.168.20.0/24"))); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 168 | Interface sw2Eth1 = new Interface(SW2_ETH1, |
Jonathan Hart | 6cd2f35 | 2015-01-13 17:44:45 -0800 | [diff] [blame] | 169 | interfaceIpAddresses2, MacAddress.valueOf("00:00:00:00:00:02"), |
| 170 | VlanId.NONE); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 171 | interfaces.add(sw2Eth1); |
| 172 | |
| 173 | Set<InterfaceIpAddress> interfaceIpAddresses3 = Sets.newHashSet(); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 174 | interfaceIpAddresses3.add( |
| 175 | new InterfaceIpAddress(IpAddress.valueOf("192.168.30.101"), |
| 176 | IpPrefix.valueOf("192.168.30.0/24"))); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 177 | Interface sw3Eth1 = new Interface(SW3_ETH1, |
Jonathan Hart | 6cd2f35 | 2015-01-13 17:44:45 -0800 | [diff] [blame] | 178 | interfaceIpAddresses3, MacAddress.valueOf("00:00:00:00:00:03"), |
| 179 | VlanId.NONE); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 180 | interfaces.add(sw3Eth1); |
| 181 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 182 | InterfaceIpAddress interfaceIpAddress4 = |
| 183 | new InterfaceIpAddress(IpAddress.valueOf("192.168.40.101"), |
| 184 | IpPrefix.valueOf("192.168.40.0/24")); |
| 185 | Interface sw4Eth1 = new Interface(SW4_ETH1, |
| 186 | Sets.newHashSet(interfaceIpAddress4), |
| 187 | MacAddress.valueOf("00:00:00:00:00:04"), |
| 188 | VlanId.vlanId((short) 1)); |
| 189 | |
| 190 | expect(interfaceService.getInterface(SW4_ETH1)).andReturn(sw4Eth1).anyTimes(); |
| 191 | interfaces.add(sw4Eth1); |
| 192 | |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 193 | expect(interfaceService.getInterface(SW1_ETH1)).andReturn( |
| 194 | sw1Eth1).anyTimes(); |
| 195 | expect(interfaceService.getInterface(SW2_ETH1)).andReturn( |
| 196 | sw2Eth1).anyTimes(); |
| 197 | expect(interfaceService.getInterface(SW3_ETH1)).andReturn( |
| 198 | sw3Eth1).anyTimes(); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 199 | expect(interfaceService.getInterfaces()).andReturn(interfaces).anyTimes(); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 200 | replay(interfaceService); |
| 201 | } |
| 202 | |
| 203 | /** |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 204 | * Tests adding a FIB entry to the IntentSynchronizer. |
| 205 | * |
| 206 | * We verify that the synchronizer records the correct state and that the |
| 207 | * correct intent is submitted to the IntentService. |
| 208 | * |
| 209 | * @throws TestUtilsException |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 210 | */ |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 211 | @Test |
| 212 | public void testFibAdd() throws TestUtilsException { |
| 213 | FibEntry fibEntry = new FibEntry( |
| 214 | Ip4Prefix.valueOf("1.1.1.0/24"), |
| 215 | Ip4Address.valueOf("192.168.10.1"), |
| 216 | MacAddress.valueOf("00:00:00:00:00:01")); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 217 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 218 | // Construct a MultiPointToSinglePointIntent intent |
| 219 | TrafficSelector.Builder selectorBuilder = |
| 220 | DefaultTrafficSelector.builder(); |
| 221 | selectorBuilder.matchEthType(Ethernet.TYPE_IPV4).matchIPDst( |
| 222 | fibEntry.prefix()); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 223 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 224 | TrafficTreatment.Builder treatmentBuilder = |
| 225 | DefaultTrafficTreatment.builder(); |
| 226 | treatmentBuilder.setEthDst(MacAddress.valueOf("00:00:00:00:00:01")); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 227 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 228 | Set<ConnectPoint> ingressPoints = new HashSet<>(); |
| 229 | ingressPoints.add(SW2_ETH1); |
| 230 | ingressPoints.add(SW3_ETH1); |
| 231 | ingressPoints.add(SW4_ETH1); |
| 232 | |
| 233 | MultiPointToSinglePointIntent intent = |
| 234 | new MultiPointToSinglePointIntent(APPID, |
| 235 | selectorBuilder.build(), treatmentBuilder.build(), |
| 236 | ingressPoints, SW1_ETH1); |
| 237 | |
| 238 | // Setup the expected intents |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 239 | // FIXME Jono needs to refactor |
| 240 | // IntentOperations.Builder builder = IntentOperations.builder(APPID); |
| 241 | // builder.addSubmitOperation(intent); |
| 242 | // intentService.execute(TestIntentServiceHelper.eqExceptId( |
| 243 | // builder.build())); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 244 | replay(intentService); |
| 245 | |
| 246 | intentSynchronizer.leaderChanged(true); |
| 247 | TestUtils.setField(intentSynchronizer, "isActivatedLeader", true); |
| 248 | |
| 249 | FibUpdate fibUpdate = new FibUpdate(FibUpdate.Type.UPDATE, |
| 250 | fibEntry); |
| 251 | intentSynchronizer.update(Collections.singleton(fibUpdate), |
| 252 | Collections.emptyList()); |
| 253 | |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 254 | assertEquals(intentSynchronizer.getRouteIntents().size(), 1); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 255 | Intent firstIntent = |
| 256 | intentSynchronizer.getRouteIntents().iterator().next(); |
| 257 | IntentKey firstIntentKey = new IntentKey(firstIntent); |
| 258 | IntentKey intentKey = new IntentKey(intent); |
| 259 | assertTrue(firstIntentKey.equals(intentKey)); |
| 260 | verify(intentService); |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * Tests adding a FIB entry with to a next hop in a VLAN. |
| 265 | * |
| 266 | * We verify that the synchronizer records the correct state and that the |
| 267 | * correct intent is submitted to the IntentService. |
| 268 | * |
| 269 | * @throws TestUtilsException |
| 270 | */ |
| 271 | @Test |
| 272 | public void testFibAddWithVlan() throws TestUtilsException { |
| 273 | FibEntry fibEntry = new FibEntry( |
| 274 | Ip4Prefix.valueOf("3.3.3.0/24"), |
| 275 | Ip4Address.valueOf("192.168.40.1"), |
| 276 | MacAddress.valueOf("00:00:00:00:00:04")); |
| 277 | |
| 278 | // Construct a MultiPointToSinglePointIntent intent |
| 279 | TrafficSelector.Builder selectorBuilder = |
| 280 | DefaultTrafficSelector.builder(); |
| 281 | selectorBuilder.matchEthType(Ethernet.TYPE_IPV4) |
| 282 | .matchIPDst(fibEntry.prefix()) |
| 283 | .matchVlanId(VlanId.ANY); |
| 284 | |
| 285 | TrafficTreatment.Builder treatmentBuilder = |
| 286 | DefaultTrafficTreatment.builder(); |
| 287 | treatmentBuilder.setEthDst(MacAddress.valueOf("00:00:00:00:00:04")) |
| 288 | .setVlanId(VlanId.vlanId((short) 1)); |
| 289 | |
| 290 | Set<ConnectPoint> ingressPoints = new HashSet<>(); |
| 291 | ingressPoints.add(SW1_ETH1); |
| 292 | ingressPoints.add(SW2_ETH1); |
| 293 | ingressPoints.add(SW3_ETH1); |
| 294 | |
| 295 | MultiPointToSinglePointIntent intent = |
| 296 | new MultiPointToSinglePointIntent(APPID, |
| 297 | selectorBuilder.build(), treatmentBuilder.build(), |
| 298 | ingressPoints, SW4_ETH1); |
| 299 | |
| 300 | // Setup the expected intents |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 301 | // FIXME Jono needs to refactor |
| 302 | // IntentOperations.Builder builder = IntentOperations.builder(APPID); |
| 303 | // builder.addSubmitOperation(intent); |
| 304 | // intentService.execute( |
| 305 | // TestIntentServiceHelper.eqExceptId(builder.build())); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 306 | replay(intentService); |
| 307 | |
| 308 | // Run the test |
| 309 | intentSynchronizer.leaderChanged(true); |
| 310 | TestUtils.setField(intentSynchronizer, "isActivatedLeader", true); |
| 311 | FibUpdate fibUpdate = new FibUpdate(FibUpdate.Type.UPDATE, fibEntry); |
| 312 | |
| 313 | intentSynchronizer.update(Collections.singleton(fibUpdate), |
| 314 | Collections.emptyList()); |
| 315 | |
| 316 | // Verify |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 317 | assertEquals(intentSynchronizer.getRouteIntents().size(), 1); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 318 | Intent firstIntent = |
| 319 | intentSynchronizer.getRouteIntents().iterator().next(); |
| 320 | IntentKey firstIntentKey = new IntentKey(firstIntent); |
| 321 | IntentKey intentKey = new IntentKey(intent); |
| 322 | assertTrue(firstIntentKey.equals(intentKey)); |
| 323 | verify(intentService); |
| 324 | } |
| 325 | |
| 326 | /** |
| 327 | * Tests updating a FIB entry. |
| 328 | * |
| 329 | * We verify that the synchronizer records the correct state and that the |
| 330 | * correct intent is submitted to the IntentService. |
| 331 | * |
| 332 | * @throws TestUtilsException |
| 333 | */ |
| 334 | @Test |
| 335 | public void testFibUpdate() throws TestUtilsException { |
| 336 | // Firstly add a route |
| 337 | testFibAdd(); |
| 338 | |
| 339 | Intent addedIntent = |
| 340 | intentSynchronizer.getRouteIntents().iterator().next(); |
| 341 | |
| 342 | // Start to construct a new route entry and new intent |
| 343 | FibEntry fibEntryUpdate = new FibEntry( |
| 344 | Ip4Prefix.valueOf("1.1.1.0/24"), |
| 345 | Ip4Address.valueOf("192.168.20.1"), |
| 346 | MacAddress.valueOf("00:00:00:00:00:02")); |
| 347 | |
| 348 | // Construct a new MultiPointToSinglePointIntent intent |
| 349 | TrafficSelector.Builder selectorBuilderNew = |
| 350 | DefaultTrafficSelector.builder(); |
| 351 | selectorBuilderNew.matchEthType(Ethernet.TYPE_IPV4).matchIPDst( |
| 352 | fibEntryUpdate.prefix()); |
| 353 | |
| 354 | TrafficTreatment.Builder treatmentBuilderNew = |
| 355 | DefaultTrafficTreatment.builder(); |
| 356 | treatmentBuilderNew.setEthDst(MacAddress.valueOf("00:00:00:00:00:02")); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 357 | |
| 358 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 359 | Set<ConnectPoint> ingressPointsNew = new HashSet<>(); |
| 360 | ingressPointsNew.add(SW1_ETH1); |
| 361 | ingressPointsNew.add(SW3_ETH1); |
| 362 | ingressPointsNew.add(SW4_ETH1); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 363 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 364 | MultiPointToSinglePointIntent intentNew = |
| 365 | new MultiPointToSinglePointIntent(APPID, |
| 366 | selectorBuilderNew.build(), |
| 367 | treatmentBuilderNew.build(), |
| 368 | ingressPointsNew, SW2_ETH1); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 369 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 370 | // Set up test expectation |
| 371 | reset(intentService); |
| 372 | // Setup the expected intents |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 373 | // FIXME Jono needs to refactor |
| 374 | // IntentOperations.Builder builder = IntentOperations.builder(APPID); |
| 375 | // builder.addWithdrawOperation(addedIntent.id()); |
| 376 | // intentService.execute(TestIntentServiceHelper.eqExceptId( |
| 377 | // builder.build())); |
| 378 | // builder = IntentOperations.builder(APPID); |
| 379 | // builder.addSubmitOperation(intentNew); |
| 380 | // intentService.execute(TestIntentServiceHelper.eqExceptId( |
| 381 | // builder.build())); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 382 | replay(intentService); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 383 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 384 | // Call the update() method in IntentSynchronizer class |
| 385 | intentSynchronizer.leaderChanged(true); |
| 386 | TestUtils.setField(intentSynchronizer, "isActivatedLeader", true); |
| 387 | FibUpdate fibUpdate = new FibUpdate(FibUpdate.Type.UPDATE, |
| 388 | fibEntryUpdate); |
| 389 | intentSynchronizer.update(Collections.singletonList(fibUpdate), |
| 390 | Collections.emptyList()); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 391 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 392 | // Verify |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 393 | assertEquals(intentSynchronizer.getRouteIntents().size(), 1); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 394 | Intent firstIntent = |
| 395 | intentSynchronizer.getRouteIntents().iterator().next(); |
| 396 | IntentKey firstIntentKey = new IntentKey(firstIntent); |
| 397 | IntentKey intentNewKey = new IntentKey(intentNew); |
| 398 | assertTrue(firstIntentKey.equals(intentNewKey)); |
| 399 | verify(intentService); |
| 400 | } |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 401 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 402 | /** |
| 403 | * Tests deleting a FIB entry. |
| 404 | * |
| 405 | * We verify that the synchronizer records the correct state and that the |
| 406 | * correct intent is withdrawn from the IntentService. |
| 407 | * |
| 408 | * @throws TestUtilsException |
| 409 | */ |
| 410 | @Test |
| 411 | public void testFibDelete() throws TestUtilsException { |
| 412 | // Firstly add a route |
| 413 | testFibAdd(); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 414 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 415 | Intent addedIntent = |
| 416 | intentSynchronizer.getRouteIntents().iterator().next(); |
| 417 | |
| 418 | // Construct the existing route entry |
| 419 | FibEntry fibEntry = new FibEntry( |
| 420 | Ip4Prefix.valueOf("1.1.1.0/24"), null, null); |
| 421 | |
| 422 | // Set up expectation |
| 423 | reset(intentService); |
| 424 | // Setup the expected intents |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 425 | // FIXME Jono needs to refactor |
| 426 | // IntentOperations.Builder builder = IntentOperations.builder(APPID); |
| 427 | // builder.addWithdrawOperation(addedIntent.id()); |
| 428 | // intentService.execute(TestIntentServiceHelper.eqExceptId( |
| 429 | // builder.build())); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 430 | replay(intentService); |
| 431 | |
| 432 | // Call the update() method in IntentSynchronizer class |
| 433 | intentSynchronizer.leaderChanged(true); |
| 434 | TestUtils.setField(intentSynchronizer, "isActivatedLeader", true); |
| 435 | FibUpdate fibUpdate = new FibUpdate(FibUpdate.Type.DELETE, fibEntry); |
| 436 | intentSynchronizer.update(Collections.emptyList(), |
| 437 | Collections.singletonList(fibUpdate)); |
| 438 | |
| 439 | // Verify |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 440 | assertEquals(intentSynchronizer.getRouteIntents().size(), 0); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 441 | verify(intentService); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 442 | } |
| 443 | |
| 444 | /** |
| 445 | * This method tests the behavior of intent Synchronizer. |
| 446 | * |
| 447 | * @throws TestUtilsException |
| 448 | */ |
| 449 | @Test |
| 450 | public void testIntentSync() throws TestUtilsException { |
| 451 | |
| 452 | // |
| 453 | // Construct routes and intents. |
| 454 | // This test simulates the following cases during the master change |
| 455 | // time interval: |
| 456 | // 1. RouteEntry1 did not change and the intent also did not change. |
| 457 | // 2. RouteEntry2 was deleted, but the intent was not deleted. |
| 458 | // 3. RouteEntry3 was newly added, and the intent was also submitted. |
| 459 | // 4. RouteEntry4 was updated to RouteEntry4Update, and the intent was |
| 460 | // also updated to a new one. |
| 461 | // 5. RouteEntry5 did not change, but its intent id changed. |
| 462 | // 6. RouteEntry6 was newly added, but the intent was not submitted. |
| 463 | // |
| 464 | RouteEntry routeEntry1 = new RouteEntry( |
Pavlin Radoslavov | 6b57073 | 2014-11-06 13:16:45 -0800 | [diff] [blame] | 465 | Ip4Prefix.valueOf("1.1.1.0/24"), |
| 466 | Ip4Address.valueOf("192.168.10.1")); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 467 | |
| 468 | RouteEntry routeEntry2 = new RouteEntry( |
Pavlin Radoslavov | 6b57073 | 2014-11-06 13:16:45 -0800 | [diff] [blame] | 469 | Ip4Prefix.valueOf("2.2.2.0/24"), |
| 470 | Ip4Address.valueOf("192.168.20.1")); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 471 | |
| 472 | RouteEntry routeEntry3 = new RouteEntry( |
Pavlin Radoslavov | 6b57073 | 2014-11-06 13:16:45 -0800 | [diff] [blame] | 473 | Ip4Prefix.valueOf("3.3.3.0/24"), |
| 474 | Ip4Address.valueOf("192.168.30.1")); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 475 | |
| 476 | RouteEntry routeEntry4 = new RouteEntry( |
Pavlin Radoslavov | 6b57073 | 2014-11-06 13:16:45 -0800 | [diff] [blame] | 477 | Ip4Prefix.valueOf("4.4.4.0/24"), |
| 478 | Ip4Address.valueOf("192.168.30.1")); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 479 | |
| 480 | RouteEntry routeEntry4Update = new RouteEntry( |
Pavlin Radoslavov | 6b57073 | 2014-11-06 13:16:45 -0800 | [diff] [blame] | 481 | Ip4Prefix.valueOf("4.4.4.0/24"), |
| 482 | Ip4Address.valueOf("192.168.20.1")); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 483 | |
| 484 | RouteEntry routeEntry5 = new RouteEntry( |
Pavlin Radoslavov | 6b57073 | 2014-11-06 13:16:45 -0800 | [diff] [blame] | 485 | Ip4Prefix.valueOf("5.5.5.0/24"), |
| 486 | Ip4Address.valueOf("192.168.10.1")); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 487 | |
| 488 | RouteEntry routeEntry6 = new RouteEntry( |
Pavlin Radoslavov | 6b57073 | 2014-11-06 13:16:45 -0800 | [diff] [blame] | 489 | Ip4Prefix.valueOf("6.6.6.0/24"), |
| 490 | Ip4Address.valueOf("192.168.10.1")); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 491 | |
Jonathan Hart | ec2df01 | 2014-10-23 16:40:24 -0700 | [diff] [blame] | 492 | RouteEntry routeEntry7 = new RouteEntry( |
Pavlin Radoslavov | 6b57073 | 2014-11-06 13:16:45 -0800 | [diff] [blame] | 493 | Ip4Prefix.valueOf("7.7.7.0/24"), |
| 494 | Ip4Address.valueOf("192.168.10.1")); |
Jonathan Hart | ec2df01 | 2014-10-23 16:40:24 -0700 | [diff] [blame] | 495 | |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 496 | MultiPointToSinglePointIntent intent1 = intentBuilder( |
| 497 | routeEntry1.prefix(), "00:00:00:00:00:01", SW1_ETH1); |
| 498 | MultiPointToSinglePointIntent intent2 = intentBuilder( |
| 499 | routeEntry2.prefix(), "00:00:00:00:00:02", SW2_ETH1); |
| 500 | MultiPointToSinglePointIntent intent3 = intentBuilder( |
| 501 | routeEntry3.prefix(), "00:00:00:00:00:03", SW3_ETH1); |
| 502 | MultiPointToSinglePointIntent intent4 = intentBuilder( |
| 503 | routeEntry4.prefix(), "00:00:00:00:00:03", SW3_ETH1); |
| 504 | MultiPointToSinglePointIntent intent4Update = intentBuilder( |
| 505 | routeEntry4Update.prefix(), "00:00:00:00:00:02", SW2_ETH1); |
| 506 | MultiPointToSinglePointIntent intent5 = intentBuilder( |
| 507 | routeEntry5.prefix(), "00:00:00:00:00:01", SW1_ETH1); |
Jonathan Hart | ec2df01 | 2014-10-23 16:40:24 -0700 | [diff] [blame] | 508 | MultiPointToSinglePointIntent intent7 = intentBuilder( |
| 509 | routeEntry7.prefix(), "00:00:00:00:00:01", SW1_ETH1); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 510 | |
| 511 | // Compose a intent, which is equal to intent5 but the id is different. |
| 512 | MultiPointToSinglePointIntent intent5New = |
| 513 | staticIntentBuilder(intent5, routeEntry5, "00:00:00:00:00:01"); |
Pavlin Radoslavov | a7243cc | 2014-11-22 21:38:02 -0800 | [diff] [blame] | 514 | assertThat(IntentSynchronizer.IntentKey.equalIntents( |
| 515 | intent5, intent5New), |
| 516 | is(true)); |
Jonathan Hart | ec2df01 | 2014-10-23 16:40:24 -0700 | [diff] [blame] | 517 | assertFalse(intent5.equals(intent5New)); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 518 | |
| 519 | MultiPointToSinglePointIntent intent6 = intentBuilder( |
| 520 | routeEntry6.prefix(), "00:00:00:00:00:01", SW1_ETH1); |
| 521 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 522 | // Set up the routeIntents field in IntentSynchronizer class |
Pavlin Radoslavov | 3a0a52e | 2015-01-06 17:41:37 -0800 | [diff] [blame] | 523 | ConcurrentHashMap<IpPrefix, MultiPointToSinglePointIntent> |
| 524 | routeIntents = new ConcurrentHashMap<>(); |
Pavlin Radoslavov | a7243cc | 2014-11-22 21:38:02 -0800 | [diff] [blame] | 525 | routeIntents.put(routeEntry1.prefix(), intent1); |
| 526 | routeIntents.put(routeEntry3.prefix(), intent3); |
| 527 | routeIntents.put(routeEntry4Update.prefix(), intent4Update); |
| 528 | routeIntents.put(routeEntry5.prefix(), intent5New); |
| 529 | routeIntents.put(routeEntry6.prefix(), intent6); |
| 530 | routeIntents.put(routeEntry7.prefix(), intent7); |
| 531 | TestUtils.setField(intentSynchronizer, "routeIntents", routeIntents); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 532 | |
| 533 | // Set up expectation |
| 534 | reset(intentService); |
| 535 | Set<Intent> intents = new HashSet<Intent>(); |
| 536 | intents.add(intent1); |
Ray Milkey | f9af43c | 2015-02-09 16:45:48 -0800 | [diff] [blame] | 537 | expect(intentService.getIntentState(intent1.key())) |
Jonathan Hart | ec2df01 | 2014-10-23 16:40:24 -0700 | [diff] [blame] | 538 | .andReturn(IntentState.INSTALLED).anyTimes(); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 539 | intents.add(intent2); |
Ray Milkey | f9af43c | 2015-02-09 16:45:48 -0800 | [diff] [blame] | 540 | expect(intentService.getIntentState(intent2.key())) |
Jonathan Hart | ec2df01 | 2014-10-23 16:40:24 -0700 | [diff] [blame] | 541 | .andReturn(IntentState.INSTALLED).anyTimes(); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 542 | intents.add(intent4); |
Ray Milkey | f9af43c | 2015-02-09 16:45:48 -0800 | [diff] [blame] | 543 | expect(intentService.getIntentState(intent4.key())) |
Jonathan Hart | ec2df01 | 2014-10-23 16:40:24 -0700 | [diff] [blame] | 544 | .andReturn(IntentState.INSTALLED).anyTimes(); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 545 | intents.add(intent5); |
Ray Milkey | f9af43c | 2015-02-09 16:45:48 -0800 | [diff] [blame] | 546 | expect(intentService.getIntentState(intent5.key())) |
Jonathan Hart | ec2df01 | 2014-10-23 16:40:24 -0700 | [diff] [blame] | 547 | .andReturn(IntentState.INSTALLED).anyTimes(); |
| 548 | intents.add(intent7); |
Ray Milkey | f9af43c | 2015-02-09 16:45:48 -0800 | [diff] [blame] | 549 | expect(intentService.getIntentState(intent7.key())) |
Jonathan Hart | ec2df01 | 2014-10-23 16:40:24 -0700 | [diff] [blame] | 550 | .andReturn(IntentState.WITHDRAWING).anyTimes(); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 551 | expect(intentService.getIntents()).andReturn(intents).anyTimes(); |
| 552 | |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 553 | intentService.withdraw(intent2); |
| 554 | intentService.withdraw(intent4); |
Pavlin Radoslavov | a7243cc | 2014-11-22 21:38:02 -0800 | [diff] [blame] | 555 | |
Brian O'Connor | 03406a4 | 2015-02-03 17:28:57 -0800 | [diff] [blame] | 556 | intentService.submit(intent3); |
| 557 | intentService.submit(intent4Update); |
| 558 | intentService.submit(intent6); |
| 559 | intentService.submit(intent7); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 560 | replay(intentService); |
| 561 | |
| 562 | // Start the test |
Pavlin Radoslavov | a071b1e | 2014-11-17 13:37:57 -0800 | [diff] [blame] | 563 | intentSynchronizer.leaderChanged(true); |
Pavlin Radoslavov | a7243cc | 2014-11-22 21:38:02 -0800 | [diff] [blame] | 564 | intentSynchronizer.synchronizeIntents(); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 565 | |
| 566 | // Verify |
Pavlin Radoslavov | a7243cc | 2014-11-22 21:38:02 -0800 | [diff] [blame] | 567 | assertEquals(intentSynchronizer.getRouteIntents().size(), 6); |
| 568 | assertTrue(intentSynchronizer.getRouteIntents().contains(intent1)); |
| 569 | assertTrue(intentSynchronizer.getRouteIntents().contains(intent3)); |
| 570 | assertTrue(intentSynchronizer.getRouteIntents().contains(intent4Update)); |
| 571 | assertTrue(intentSynchronizer.getRouteIntents().contains(intent5)); |
| 572 | assertTrue(intentSynchronizer.getRouteIntents().contains(intent6)); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 573 | |
| 574 | verify(intentService); |
| 575 | } |
| 576 | |
| 577 | /** |
| 578 | * MultiPointToSinglePointIntent builder. |
| 579 | * |
| 580 | * @param ipPrefix the ipPrefix to match |
| 581 | * @param nextHopMacAddress to which the destination MAC address in packet |
| 582 | * should be rewritten |
| 583 | * @param egressPoint to which packets should be sent |
| 584 | * @return the constructed MultiPointToSinglePointIntent |
| 585 | */ |
Pavlin Radoslavov | 3a0a52e | 2015-01-06 17:41:37 -0800 | [diff] [blame] | 586 | private MultiPointToSinglePointIntent intentBuilder(IpPrefix ipPrefix, |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 587 | String nextHopMacAddress, ConnectPoint egressPoint) { |
| 588 | |
| 589 | TrafficSelector.Builder selectorBuilder = |
| 590 | DefaultTrafficSelector.builder(); |
Pavlin Radoslavov | 3a0a52e | 2015-01-06 17:41:37 -0800 | [diff] [blame] | 591 | if (ipPrefix.version() == Ip4Address.VERSION) { |
| 592 | selectorBuilder.matchEthType(Ethernet.TYPE_IPV4); // IPv4 |
| 593 | } else { |
| 594 | selectorBuilder.matchEthType(Ethernet.TYPE_IPV6); // IPv6 |
| 595 | } |
| 596 | selectorBuilder.matchIPDst(ipPrefix); |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 597 | |
| 598 | TrafficTreatment.Builder treatmentBuilder = |
| 599 | DefaultTrafficTreatment.builder(); |
| 600 | treatmentBuilder.setEthDst(MacAddress.valueOf(nextHopMacAddress)); |
| 601 | |
| 602 | Set<ConnectPoint> ingressPoints = new HashSet<ConnectPoint>(); |
| 603 | for (Interface intf : interfaceService.getInterfaces()) { |
| 604 | if (!intf.equals(interfaceService.getInterface(egressPoint))) { |
| 605 | ConnectPoint srcPort = intf.connectPoint(); |
| 606 | ingressPoints.add(srcPort); |
| 607 | } |
| 608 | } |
| 609 | MultiPointToSinglePointIntent intent = |
| 610 | new MultiPointToSinglePointIntent(APPID, |
| 611 | selectorBuilder.build(), treatmentBuilder.build(), |
| 612 | ingressPoints, egressPoint); |
| 613 | return intent; |
| 614 | } |
| 615 | |
| 616 | /** |
| 617 | * A static MultiPointToSinglePointIntent builder, the returned intent is |
| 618 | * equal to the input intent except that the id is different. |
| 619 | * |
| 620 | * |
| 621 | * @param intent the intent to be used for building a new intent |
| 622 | * @param routeEntry the relative routeEntry of the intent |
| 623 | * @return the newly constructed MultiPointToSinglePointIntent |
| 624 | * @throws TestUtilsException |
| 625 | */ |
| 626 | private MultiPointToSinglePointIntent staticIntentBuilder( |
| 627 | MultiPointToSinglePointIntent intent, RouteEntry routeEntry, |
| 628 | String nextHopMacAddress) throws TestUtilsException { |
| 629 | |
| 630 | // Use a different egress ConnectPoint with that in intent |
| 631 | // to generate a different id |
| 632 | MultiPointToSinglePointIntent intentNew = intentBuilder( |
| 633 | routeEntry.prefix(), nextHopMacAddress, SW2_ETH1); |
| 634 | TestUtils.setField(intentNew, "egressPoint", intent.egressPoint()); |
| 635 | TestUtils.setField(intentNew, |
| 636 | "ingressPoints", intent.ingressPoints()); |
| 637 | return intentNew; |
| 638 | } |
Pingping | f5d9093 | 2014-10-27 10:50:04 -0700 | [diff] [blame] | 639 | } |