Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 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 | |
Carmelo Cascone | 36d5e7a | 2019-09-25 01:02:53 -0700 | [diff] [blame^] | 17 | package org.onosproject.pipelines.fabric.impl.behaviour.pipeliner; |
Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 18 | |
Carmelo Cascone | 4164436 | 2018-08-09 16:56:43 -0700 | [diff] [blame] | 19 | import org.junit.Test; |
Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 20 | import org.onlab.packet.IpPrefix; |
| 21 | import org.onlab.packet.MacAddress; |
| 22 | import org.onlab.packet.MplsLabel; |
| 23 | import org.onlab.packet.VlanId; |
| 24 | import org.onosproject.TestApplicationId; |
| 25 | import org.onosproject.core.ApplicationId; |
| 26 | import org.onosproject.net.DeviceId; |
| 27 | import org.onosproject.net.PortNumber; |
Yi Tseng | 20f9e7b | 2018-05-24 23:27:39 +0800 | [diff] [blame] | 28 | import org.onosproject.net.flow.DefaultTrafficSelector; |
| 29 | import org.onosproject.net.flow.TrafficSelector; |
Carmelo Cascone | 36d5e7a | 2019-09-25 01:02:53 -0700 | [diff] [blame^] | 30 | import org.onosproject.pipelines.fabric.impl.behaviour.FabricCapabilities; |
Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 31 | |
| 32 | import static org.easymock.EasyMock.createNiceMock; |
| 33 | import static org.easymock.EasyMock.expect; |
| 34 | import static org.easymock.EasyMock.replay; |
| 35 | |
Carmelo Cascone | 4164436 | 2018-08-09 16:56:43 -0700 | [diff] [blame] | 36 | public class FabricPipelinerTest { |
Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 37 | static final ApplicationId APP_ID = TestApplicationId.create("FabricPipelinerTest"); |
Carmelo Cascone | 45cc086 | 2018-11-26 11:50:41 -0800 | [diff] [blame] | 38 | static final ApplicationId XCONNECT_APP_ID = TestApplicationId.create("FabricPipelinerTest.xconnect"); |
Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 39 | static final DeviceId DEVICE_ID = DeviceId.deviceId("device:bmv2:11"); |
| 40 | static final int PRIORITY = 100; |
| 41 | static final PortNumber PORT_1 = PortNumber.portNumber(1); |
Yi Tseng | 1b154bd | 2017-11-20 17:48:19 -0800 | [diff] [blame] | 42 | static final PortNumber PORT_2 = PortNumber.portNumber(2); |
Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 43 | static final VlanId VLAN_100 = VlanId.vlanId("100"); |
Daniele Moro | 77ef35c | 2019-07-30 10:43:10 -0700 | [diff] [blame] | 44 | static final VlanId VLAN_200 = VlanId.vlanId("200"); |
Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 45 | static final MacAddress HOST_MAC = MacAddress.valueOf("00:00:00:00:00:01"); |
| 46 | static final MacAddress ROUTER_MAC = MacAddress.valueOf("00:00:00:00:02:01"); |
| 47 | static final IpPrefix IPV4_UNICAST_ADDR = IpPrefix.valueOf("10.0.0.1/32"); |
| 48 | static final IpPrefix IPV4_MCAST_ADDR = IpPrefix.valueOf("224.0.0.1/32"); |
| 49 | static final IpPrefix IPV6_UNICAST_ADDR = IpPrefix.valueOf("2000::1/32"); |
| 50 | static final IpPrefix IPV6_MCAST_ADDR = IpPrefix.valueOf("ff00::1/32"); |
| 51 | static final MplsLabel MPLS_10 = MplsLabel.mplsLabel(10); |
| 52 | static final Integer NEXT_ID_1 = 1; |
Yi Tseng | 20f9e7b | 2018-05-24 23:27:39 +0800 | [diff] [blame] | 53 | static final TrafficSelector VLAN_META = DefaultTrafficSelector.builder() |
| 54 | .matchVlanId(VLAN_100) |
| 55 | .build(); |
Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 56 | |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 57 | FabricCapabilities capabilitiesHashed; |
| 58 | FabricCapabilities capabilitiesSimple; |
Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 59 | |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 60 | void doSetup() { |
| 61 | this.capabilitiesHashed = createNiceMock(FabricCapabilities.class); |
| 62 | this.capabilitiesSimple = createNiceMock(FabricCapabilities.class); |
| 63 | expect(capabilitiesHashed.hasHashedTable()).andReturn(true).anyTimes(); |
| 64 | expect(capabilitiesSimple.hasHashedTable()).andReturn(false).anyTimes(); |
Daniele Moro | 77ef35c | 2019-07-30 10:43:10 -0700 | [diff] [blame] | 65 | expect(capabilitiesSimple.supportDoubleVlanTerm()).andReturn(true).anyTimes(); |
Carmelo Cascone | b5324e7 | 2018-11-25 02:26:32 -0800 | [diff] [blame] | 66 | replay(capabilitiesHashed); |
| 67 | replay(capabilitiesSimple); |
Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 68 | } |
Carmelo Cascone | 4164436 | 2018-08-09 16:56:43 -0700 | [diff] [blame] | 69 | |
| 70 | @Test |
| 71 | public void fakeTest() { |
| 72 | // Needed otherwise Bazel complains about a test class without test cases. |
| 73 | assert true; |
| 74 | } |
Yi Tseng | 0b80972 | 2017-11-03 10:23:26 -0700 | [diff] [blame] | 75 | } |