blob: 850e21ff381c3216868a546a02d276d182218fcd [file] [log] [blame]
Yi Tseng0b809722017-11-03 10:23:26 -07001/*
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 Cascone36d5e7a2019-09-25 01:02:53 -070017package org.onosproject.pipelines.fabric.impl.behaviour.pipeliner;
Yi Tseng0b809722017-11-03 10:23:26 -070018
Carmelo Cascone41644362018-08-09 16:56:43 -070019import org.junit.Test;
Yi Tseng0b809722017-11-03 10:23:26 -070020import org.onlab.packet.IpPrefix;
21import org.onlab.packet.MacAddress;
22import org.onlab.packet.MplsLabel;
23import org.onlab.packet.VlanId;
24import org.onosproject.TestApplicationId;
25import org.onosproject.core.ApplicationId;
26import org.onosproject.net.DeviceId;
27import org.onosproject.net.PortNumber;
Yi Tseng20f9e7b2018-05-24 23:27:39 +080028import org.onosproject.net.flow.DefaultTrafficSelector;
29import org.onosproject.net.flow.TrafficSelector;
Carmelo Cascone36d5e7a2019-09-25 01:02:53 -070030import org.onosproject.pipelines.fabric.impl.behaviour.FabricCapabilities;
Yi Tseng0b809722017-11-03 10:23:26 -070031
32import static org.easymock.EasyMock.createNiceMock;
33import static org.easymock.EasyMock.expect;
34import static org.easymock.EasyMock.replay;
35
Carmelo Cascone41644362018-08-09 16:56:43 -070036public class FabricPipelinerTest {
Yi Tseng0b809722017-11-03 10:23:26 -070037 static final ApplicationId APP_ID = TestApplicationId.create("FabricPipelinerTest");
Carmelo Cascone45cc0862018-11-26 11:50:41 -080038 static final ApplicationId XCONNECT_APP_ID = TestApplicationId.create("FabricPipelinerTest.xconnect");
Yi Tseng0b809722017-11-03 10:23:26 -070039 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 Tseng1b154bd2017-11-20 17:48:19 -080042 static final PortNumber PORT_2 = PortNumber.portNumber(2);
Yi Tseng0b809722017-11-03 10:23:26 -070043 static final VlanId VLAN_100 = VlanId.vlanId("100");
Daniele Moro77ef35c2019-07-30 10:43:10 -070044 static final VlanId VLAN_200 = VlanId.vlanId("200");
Yi Tseng0b809722017-11-03 10:23:26 -070045 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 Tseng20f9e7b2018-05-24 23:27:39 +080053 static final TrafficSelector VLAN_META = DefaultTrafficSelector.builder()
54 .matchVlanId(VLAN_100)
55 .build();
Yi Tseng0b809722017-11-03 10:23:26 -070056
Carmelo Casconeb5324e72018-11-25 02:26:32 -080057 FabricCapabilities capabilitiesHashed;
58 FabricCapabilities capabilitiesSimple;
Yi Tseng0b809722017-11-03 10:23:26 -070059
Carmelo Casconeb5324e72018-11-25 02:26:32 -080060 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 Moro77ef35c2019-07-30 10:43:10 -070065 expect(capabilitiesSimple.supportDoubleVlanTerm()).andReturn(true).anyTimes();
Carmelo Casconeb5324e72018-11-25 02:26:32 -080066 replay(capabilitiesHashed);
67 replay(capabilitiesSimple);
Yi Tseng0b809722017-11-03 10:23:26 -070068 }
Carmelo Cascone41644362018-08-09 16:56:43 -070069
70 @Test
71 public void fakeTest() {
72 // Needed otherwise Bazel complains about a test class without test cases.
73 assert true;
74 }
Yi Tseng0b809722017-11-03 10:23:26 -070075}