Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.net.intent.impl.compiler; |
| 17 | |
| 18 | import com.google.common.collect.ImmutableSet; |
Pier Ventre | 766995d | 2016-10-05 22:15:56 -0700 | [diff] [blame] | 19 | import org.hamcrest.core.Is; |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 20 | import org.junit.Before; |
| 21 | import org.junit.Test; |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 22 | import org.onlab.packet.MacAddress; |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 23 | import org.onlab.packet.VlanId; |
Thomas Vachuska | bdbdd24 | 2016-03-01 01:55:55 -0800 | [diff] [blame] | 24 | import org.onosproject.cfg.ComponentConfigAdapter; |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 25 | import org.onosproject.core.CoreService; |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 26 | import org.onosproject.net.DefaultLink; |
Thomas Szyrkowiec | 770093f | 2017-05-05 13:06:53 +0200 | [diff] [blame] | 27 | import org.onosproject.net.DeviceId; |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 28 | import org.onosproject.net.FilteredConnectPoint; |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 29 | import org.onosproject.net.Link; |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 30 | import org.onosproject.net.PortNumber; |
Thomas Szyrkowiec | 770093f | 2017-05-05 13:06:53 +0200 | [diff] [blame] | 31 | import org.onosproject.net.domain.DomainService; |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 32 | import org.onosproject.net.flow.DefaultTrafficSelector; |
| 33 | import org.onosproject.net.flow.DefaultTrafficTreatment; |
| 34 | import org.onosproject.net.flow.FlowRule; |
| 35 | import org.onosproject.net.flow.TrafficSelector; |
| 36 | import org.onosproject.net.flow.TrafficTreatment; |
Pier Ventre | 766995d | 2016-10-05 22:15:56 -0700 | [diff] [blame] | 37 | import org.onosproject.net.flow.criteria.MplsCriterion; |
| 38 | import org.onosproject.net.flow.criteria.PortCriterion; |
| 39 | import org.onosproject.net.flow.criteria.VlanIdCriterion; |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 40 | import org.onosproject.net.intent.FlowRuleIntent; |
| 41 | import org.onosproject.net.intent.Intent; |
| 42 | import org.onosproject.net.intent.IntentExtensionService; |
| 43 | import org.onosproject.net.intent.LinkCollectionIntent; |
Yuta HIGUCHI | 1f72203 | 2016-12-03 13:56:50 -0800 | [diff] [blame] | 44 | import org.onosproject.net.resource.MockResourceService; |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 45 | |
| 46 | import java.util.Collection; |
| 47 | import java.util.Collections; |
| 48 | import java.util.List; |
| 49 | import java.util.Set; |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 50 | import java.util.stream.Collectors; |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 51 | |
Thomas Vachuska | 2048c1f | 2017-05-10 19:32:22 -0700 | [diff] [blame] | 52 | import static org.easymock.EasyMock.*; |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 53 | import static org.hamcrest.CoreMatchers.instanceOf; |
| 54 | import static org.hamcrest.CoreMatchers.notNullValue; |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 55 | import static org.hamcrest.MatcherAssert.assertThat; |
Thomas Vachuska | 2048c1f | 2017-05-10 19:32:22 -0700 | [diff] [blame] | 56 | import static org.hamcrest.Matchers.*; |
Pier Ventre | 766995d | 2016-10-05 22:15:56 -0700 | [diff] [blame] | 57 | import static org.onlab.packet.EthType.EtherType.IPV4; |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 58 | import static org.onosproject.net.Link.Type.DIRECT; |
Thomas Szyrkowiec | 770093f | 2017-05-05 13:06:53 +0200 | [diff] [blame] | 59 | import static org.onosproject.net.NetTestTools.APP_ID; |
| 60 | import static org.onosproject.net.NetTestTools.PID; |
| 61 | import static org.onosproject.net.domain.DomainId.LOCAL; |
Thomas Vachuska | 2048c1f | 2017-05-10 19:32:22 -0700 | [diff] [blame] | 62 | import static org.onosproject.net.flow.criteria.Criterion.Type.*; |
Thomas Szyrkowiec | 770093f | 2017-05-05 13:06:53 +0200 | [diff] [blame] | 63 | import static org.onosproject.net.flow.instructions.L2ModificationInstruction.ModEtherInstruction; |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 64 | |
Pier Ventre | 5c4a076 | 2016-11-21 10:28:13 -0800 | [diff] [blame] | 65 | /** |
| 66 | * This set of tests are meant to test the LinkCollectionIntent |
| 67 | * compiler. |
| 68 | */ |
Pier Ventre | 766995d | 2016-10-05 22:15:56 -0700 | [diff] [blame] | 69 | public class LinkCollectionIntentCompilerTest extends AbstractLinkCollectionTest { |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 70 | |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 71 | @Before |
Brian O'Connor | 8113466 | 2015-06-25 17:23:33 -0400 | [diff] [blame] | 72 | public void setUp() { |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 73 | sut = new LinkCollectionIntentCompiler(); |
| 74 | coreService = createMock(CoreService.class); |
| 75 | expect(coreService.registerApplication("org.onosproject.net.intent")) |
| 76 | .andReturn(appId); |
| 77 | sut.coreService = coreService; |
| 78 | |
Thomas Szyrkowiec | 770093f | 2017-05-05 13:06:53 +0200 | [diff] [blame] | 79 | domainService = createMock(DomainService.class); |
| 80 | expect(domainService.getDomain(anyObject(DeviceId.class))).andReturn(LOCAL).anyTimes(); |
| 81 | sut.domainService = domainService; |
| 82 | |
Thomas Vachuska | 2048c1f | 2017-05-10 19:32:22 -0700 | [diff] [blame] | 83 | super.setUp(); |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 84 | |
| 85 | intent = LinkCollectionIntent.builder() |
| 86 | .appId(APP_ID) |
| 87 | .selector(selector) |
| 88 | .treatment(treatment) |
| 89 | .links(links) |
Ray Milkey | 6e7843d | 2018-09-18 15:50:41 -0700 | [diff] [blame] | 90 | .filteredIngressPoints(ImmutableSet.of(new FilteredConnectPoint(d1p1))) |
| 91 | .filteredEgressPoints(ImmutableSet.of(new FilteredConnectPoint(d3p1))) |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 92 | .build(); |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 93 | |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 94 | intentExtensionService = createMock(IntentExtensionService.class); |
| 95 | intentExtensionService.registerCompiler(LinkCollectionIntent.class, sut); |
| 96 | intentExtensionService.unregisterCompiler(LinkCollectionIntent.class); |
Thomas Vachuska | bdbdd24 | 2016-03-01 01:55:55 -0800 | [diff] [blame] | 97 | |
| 98 | registrator = new IntentConfigurableRegistrator(); |
| 99 | registrator.extensionService = intentExtensionService; |
| 100 | registrator.cfgService = new ComponentConfigAdapter(); |
| 101 | registrator.activate(); |
| 102 | |
| 103 | sut.registrator = registrator; |
Yuta HIGUCHI | 1f72203 | 2016-12-03 13:56:50 -0800 | [diff] [blame] | 104 | sut.resourceService = new MockResourceService(); |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 105 | |
Yi Tseng | 84c5a3d | 2017-04-14 16:42:59 -0700 | [diff] [blame] | 106 | LinkCollectionCompiler.optimizeInstructions = false; |
Pier Ventre | 81c47bf | 2016-11-04 07:26:22 -0700 | [diff] [blame] | 107 | LinkCollectionCompiler.copyTtl = false; |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 108 | |
Thomas Szyrkowiec | 770093f | 2017-05-05 13:06:53 +0200 | [diff] [blame] | 109 | replay(coreService, domainService, intentExtensionService); |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 110 | |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 111 | } |
| 112 | |
Pier Ventre | 5c4a076 | 2016-11-21 10:28:13 -0800 | [diff] [blame] | 113 | /** |
| 114 | * We test the proper compilation of a simple link collection intent |
| 115 | * with connect points, trivial treatment and trivial selector. |
| 116 | */ |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 117 | @Test |
| 118 | public void testCompile() { |
| 119 | sut.activate(); |
| 120 | |
Sho SHIMIZU | ec07ffd | 2016-02-22 20:45:21 -0800 | [diff] [blame] | 121 | List<Intent> compiled = sut.compile(intent, Collections.emptyList()); |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 122 | assertThat(compiled, hasSize(1)); |
| 123 | |
Yuta HIGUCHI | 652f27f | 2016-10-31 16:54:30 -0700 | [diff] [blame] | 124 | assertThat("key is inherited", |
| 125 | compiled.stream().map(Intent::key).collect(Collectors.toList()), |
| 126 | everyItem(is(intent.key()))); |
| 127 | |
| 128 | |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 129 | Collection<FlowRule> rules = ((FlowRuleIntent) compiled.get(0)).flowRules(); |
| 130 | assertThat(rules, hasSize(links.size())); |
| 131 | |
| 132 | // if not found, get() raises an exception |
| 133 | FlowRule rule1 = rules.stream() |
Pier Ventre | 766995d | 2016-10-05 22:15:56 -0700 | [diff] [blame] | 134 | .filter(rule -> rule.deviceId().equals(d1p10.deviceId())) |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 135 | .findFirst() |
| 136 | .get(); |
| 137 | assertThat(rule1.selector(), is( |
| 138 | DefaultTrafficSelector.builder(intent.selector()).matchInPort(d1p1.port()).build() |
| 139 | )); |
| 140 | assertThat(rule1.treatment(), is( |
| 141 | DefaultTrafficTreatment.builder(intent.treatment()).setOutput(d1p1.port()).build() |
| 142 | )); |
Brian O'Connor | 8113466 | 2015-06-25 17:23:33 -0400 | [diff] [blame] | 143 | assertThat(rule1.priority(), is(intent.priority())); |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 144 | |
| 145 | FlowRule rule2 = rules.stream() |
| 146 | .filter(rule -> rule.deviceId().equals(d2p0.deviceId())) |
| 147 | .findFirst() |
| 148 | .get(); |
| 149 | assertThat(rule2.selector(), is( |
| 150 | DefaultTrafficSelector.builder(intent.selector()).matchInPort(d2p0.port()).build() |
| 151 | )); |
| 152 | assertThat(rule2.treatment(), is( |
| 153 | DefaultTrafficTreatment.builder().setOutput(d2p1.port()).build() |
| 154 | )); |
Brian O'Connor | 8113466 | 2015-06-25 17:23:33 -0400 | [diff] [blame] | 155 | assertThat(rule2.priority(), is(intent.priority())); |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 156 | |
| 157 | FlowRule rule3 = rules.stream() |
| 158 | .filter(rule -> rule.deviceId().equals(d3p0.deviceId())) |
| 159 | .findFirst() |
| 160 | .get(); |
| 161 | assertThat(rule3.selector(), is( |
| 162 | DefaultTrafficSelector.builder(intent.selector()).matchInPort(d3p1.port()).build() |
| 163 | )); |
| 164 | assertThat(rule3.treatment(), is( |
| 165 | DefaultTrafficTreatment.builder().setOutput(d3p1.port()).build() |
| 166 | )); |
Brian O'Connor | 8113466 | 2015-06-25 17:23:33 -0400 | [diff] [blame] | 167 | assertThat(rule3.priority(), is(intent.priority())); |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 168 | |
| 169 | sut.deactivate(); |
| 170 | } |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 171 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 172 | /** |
Pier Ventre | 5c4a076 | 2016-11-21 10:28:13 -0800 | [diff] [blame] | 173 | * Single point to multi point case. Scenario is the follow: |
| 174 | * |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 175 | * -1 of1 2-1 of2 2--1 of3 2- |
| 176 | * 3 |
| 177 | * `-1 of4 2- |
Pier Ventre | 5c4a076 | 2016-11-21 10:28:13 -0800 | [diff] [blame] | 178 | * |
| 179 | * We test the proper compilation of sp2mp with trivial selector, |
| 180 | * trivial treatment and different filtered points |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 181 | */ |
| 182 | @Test |
Pier Ventre | 766995d | 2016-10-05 22:15:56 -0700 | [diff] [blame] | 183 | public void testFilteredConnectPointForSp() { |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 184 | sut.activate(); |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 185 | Set<Link> testLinks = ImmutableSet.of( |
| 186 | DefaultLink.builder().providerId(PID).src(of1p2).dst(of2p1).type(DIRECT).build(), |
| 187 | DefaultLink.builder().providerId(PID).src(of2p2).dst(of3p1).type(DIRECT).build(), |
| 188 | DefaultLink.builder().providerId(PID).src(of2p3).dst(of4p1).type(DIRECT).build() |
| 189 | ); |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 190 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 191 | TrafficSelector expectOf1Selector = DefaultTrafficSelector.builder(vlan100Selector) |
| 192 | .matchInPort(PortNumber.portNumber(1)) |
| 193 | .build(); |
| 194 | |
| 195 | TrafficTreatment expectOf1Treatment = DefaultTrafficTreatment.builder() |
| 196 | .setOutput(PortNumber.portNumber(2)) |
| 197 | .build(); |
| 198 | |
| 199 | TrafficSelector expectOf2Selector = DefaultTrafficSelector.builder(vlan100Selector) |
| 200 | .matchInPort(PortNumber.portNumber(1)) |
| 201 | .build(); |
| 202 | |
| 203 | TrafficTreatment expectOf2Treatment = DefaultTrafficTreatment.builder() |
| 204 | .setOutput(PortNumber.portNumber(2)) |
| 205 | .setOutput(PortNumber.portNumber(3)) |
| 206 | .build(); |
| 207 | |
| 208 | TrafficSelector expectOf3Selector = DefaultTrafficSelector.builder(vlan100Selector) |
| 209 | .matchInPort(PortNumber.portNumber(1)) |
| 210 | .build(); |
| 211 | |
| 212 | TrafficTreatment expectOf3Treatment = DefaultTrafficTreatment.builder() |
| 213 | .setOutput(PortNumber.portNumber(2)) |
| 214 | .build(); |
| 215 | |
| 216 | TrafficSelector expectOf4Selector = DefaultTrafficSelector.builder(vlan100Selector) |
| 217 | .matchInPort(PortNumber.portNumber(1)) |
| 218 | .build(); |
| 219 | |
| 220 | TrafficTreatment expectOf4Treatment = DefaultTrafficTreatment.builder() |
| 221 | .setVlanId(VlanId.vlanId("200")) |
| 222 | .setOutput(PortNumber.portNumber(2)) |
| 223 | .build(); |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 224 | |
| 225 | |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 226 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 227 | Set<FilteredConnectPoint> ingress = ImmutableSet.of( |
| 228 | new FilteredConnectPoint(of1p1, vlan100Selector) |
| 229 | ); |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 230 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 231 | Set<FilteredConnectPoint> egress = ImmutableSet.of( |
| 232 | new FilteredConnectPoint(of3p2, vlan100Selector), |
| 233 | new FilteredConnectPoint(of4p2, vlan200Selector) |
| 234 | ); |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 235 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 236 | intent = LinkCollectionIntent.builder() |
| 237 | .appId(APP_ID) |
| 238 | .filteredIngressPoints(ingress) |
| 239 | .filteredEgressPoints(egress) |
| 240 | .treatment(treatment) |
| 241 | .applyTreatmentOnEgress(true) |
| 242 | .links(testLinks) |
| 243 | .build(); |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 244 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 245 | assertThat(sut, is(notNullValue())); |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 246 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 247 | List<Intent> result = sut.compile(intent, Collections.emptyList()); |
| 248 | |
| 249 | assertThat(result, is(notNullValue())); |
| 250 | assertThat(result, hasSize(1)); |
| 251 | |
| 252 | Intent resultIntent = result.get(0); |
| 253 | assertThat(resultIntent, instanceOf(FlowRuleIntent.class)); |
| 254 | |
| 255 | if (resultIntent instanceof FlowRuleIntent) { |
| 256 | FlowRuleIntent frIntent = (FlowRuleIntent) resultIntent; |
| 257 | |
| 258 | assertThat(frIntent.flowRules(), hasSize(4)); |
| 259 | |
| 260 | List<FlowRule> deviceFlowRules; |
| 261 | FlowRule flowRule; |
| 262 | |
| 263 | // Of1 |
| 264 | deviceFlowRules = getFlowRulesByDevice(of1Id, frIntent.flowRules()); |
| 265 | assertThat(deviceFlowRules, hasSize(1)); |
| 266 | flowRule = deviceFlowRules.get(0); |
| 267 | assertThat(flowRule.selector(), is(expectOf1Selector)); |
| 268 | assertThat(flowRule.treatment(), is(expectOf1Treatment)); |
| 269 | |
| 270 | // Of2 |
| 271 | deviceFlowRules = getFlowRulesByDevice(of2Id, frIntent.flowRules()); |
| 272 | assertThat(deviceFlowRules, hasSize(1)); |
| 273 | flowRule = deviceFlowRules.get(0); |
| 274 | assertThat(flowRule.selector(), is(expectOf2Selector)); |
| 275 | assertThat(flowRule.treatment(), is(expectOf2Treatment)); |
| 276 | |
| 277 | // Of3 |
| 278 | deviceFlowRules = getFlowRulesByDevice(of3Id, frIntent.flowRules()); |
| 279 | assertThat(deviceFlowRules, hasSize(1)); |
| 280 | flowRule = deviceFlowRules.get(0); |
| 281 | assertThat(flowRule.selector(), is(expectOf3Selector)); |
| 282 | assertThat(flowRule.treatment(), is(expectOf3Treatment)); |
| 283 | |
| 284 | // Of4 |
| 285 | deviceFlowRules = getFlowRulesByDevice(of4Id, frIntent.flowRules()); |
| 286 | assertThat(deviceFlowRules, hasSize(1)); |
| 287 | flowRule = deviceFlowRules.get(0); |
| 288 | assertThat(flowRule.selector(), is(expectOf4Selector)); |
| 289 | assertThat(flowRule.treatment(), is(expectOf4Treatment)); |
| 290 | |
| 291 | } |
| 292 | sut.deactivate(); |
| 293 | } |
| 294 | |
| 295 | /** |
| 296 | * Multi point to single point intent with filtered connect point. |
Pier Ventre | 5c4a076 | 2016-11-21 10:28:13 -0800 | [diff] [blame] | 297 | * Scenario is the follow: |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 298 | * |
| 299 | * -1 of1 2-1 of2 2-1 of4 2- |
| 300 | * 3 |
| 301 | * -1 of3 2---/ |
Pier Ventre | 5c4a076 | 2016-11-21 10:28:13 -0800 | [diff] [blame] | 302 | * |
| 303 | * We test the proper compilation of mp2sp intents with trivial selector, |
| 304 | * trivial treatment and different filtered point. |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 305 | */ |
| 306 | @Test |
Pier Ventre | 766995d | 2016-10-05 22:15:56 -0700 | [diff] [blame] | 307 | public void testFilteredConnectPointForMp() { |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 308 | sut.activate(); |
| 309 | Set<Link> testlinks = ImmutableSet.of( |
| 310 | DefaultLink.builder().providerId(PID).src(of1p2).dst(of2p1).type(DIRECT).build(), |
| 311 | DefaultLink.builder().providerId(PID).src(of3p2).dst(of2p3).type(DIRECT).build(), |
| 312 | DefaultLink.builder().providerId(PID).src(of2p2).dst(of4p1).type(DIRECT).build() |
| 313 | ); |
| 314 | |
| 315 | Set<FilteredConnectPoint> ingress = ImmutableSet.of( |
| 316 | new FilteredConnectPoint(of1p1, vlan100Selector), |
| 317 | new FilteredConnectPoint(of3p1, vlan100Selector) |
| 318 | ); |
| 319 | |
| 320 | Set<FilteredConnectPoint> egress = ImmutableSet.of( |
| 321 | new FilteredConnectPoint(of4p2, vlan200Selector) |
| 322 | ); |
| 323 | |
| 324 | TrafficSelector expectOf1Selector = DefaultTrafficSelector.builder(vlan100Selector) |
| 325 | .matchInPort(PortNumber.portNumber(1)) |
| 326 | .build(); |
| 327 | |
| 328 | TrafficTreatment expectOf1Treatment = DefaultTrafficTreatment.builder() |
| 329 | .setVlanId(VlanId.vlanId("200")) |
| 330 | .setOutput(PortNumber.portNumber(2)) |
| 331 | .build(); |
| 332 | |
| 333 | TrafficSelector expectOf2Selector1 = DefaultTrafficSelector.builder(vlan200Selector) |
| 334 | .matchInPort(PortNumber.portNumber(1)) |
| 335 | .build(); |
| 336 | |
| 337 | TrafficSelector expectOf2Selector2 = DefaultTrafficSelector.builder(vlan200Selector) |
| 338 | .matchInPort(PortNumber.portNumber(3)) |
| 339 | .build(); |
| 340 | |
| 341 | TrafficTreatment expectOf2Treatment = DefaultTrafficTreatment.builder() |
| 342 | .setOutput(PortNumber.portNumber(2)) |
| 343 | .build(); |
| 344 | |
| 345 | TrafficSelector expectOf3Selector = DefaultTrafficSelector.builder(vlan100Selector) |
| 346 | .matchInPort(PortNumber.portNumber(1)) |
| 347 | .build(); |
| 348 | |
| 349 | TrafficTreatment expectOf3Treatment = DefaultTrafficTreatment.builder() |
| 350 | .setVlanId(VlanId.vlanId("200")) |
| 351 | .setOutput(PortNumber.portNumber(2)) |
| 352 | .build(); |
| 353 | |
| 354 | TrafficSelector expectOf4Selector = DefaultTrafficSelector.builder(vlan100Selector) |
| 355 | .matchInPort(PortNumber.portNumber(1)) |
| 356 | .matchVlanId(VlanId.vlanId("200")) |
| 357 | .build(); |
| 358 | |
| 359 | TrafficTreatment expectOf4Treatment = DefaultTrafficTreatment.builder() |
| 360 | .setOutput(PortNumber.portNumber(2)) |
| 361 | .build(); |
| 362 | |
| 363 | intent = LinkCollectionIntent.builder() |
| 364 | .appId(APP_ID) |
| 365 | .filteredIngressPoints(ingress) |
| 366 | .filteredEgressPoints(egress) |
| 367 | .treatment(treatment) |
| 368 | .links(testlinks) |
| 369 | .build(); |
| 370 | |
| 371 | List<Intent> result = sut.compile(intent, Collections.emptyList()); |
| 372 | |
| 373 | assertThat(result, is(notNullValue())); |
| 374 | assertThat(result, hasSize(1)); |
| 375 | |
| 376 | Intent resultIntent = result.get(0); |
| 377 | assertThat(resultIntent, instanceOf(FlowRuleIntent.class)); |
| 378 | |
| 379 | if (resultIntent instanceof FlowRuleIntent) { |
| 380 | FlowRuleIntent frIntent = (FlowRuleIntent) resultIntent; |
| 381 | assertThat(frIntent.flowRules(), hasSize(5)); |
| 382 | |
| 383 | List<FlowRule> deviceFlowRules; |
| 384 | FlowRule flowRule; |
| 385 | |
| 386 | // Of1 |
| 387 | deviceFlowRules = getFlowRulesByDevice(of1Id, frIntent.flowRules()); |
| 388 | assertThat(deviceFlowRules, hasSize(1)); |
| 389 | flowRule = deviceFlowRules.get(0); |
| 390 | assertThat(flowRule.selector(), is(expectOf1Selector)); |
| 391 | assertThat(flowRule.treatment(), is(expectOf1Treatment)); |
| 392 | |
| 393 | // Of2 (has 2 flows) |
| 394 | deviceFlowRules = getFlowRulesByDevice(of2Id, frIntent.flowRules()); |
| 395 | assertThat(deviceFlowRules, hasSize(2)); |
| 396 | flowRule = deviceFlowRules.get(0); |
| 397 | assertThat(flowRule.selector(), is(expectOf2Selector1)); |
| 398 | assertThat(flowRule.treatment(), is(expectOf2Treatment)); |
| 399 | flowRule = deviceFlowRules.get(1); |
| 400 | assertThat(flowRule.selector(), is(expectOf2Selector2)); |
| 401 | assertThat(flowRule.treatment(), is(expectOf2Treatment)); |
| 402 | |
| 403 | // Of3 |
| 404 | deviceFlowRules = getFlowRulesByDevice(of3Id, frIntent.flowRules()); |
| 405 | assertThat(deviceFlowRules, hasSize(1)); |
| 406 | flowRule = deviceFlowRules.get(0); |
| 407 | assertThat(flowRule.selector(), is(expectOf3Selector)); |
| 408 | assertThat(flowRule.treatment(), is(expectOf3Treatment)); |
| 409 | |
| 410 | // Of4 |
| 411 | deviceFlowRules = getFlowRulesByDevice(of4Id, frIntent.flowRules()); |
| 412 | assertThat(deviceFlowRules, hasSize(1)); |
| 413 | flowRule = deviceFlowRules.get(0); |
| 414 | assertThat(flowRule.selector(), is(expectOf4Selector)); |
| 415 | assertThat(flowRule.treatment(), is(expectOf4Treatment)); |
| 416 | } |
Pier Ventre | 647138f | 2016-08-26 17:32:44 -0700 | [diff] [blame] | 417 | |
| 418 | sut.deactivate(); |
| 419 | } |
| 420 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 421 | /** |
| 422 | * Single point to multi point without filtered connect point case. |
Pier Ventre | 5c4a076 | 2016-11-21 10:28:13 -0800 | [diff] [blame] | 423 | * Scenario is the follow: |
| 424 | * |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 425 | * -1 of1 2-1 of2 2--1 of3 2- |
| 426 | * 3 |
| 427 | * `-1 of4 2- |
Pier Ventre | 5c4a076 | 2016-11-21 10:28:13 -0800 | [diff] [blame] | 428 | * |
| 429 | * We test the proper compilation of sp2mp with non trivial selector, |
| 430 | * non trivial treatment and simple connect points. |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 431 | */ |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 432 | @Test |
Pier Ventre | 766995d | 2016-10-05 22:15:56 -0700 | [diff] [blame] | 433 | public void nonTrivialTranslationForSp() { |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 434 | sut.activate(); |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 435 | Set<Link> testLinks = ImmutableSet.of( |
| 436 | DefaultLink.builder().providerId(PID).src(of1p2).dst(of2p1).type(DIRECT).build(), |
| 437 | DefaultLink.builder().providerId(PID).src(of2p2).dst(of3p1).type(DIRECT).build(), |
| 438 | DefaultLink.builder().providerId(PID).src(of2p3).dst(of4p1).type(DIRECT).build() |
| 439 | ); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 440 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 441 | TrafficSelector expectOf1Selector = DefaultTrafficSelector.builder(ipPrefixSelector) |
| 442 | .matchInPort(PortNumber.portNumber(1)) |
| 443 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 444 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 445 | TrafficTreatment expectOf1Treatment = DefaultTrafficTreatment.builder() |
| 446 | .setOutput(PortNumber.portNumber(2)) |
| 447 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 448 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 449 | TrafficSelector expectOf2Selector = DefaultTrafficSelector.builder(ipPrefixSelector) |
| 450 | .matchInPort(PortNumber.portNumber(1)) |
| 451 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 452 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 453 | TrafficTreatment expectOf2Treatment = DefaultTrafficTreatment.builder() |
| 454 | .setOutput(PortNumber.portNumber(2)) |
| 455 | .setOutput(PortNumber.portNumber(3)) |
| 456 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 457 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 458 | TrafficSelector expectOf3Selector = DefaultTrafficSelector.builder(ipPrefixSelector) |
| 459 | .matchInPort(PortNumber.portNumber(1)) |
| 460 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 461 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 462 | TrafficTreatment expectOf3Treatment = DefaultTrafficTreatment.builder(ethDstTreatment) |
| 463 | .setOutput(PortNumber.portNumber(2)) |
| 464 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 465 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 466 | TrafficSelector expectOf4Selector = DefaultTrafficSelector.builder(ipPrefixSelector) |
| 467 | .matchInPort(PortNumber.portNumber(1)) |
| 468 | .build(); |
| 469 | |
| 470 | TrafficTreatment expectOf4Treatment = DefaultTrafficTreatment.builder(ethDstTreatment) |
| 471 | .setOutput(PortNumber.portNumber(2)) |
| 472 | .build(); |
| 473 | |
| 474 | |
| 475 | |
Ray Milkey | 6e7843d | 2018-09-18 15:50:41 -0700 | [diff] [blame] | 476 | Set<FilteredConnectPoint> ingress = ImmutableSet.of( |
| 477 | new FilteredConnectPoint(of1p1) |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 478 | ); |
| 479 | |
Ray Milkey | 6e7843d | 2018-09-18 15:50:41 -0700 | [diff] [blame] | 480 | Set<FilteredConnectPoint> egress = ImmutableSet.of( |
| 481 | new FilteredConnectPoint(of3p2), |
| 482 | new FilteredConnectPoint(of4p2) |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 483 | ); |
| 484 | |
| 485 | intent = LinkCollectionIntent.builder() |
| 486 | .appId(APP_ID) |
| 487 | .selector(ipPrefixSelector) |
| 488 | .treatment(ethDstTreatment) |
Ray Milkey | 6e7843d | 2018-09-18 15:50:41 -0700 | [diff] [blame] | 489 | .filteredIngressPoints(ingress) |
| 490 | .filteredEgressPoints(egress) |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 491 | .applyTreatmentOnEgress(true) |
| 492 | .links(testLinks) |
| 493 | .build(); |
| 494 | |
| 495 | assertThat(sut, is(notNullValue())); |
| 496 | |
| 497 | List<Intent> result = sut.compile(intent, Collections.emptyList()); |
| 498 | |
| 499 | assertThat(result, is(notNullValue())); |
| 500 | assertThat(result, hasSize(1)); |
| 501 | |
| 502 | Intent resultIntent = result.get(0); |
| 503 | assertThat(resultIntent, instanceOf(FlowRuleIntent.class)); |
| 504 | |
| 505 | if (resultIntent instanceof FlowRuleIntent) { |
| 506 | FlowRuleIntent frIntent = (FlowRuleIntent) resultIntent; |
| 507 | |
| 508 | assertThat(frIntent.flowRules(), hasSize(4)); |
| 509 | |
| 510 | List<FlowRule> deviceFlowRules; |
| 511 | FlowRule flowRule; |
| 512 | |
| 513 | // Of1 |
| 514 | deviceFlowRules = getFlowRulesByDevice(of1Id, frIntent.flowRules()); |
| 515 | assertThat(deviceFlowRules, hasSize(1)); |
| 516 | flowRule = deviceFlowRules.get(0); |
| 517 | assertThat(flowRule.selector(), is(expectOf1Selector)); |
| 518 | assertThat(flowRule.treatment(), is(expectOf1Treatment)); |
| 519 | |
| 520 | // Of2 |
| 521 | deviceFlowRules = getFlowRulesByDevice(of2Id, frIntent.flowRules()); |
| 522 | assertThat(deviceFlowRules, hasSize(1)); |
| 523 | flowRule = deviceFlowRules.get(0); |
| 524 | assertThat(flowRule.selector(), is(expectOf2Selector)); |
| 525 | assertThat(flowRule.treatment(), is(expectOf2Treatment)); |
| 526 | |
| 527 | // Of3 |
| 528 | deviceFlowRules = getFlowRulesByDevice(of3Id, frIntent.flowRules()); |
| 529 | assertThat(deviceFlowRules, hasSize(1)); |
| 530 | flowRule = deviceFlowRules.get(0); |
| 531 | assertThat(flowRule.selector(), is(expectOf3Selector)); |
| 532 | assertThat(flowRule.treatment(), is(expectOf3Treatment)); |
| 533 | |
| 534 | // Of4 |
| 535 | deviceFlowRules = getFlowRulesByDevice(of4Id, frIntent.flowRules()); |
| 536 | assertThat(deviceFlowRules, hasSize(1)); |
| 537 | flowRule = deviceFlowRules.get(0); |
| 538 | assertThat(flowRule.selector(), is(expectOf4Selector)); |
| 539 | assertThat(flowRule.treatment(), is(expectOf4Treatment)); |
| 540 | |
| 541 | } |
| 542 | sut.deactivate(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 543 | } |
| 544 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 545 | /** |
| 546 | * Multi point to single point intent without filtered connect point. |
Pier Ventre | 5c4a076 | 2016-11-21 10:28:13 -0800 | [diff] [blame] | 547 | * Scenario is the follow: |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 548 | * |
| 549 | * -1 of1 2-1 of2 2-1 of4 2- |
| 550 | * 3 |
| 551 | * -1 of3 2---/ |
Pier Ventre | 5c4a076 | 2016-11-21 10:28:13 -0800 | [diff] [blame] | 552 | * |
| 553 | * We test the proper compilation of mp2sp intent with non trivial selector, |
| 554 | * non trivial treatment and simple connect points. |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 555 | */ |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 556 | @Test |
Pier Ventre | 766995d | 2016-10-05 22:15:56 -0700 | [diff] [blame] | 557 | public void nonTrivialTranslationForMp() { |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 558 | sut.activate(); |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 559 | Set<Link> testlinks = ImmutableSet.of( |
| 560 | DefaultLink.builder().providerId(PID).src(of1p2).dst(of2p1).type(DIRECT).build(), |
| 561 | DefaultLink.builder().providerId(PID).src(of3p2).dst(of2p3).type(DIRECT).build(), |
| 562 | DefaultLink.builder().providerId(PID).src(of2p2).dst(of4p1).type(DIRECT).build() |
| 563 | ); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 564 | |
Ray Milkey | 6e7843d | 2018-09-18 15:50:41 -0700 | [diff] [blame] | 565 | Set<FilteredConnectPoint> ingress = ImmutableSet.of( |
| 566 | new FilteredConnectPoint(of1p1), |
| 567 | new FilteredConnectPoint(of3p1) |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 568 | ); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 569 | |
Ray Milkey | 6e7843d | 2018-09-18 15:50:41 -0700 | [diff] [blame] | 570 | Set<FilteredConnectPoint> egress = ImmutableSet.of( |
| 571 | new FilteredConnectPoint(of4p2) |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 572 | ); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 573 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 574 | TrafficSelector expectOf1Selector = DefaultTrafficSelector.builder(ipPrefixSelector) |
| 575 | .matchInPort(PortNumber.portNumber(1)) |
| 576 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 577 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 578 | TrafficTreatment expectOf1Treatment = DefaultTrafficTreatment.builder(ethDstTreatment) |
| 579 | .setOutput(PortNumber.portNumber(2)) |
| 580 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 581 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 582 | TrafficSelector expectOf2Selector1 = DefaultTrafficSelector.builder(ipPrefixSelector) |
| 583 | .matchInPort(PortNumber.portNumber(1)) |
| 584 | .matchEthDst(MacAddress.valueOf("C0:FF:EE:C0:FF:EE")) |
| 585 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 586 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 587 | TrafficSelector expectOf2Selector2 = DefaultTrafficSelector.builder(ipPrefixSelector) |
| 588 | .matchEthDst(MacAddress.valueOf("C0:FF:EE:C0:FF:EE")) |
| 589 | .matchInPort(PortNumber.portNumber(3)) |
| 590 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 591 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 592 | TrafficTreatment expectOf2Treatment = DefaultTrafficTreatment.builder() |
| 593 | .setOutput(PortNumber.portNumber(2)) |
| 594 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 595 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 596 | TrafficSelector expectOf3Selector = DefaultTrafficSelector.builder(ipPrefixSelector) |
| 597 | .matchInPort(PortNumber.portNumber(1)) |
| 598 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 599 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 600 | TrafficTreatment expectOf3Treatment = DefaultTrafficTreatment.builder(ethDstTreatment) |
| 601 | .setOutput(PortNumber.portNumber(2)) |
| 602 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 603 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 604 | TrafficSelector expectOf4Selector = DefaultTrafficSelector.builder(ipPrefixSelector) |
| 605 | .matchEthDst(MacAddress.valueOf("C0:FF:EE:C0:FF:EE")) |
| 606 | .matchInPort(PortNumber.portNumber(1)) |
| 607 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 608 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 609 | TrafficTreatment expectOf4Treatment = DefaultTrafficTreatment.builder() |
| 610 | .setOutput(PortNumber.portNumber(2)) |
| 611 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 612 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 613 | intent = LinkCollectionIntent.builder() |
| 614 | .appId(APP_ID) |
| 615 | .selector(ipPrefixSelector) |
Ray Milkey | 6e7843d | 2018-09-18 15:50:41 -0700 | [diff] [blame] | 616 | .filteredIngressPoints(ingress) |
| 617 | .filteredEgressPoints(egress) |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 618 | .treatment(ethDstTreatment) |
| 619 | .links(testlinks) |
| 620 | .build(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 621 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 622 | List<Intent> result = sut.compile(intent, Collections.emptyList()); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 623 | |
Yi Tseng | 2a81c9d | 2016-09-14 10:14:24 -0700 | [diff] [blame] | 624 | assertThat(result, is(notNullValue())); |
| 625 | assertThat(result, hasSize(1)); |
| 626 | |
| 627 | Intent resultIntent = result.get(0); |
| 628 | assertThat(resultIntent, instanceOf(FlowRuleIntent.class)); |
| 629 | |
| 630 | if (resultIntent instanceof FlowRuleIntent) { |
| 631 | FlowRuleIntent frIntent = (FlowRuleIntent) resultIntent; |
| 632 | assertThat(frIntent.flowRules(), hasSize(5)); |
| 633 | |
| 634 | List<FlowRule> deviceFlowRules; |
| 635 | FlowRule flowRule; |
| 636 | |
| 637 | // Of1 |
| 638 | deviceFlowRules = getFlowRulesByDevice(of1Id, frIntent.flowRules()); |
| 639 | assertThat(deviceFlowRules, hasSize(1)); |
| 640 | flowRule = deviceFlowRules.get(0); |
| 641 | assertThat(flowRule.selector(), is(expectOf1Selector)); |
| 642 | assertThat(flowRule.treatment(), is(expectOf1Treatment)); |
| 643 | |
| 644 | // Of2 (has 2 flows) |
| 645 | deviceFlowRules = getFlowRulesByDevice(of2Id, frIntent.flowRules()); |
| 646 | assertThat(deviceFlowRules, hasSize(2)); |
| 647 | flowRule = deviceFlowRules.get(0); |
| 648 | assertThat(flowRule.selector(), is(expectOf2Selector1)); |
| 649 | assertThat(flowRule.treatment(), is(expectOf2Treatment)); |
| 650 | flowRule = deviceFlowRules.get(1); |
| 651 | assertThat(flowRule.selector(), is(expectOf2Selector2)); |
| 652 | assertThat(flowRule.treatment(), is(expectOf2Treatment)); |
| 653 | |
| 654 | // Of3 |
| 655 | deviceFlowRules = getFlowRulesByDevice(of3Id, frIntent.flowRules()); |
| 656 | assertThat(deviceFlowRules, hasSize(1)); |
| 657 | flowRule = deviceFlowRules.get(0); |
| 658 | assertThat(flowRule.selector(), is(expectOf3Selector)); |
| 659 | assertThat(flowRule.treatment(), is(expectOf3Treatment)); |
| 660 | |
| 661 | // Of4 |
| 662 | deviceFlowRules = getFlowRulesByDevice(of4Id, frIntent.flowRules()); |
| 663 | assertThat(deviceFlowRules, hasSize(1)); |
| 664 | flowRule = deviceFlowRules.get(0); |
| 665 | assertThat(flowRule.selector(), is(expectOf4Selector)); |
| 666 | assertThat(flowRule.treatment(), is(expectOf4Treatment)); |
| 667 | } |
| 668 | |
| 669 | sut.deactivate(); |
Pier Ventre | 27d4257 | 2016-08-29 17:37:08 -0700 | [diff] [blame] | 670 | } |
Pier Ventre | 766995d | 2016-10-05 22:15:56 -0700 | [diff] [blame] | 671 | |
| 672 | /** |
| 673 | * We test the proper compilation of mp2sp with |
| 674 | * trivial selector, trivial treatment and 1 hop. |
| 675 | */ |
| 676 | @Test |
| 677 | public void singleHopTestForMp() { |
| 678 | |
| 679 | intent = LinkCollectionIntent.builder() |
| 680 | .appId(APP_ID) |
| 681 | .selector(selector) |
| 682 | .treatment(treatment) |
| 683 | .links(ImmutableSet.of()) |
| 684 | .filteredIngressPoints(ImmutableSet.of( |
| 685 | new FilteredConnectPoint(d1p10), |
| 686 | new FilteredConnectPoint(d1p11) |
| 687 | )) |
| 688 | .filteredEgressPoints(ImmutableSet.of(new FilteredConnectPoint(d1p0))) |
| 689 | .build(); |
| 690 | |
| 691 | sut.activate(); |
| 692 | |
| 693 | List<Intent> compiled = sut.compile(intent, Collections.emptyList()); |
| 694 | assertThat(compiled, hasSize(1)); |
| 695 | |
| 696 | Collection<FlowRule> rules = ((FlowRuleIntent) compiled.get(0)).flowRules(); |
| 697 | assertThat(rules, hasSize(2)); |
| 698 | |
| 699 | Collection<FlowRule> rulesS1 = rules.stream() |
| 700 | .filter(rule -> rule.deviceId().equals(d1p0.deviceId())) |
| 701 | .collect(Collectors.toSet()); |
| 702 | assertThat(rulesS1, hasSize(2)); |
| 703 | FlowRule ruleS1 = rulesS1.stream() |
| 704 | .filter(rule -> { |
| 705 | PortCriterion inPort = (PortCriterion) rule.selector().getCriterion(IN_PORT); |
| 706 | return inPort.port().equals(d1p10.port()); |
| 707 | }) |
| 708 | .findFirst() |
| 709 | .get(); |
| 710 | assertThat(ruleS1.selector(), Is.is( |
| 711 | DefaultTrafficSelector |
| 712 | .builder() |
| 713 | .matchInPort(d1p10.port()) |
| 714 | .build() |
| 715 | )); |
| 716 | assertThat(ruleS1.treatment(), Is.is( |
| 717 | DefaultTrafficTreatment |
| 718 | .builder() |
| 719 | .setOutput(d1p0.port()) |
| 720 | .build() |
| 721 | )); |
| 722 | |
| 723 | ruleS1 = rulesS1.stream() |
| 724 | .filter(rule -> { |
| 725 | PortCriterion inPort = (PortCriterion) rule.selector().getCriterion(IN_PORT); |
| 726 | return inPort.port().equals(d1p11.port()); |
| 727 | }) |
| 728 | .findFirst() |
| 729 | .get(); |
| 730 | assertThat(ruleS1.selector(), Is.is( |
| 731 | DefaultTrafficSelector |
| 732 | .builder() |
| 733 | .matchInPort(d1p11.port()) |
| 734 | .build() |
| 735 | )); |
| 736 | assertThat(ruleS1.treatment(), Is.is( |
| 737 | DefaultTrafficTreatment |
| 738 | .builder() |
| 739 | .setOutput(d1p0.port()) |
| 740 | .build() |
| 741 | )); |
| 742 | |
| 743 | sut.deactivate(); |
| 744 | |
| 745 | } |
| 746 | |
| 747 | /** |
| 748 | * We test the proper compilation of sp2mp with |
| 749 | * trivial selector, trivial treatment and 1 hop. |
| 750 | */ |
| 751 | @Test |
| 752 | public void singleHopTestForSp() { |
| 753 | |
| 754 | intent = LinkCollectionIntent.builder() |
| 755 | .appId(APP_ID) |
| 756 | .selector(selector) |
| 757 | .treatment(treatment) |
| 758 | .applyTreatmentOnEgress(true) |
| 759 | .links(ImmutableSet.of()) |
| 760 | .filteredEgressPoints(ImmutableSet.of( |
| 761 | new FilteredConnectPoint(d1p10), |
| 762 | new FilteredConnectPoint(d1p11) |
| 763 | )) |
| 764 | .filteredIngressPoints(ImmutableSet.of(new FilteredConnectPoint(d1p0))) |
| 765 | .build(); |
| 766 | |
| 767 | sut.activate(); |
| 768 | |
| 769 | List<Intent> compiled = sut.compile(intent, Collections.emptyList()); |
| 770 | assertThat(compiled, hasSize(1)); |
| 771 | |
| 772 | Collection<FlowRule> rules = ((FlowRuleIntent) compiled.get(0)).flowRules(); |
| 773 | assertThat(rules, hasSize(1)); |
| 774 | |
| 775 | Collection<FlowRule> rulesS1 = rules.stream() |
| 776 | .filter(rule -> rule.deviceId().equals(d1p0.deviceId())) |
| 777 | .collect(Collectors.toSet()); |
| 778 | assertThat(rulesS1, hasSize(1)); |
| 779 | FlowRule ruleS1 = rulesS1.stream() |
| 780 | .filter(rule -> { |
| 781 | PortCriterion inPort = (PortCriterion) rule.selector().getCriterion(IN_PORT); |
| 782 | return inPort.port().equals(d1p0.port()); |
| 783 | }) |
| 784 | .findFirst() |
| 785 | .get(); |
| 786 | assertThat(ruleS1.selector(), Is.is( |
| 787 | DefaultTrafficSelector |
| 788 | .builder() |
| 789 | .matchInPort(d1p0.port()) |
| 790 | .build() |
| 791 | )); |
| 792 | assertThat(ruleS1.treatment(), Is.is( |
| 793 | DefaultTrafficTreatment |
| 794 | .builder() |
| 795 | .setOutput(d1p10.port()) |
| 796 | .setOutput(d1p11.port()) |
| 797 | .build() |
| 798 | )); |
| 799 | |
| 800 | sut.deactivate(); |
| 801 | |
| 802 | } |
| 803 | |
| 804 | /** |
| 805 | * We test the proper compilation of mp2sp with |
| 806 | * trivial selector, trivial treatment, filtered |
| 807 | * points and 1 hop. |
| 808 | */ |
| 809 | @Test |
| 810 | public void singleHopTestFilteredForMp() { |
| 811 | |
| 812 | intent = LinkCollectionIntent.builder() |
| 813 | .appId(APP_ID) |
| 814 | .selector(selector) |
| 815 | .treatment(treatment) |
| 816 | .links(ImmutableSet.of()) |
| 817 | .filteredIngressPoints(ImmutableSet.of( |
| 818 | new FilteredConnectPoint(d1p10, vlan100Selector), |
| 819 | new FilteredConnectPoint(d1p11, mpls69Selector) |
| 820 | )) |
| 821 | .filteredEgressPoints(ImmutableSet.of(new FilteredConnectPoint(d1p0, vlan200Selector))) |
| 822 | .build(); |
| 823 | |
| 824 | sut.activate(); |
| 825 | |
| 826 | List<Intent> compiled = sut.compile(intent, Collections.emptyList()); |
| 827 | assertThat(compiled, hasSize(1)); |
| 828 | |
| 829 | Collection<FlowRule> rules = ((FlowRuleIntent) compiled.get(0)).flowRules(); |
| 830 | assertThat(rules, hasSize(2)); |
| 831 | |
| 832 | Collection<FlowRule> rulesS1 = rules.stream() |
| 833 | .filter(rule -> rule.deviceId().equals(d1p0.deviceId())) |
| 834 | .collect(Collectors.toSet()); |
| 835 | assertThat(rulesS1, hasSize(2)); |
| 836 | FlowRule ruleS1 = rulesS1.stream() |
| 837 | .filter(rule -> { |
| 838 | PortCriterion inPort = (PortCriterion) rule.selector().getCriterion(IN_PORT); |
| 839 | return inPort.port().equals(d1p10.port()); |
| 840 | }) |
| 841 | .findFirst() |
| 842 | .get(); |
| 843 | assertThat(ruleS1.selector(), Is.is( |
| 844 | DefaultTrafficSelector |
| 845 | .builder(vlan100Selector) |
| 846 | .matchInPort(d1p10.port()) |
| 847 | .build() |
| 848 | )); |
| 849 | assertThat(ruleS1.treatment(), Is.is( |
| 850 | DefaultTrafficTreatment |
| 851 | .builder() |
| 852 | .setVlanId(((VlanIdCriterion) vlan200Selector.getCriterion(VLAN_VID)).vlanId()) |
| 853 | .setOutput(d1p0.port()) |
| 854 | .build() |
| 855 | )); |
| 856 | |
| 857 | ruleS1 = rulesS1.stream() |
| 858 | .filter(rule -> { |
| 859 | PortCriterion inPort = (PortCriterion) rule.selector().getCriterion(IN_PORT); |
| 860 | return inPort.port().equals(d1p11.port()); |
| 861 | }) |
| 862 | .findFirst() |
| 863 | .get(); |
| 864 | assertThat(ruleS1.selector(), Is.is( |
| 865 | DefaultTrafficSelector |
| 866 | .builder(mpls69Selector) |
| 867 | .matchInPort(d1p11.port()) |
| 868 | .build() |
| 869 | )); |
| 870 | assertThat(ruleS1.treatment(), Is.is( |
| 871 | DefaultTrafficTreatment |
| 872 | .builder() |
| 873 | .popMpls(IPV4.ethType()) |
| 874 | .pushVlan() |
| 875 | .setVlanId(((VlanIdCriterion) vlan200Selector.getCriterion(VLAN_VID)).vlanId()) |
| 876 | .setOutput(d1p0.port()) |
| 877 | .build() |
| 878 | )); |
| 879 | |
| 880 | sut.deactivate(); |
| 881 | |
| 882 | } |
| 883 | |
| 884 | /** |
| 885 | * We test the proper compilation of sp2mp with |
| 886 | * trivial selector, trivial treatment and 1 hop. |
| 887 | */ |
| 888 | @Test |
| 889 | public void singleHopTestFilteredForSp() { |
| 890 | |
| 891 | intent = LinkCollectionIntent.builder() |
| 892 | .appId(APP_ID) |
| 893 | .selector(selector) |
| 894 | .treatment(treatment) |
| 895 | .applyTreatmentOnEgress(true) |
| 896 | .links(ImmutableSet.of()) |
| 897 | .filteredEgressPoints(ImmutableSet.of( |
| 898 | new FilteredConnectPoint(d1p10, vlan100Selector), |
| 899 | new FilteredConnectPoint(d1p11, mpls80Selector) |
| 900 | )) |
| 901 | .filteredIngressPoints(ImmutableSet.of(new FilteredConnectPoint(d1p0, vlan200Selector))) |
| 902 | .build(); |
| 903 | |
| 904 | sut.activate(); |
| 905 | |
| 906 | List<Intent> compiled = sut.compile(intent, Collections.emptyList()); |
| 907 | assertThat(compiled, hasSize(1)); |
| 908 | |
| 909 | Collection<FlowRule> rules = ((FlowRuleIntent) compiled.get(0)).flowRules(); |
| 910 | assertThat(rules, hasSize(1)); |
| 911 | |
| 912 | Collection<FlowRule> rulesS1 = rules.stream() |
| 913 | .filter(rule -> rule.deviceId().equals(d1p0.deviceId())) |
| 914 | .collect(Collectors.toSet()); |
| 915 | assertThat(rulesS1, hasSize(1)); |
| 916 | FlowRule ruleS1 = rulesS1.stream() |
| 917 | .filter(rule -> { |
| 918 | PortCriterion inPort = (PortCriterion) rule.selector().getCriterion(IN_PORT); |
| 919 | return inPort.port().equals(d1p0.port()); |
| 920 | }) |
| 921 | .findFirst() |
| 922 | .get(); |
| 923 | assertThat(ruleS1.selector(), Is.is( |
| 924 | DefaultTrafficSelector |
| 925 | .builder(vlan200Selector) |
| 926 | .matchInPort(d1p0.port()) |
| 927 | .build() |
| 928 | )); |
| 929 | assertThat(ruleS1.treatment(), Is.is( |
| 930 | DefaultTrafficTreatment |
| 931 | .builder() |
| 932 | .setVlanId(((VlanIdCriterion) vlan100Selector.getCriterion(VLAN_VID)).vlanId()) |
| 933 | .setOutput(d1p10.port()) |
| 934 | .popVlan() |
| 935 | .pushMpls() |
| 936 | .setMpls(((MplsCriterion) mpls80Selector.getCriterion(MPLS_LABEL)).label()) |
| 937 | .setOutput(d1p11.port()) |
| 938 | .build() |
| 939 | )); |
| 940 | |
| 941 | sut.deactivate(); |
| 942 | |
| 943 | } |
| 944 | |
| 945 | /** |
| 946 | * We test the proper compilation of mp2sp with |
| 947 | * selector, treatment, filtered |
| 948 | * points and 1 hop. |
| 949 | */ |
| 950 | @Test |
| 951 | public void singleHopNonTrivialForMp() { |
| 952 | |
| 953 | intent = LinkCollectionIntent.builder() |
| 954 | .appId(APP_ID) |
| 955 | .selector(ipPrefixSelector) |
| 956 | .treatment(ethDstTreatment) |
| 957 | .links(ImmutableSet.of()) |
| 958 | .filteredIngressPoints(ImmutableSet.of( |
| 959 | new FilteredConnectPoint(d1p10, vlan100Selector), |
| 960 | new FilteredConnectPoint(d1p11, mpls100Selector) |
| 961 | )) |
| 962 | .filteredEgressPoints(ImmutableSet.of(new FilteredConnectPoint(d1p0, vlan200Selector))) |
| 963 | .build(); |
| 964 | |
| 965 | sut.activate(); |
| 966 | |
| 967 | List<Intent> compiled = sut.compile(intent, Collections.emptyList()); |
| 968 | assertThat(compiled, hasSize(1)); |
| 969 | |
| 970 | Collection<FlowRule> rules = ((FlowRuleIntent) compiled.get(0)).flowRules(); |
| 971 | assertThat(rules, hasSize(2)); |
| 972 | |
| 973 | Collection<FlowRule> rulesS1 = rules.stream() |
| 974 | .filter(rule -> rule.deviceId().equals(d1p0.deviceId())) |
| 975 | .collect(Collectors.toSet()); |
| 976 | assertThat(rulesS1, hasSize(2)); |
| 977 | FlowRule ruleS1 = rulesS1.stream() |
| 978 | .filter(rule -> { |
| 979 | PortCriterion inPort = (PortCriterion) rule.selector().getCriterion(IN_PORT); |
| 980 | return inPort.port().equals(d1p10.port()); |
| 981 | }) |
| 982 | .findFirst() |
| 983 | .get(); |
| 984 | assertThat(ruleS1.selector(), Is.is( |
| 985 | DefaultTrafficSelector |
| 986 | .builder(ipPrefixSelector) |
| 987 | .matchVlanId(((VlanIdCriterion) vlan100Selector.getCriterion(VLAN_VID)).vlanId()) |
| 988 | .matchInPort(d1p10.port()) |
| 989 | .build() |
| 990 | )); |
| 991 | assertThat(ruleS1.treatment(), Is.is( |
| 992 | DefaultTrafficTreatment |
| 993 | .builder() |
| 994 | .setEthDst(((ModEtherInstruction) ethDstTreatment |
| 995 | .allInstructions() |
| 996 | .stream() |
| 997 | .filter(instruction -> instruction instanceof ModEtherInstruction) |
| 998 | .findFirst().get()).mac()) |
| 999 | .setVlanId(((VlanIdCriterion) vlan200Selector.getCriterion(VLAN_VID)).vlanId()) |
| 1000 | .setOutput(d1p0.port()) |
| 1001 | .build() |
| 1002 | )); |
| 1003 | |
| 1004 | ruleS1 = rulesS1.stream() |
| 1005 | .filter(rule -> { |
| 1006 | PortCriterion inPort = (PortCriterion) rule.selector().getCriterion(IN_PORT); |
| 1007 | return inPort.port().equals(d1p11.port()); |
| 1008 | }) |
| 1009 | .findFirst() |
| 1010 | .get(); |
| 1011 | assertThat(ruleS1.selector(), Is.is( |
| 1012 | DefaultTrafficSelector |
| 1013 | .builder(ipPrefixSelector) |
| 1014 | .matchMplsLabel(((MplsCriterion) mpls100Selector.getCriterion(MPLS_LABEL)).label()) |
| 1015 | .matchInPort(d1p11.port()) |
| 1016 | .build() |
| 1017 | )); |
| 1018 | assertThat(ruleS1.treatment(), Is.is( |
| 1019 | DefaultTrafficTreatment |
| 1020 | .builder() |
| 1021 | .setEthDst(((ModEtherInstruction) ethDstTreatment |
| 1022 | .allInstructions() |
| 1023 | .stream() |
| 1024 | .filter(instruction -> instruction instanceof ModEtherInstruction) |
| 1025 | .findFirst().get()).mac()) |
| 1026 | .popMpls(IPV4.ethType()) |
| 1027 | .pushVlan() |
| 1028 | .setVlanId(((VlanIdCriterion) vlan200Selector.getCriterion(VLAN_VID)).vlanId()) |
| 1029 | .setOutput(d1p0.port()) |
| 1030 | .build() |
| 1031 | )); |
| 1032 | |
| 1033 | sut.deactivate(); |
| 1034 | |
| 1035 | } |
| 1036 | |
| 1037 | /** |
| 1038 | * We test the proper compilation of sp2mp with |
| 1039 | * selector, treatment and 1 hop. |
| 1040 | */ |
| 1041 | @Test |
| 1042 | public void singleHopNonTrivialForSp() { |
| 1043 | |
| 1044 | intent = LinkCollectionIntent.builder() |
| 1045 | .appId(APP_ID) |
| 1046 | .selector(ipPrefixSelector) |
| 1047 | .treatment(ethDstTreatment) |
| 1048 | .applyTreatmentOnEgress(true) |
| 1049 | .links(ImmutableSet.of()) |
| 1050 | .filteredEgressPoints(ImmutableSet.of( |
| 1051 | new FilteredConnectPoint(d1p10, vlan100Selector), |
| 1052 | new FilteredConnectPoint(d1p11, mpls200Selector) |
| 1053 | )) |
| 1054 | .filteredIngressPoints(ImmutableSet.of(new FilteredConnectPoint(d1p0, vlan200Selector))) |
| 1055 | .build(); |
| 1056 | |
| 1057 | sut.activate(); |
| 1058 | |
| 1059 | List<Intent> compiled = sut.compile(intent, Collections.emptyList()); |
| 1060 | assertThat(compiled, hasSize(1)); |
| 1061 | |
| 1062 | Collection<FlowRule> rules = ((FlowRuleIntent) compiled.get(0)).flowRules(); |
| 1063 | assertThat(rules, hasSize(1)); |
| 1064 | |
| 1065 | Collection<FlowRule> rulesS1 = rules.stream() |
| 1066 | .filter(rule -> rule.deviceId().equals(d1p0.deviceId())) |
| 1067 | .collect(Collectors.toSet()); |
| 1068 | assertThat(rulesS1, hasSize(1)); |
| 1069 | FlowRule ruleS1 = rulesS1.stream() |
| 1070 | .filter(rule -> { |
| 1071 | PortCriterion inPort = (PortCriterion) rule.selector().getCriterion(IN_PORT); |
| 1072 | return inPort.port().equals(d1p0.port()); |
| 1073 | }) |
| 1074 | .findFirst() |
| 1075 | .get(); |
| 1076 | assertThat(ruleS1.selector(), Is.is( |
| 1077 | DefaultTrafficSelector |
| 1078 | .builder(ipPrefixSelector) |
| 1079 | .matchVlanId(((VlanIdCriterion) vlan200Selector.getCriterion(VLAN_VID)).vlanId()) |
| 1080 | .matchInPort(d1p0.port()) |
| 1081 | .build() |
| 1082 | )); |
| 1083 | assertThat(ruleS1.treatment(), Is.is( |
| 1084 | DefaultTrafficTreatment |
| 1085 | .builder() |
| 1086 | .setEthDst(((ModEtherInstruction) ethDstTreatment |
| 1087 | .allInstructions() |
| 1088 | .stream() |
| 1089 | .filter(instruction -> instruction instanceof ModEtherInstruction) |
| 1090 | .findFirst().get()).mac()) |
| 1091 | .setVlanId(((VlanIdCriterion) vlan100Selector.getCriterion(VLAN_VID)).vlanId()) |
| 1092 | .setOutput(d1p10.port()) |
| 1093 | .setEthDst(((ModEtherInstruction) ethDstTreatment |
| 1094 | .allInstructions() |
| 1095 | .stream() |
| 1096 | .filter(instruction -> instruction instanceof ModEtherInstruction) |
| 1097 | .findFirst().get()).mac()) |
| 1098 | .popVlan() |
| 1099 | .pushMpls() |
| 1100 | .setMpls(((MplsCriterion) mpls200Selector.getCriterion(MPLS_LABEL)).label()) |
| 1101 | .setOutput(d1p11.port()) |
| 1102 | .build() |
| 1103 | )); |
| 1104 | |
| 1105 | sut.deactivate(); |
| 1106 | |
| 1107 | } |
| 1108 | |
Sho SHIMIZU | ee2aa65 | 2015-02-25 18:56:43 -0800 | [diff] [blame] | 1109 | } |