blob: 5015d4e99337553a77d999b6fc0162650544048b [file] [log] [blame]
Carmelo Cascone2388cc12021-05-26 19:30:30 +02001/*
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
17package org.onosproject.pipelines.fabric.impl.behaviour.pipeliner;
18
19import org.junit.Test;
20import 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;
28import org.onosproject.net.flow.DefaultTrafficSelector;
29import org.onosproject.net.flow.TrafficSelector;
30import org.onosproject.pipelines.fabric.impl.behaviour.FabricCapabilities;
31
32import static org.easymock.EasyMock.createNiceMock;
33import static org.easymock.EasyMock.expect;
34import static org.easymock.EasyMock.replay;
35
36public class BaseObjectiveTranslatorTest {
37 static final ApplicationId APP_ID = TestApplicationId.create("FabricPipelinerTest");
38 static final ApplicationId XCONNECT_APP_ID = TestApplicationId.create("FabricPipelinerTest.xconnect");
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);
42 static final PortNumber PORT_2 = PortNumber.portNumber(2);
43 static final VlanId VLAN_100 = VlanId.vlanId("100");
44 static final VlanId VLAN_200 = VlanId.vlanId("200");
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");
Wailok Shumfb7e7872021-06-18 17:30:08 +080047 static final MacAddress SPINE1_MAC = MacAddress.valueOf("00:00:00:00:03:01");
48 static final MacAddress SPINE2_MAC = MacAddress.valueOf("00:00:00:00:03:02");
Carmelo Cascone2388cc12021-05-26 19:30:30 +020049 static final IpPrefix IPV4_UNICAST_ADDR = IpPrefix.valueOf("10.0.0.1/32");
50 static final IpPrefix IPV4_MCAST_ADDR = IpPrefix.valueOf("224.0.0.1/32");
51 static final IpPrefix IPV6_UNICAST_ADDR = IpPrefix.valueOf("2000::1/32");
52 static final IpPrefix IPV6_MCAST_ADDR = IpPrefix.valueOf("ff00::1/32");
53 static final MplsLabel MPLS_10 = MplsLabel.mplsLabel(10);
54 static final Integer NEXT_ID_1 = 1;
55 static final TrafficSelector VLAN_META = DefaultTrafficSelector.builder()
56 .matchVlanId(VLAN_100)
57 .build();
58
59 FabricCapabilities capabilitiesHashed;
60 FabricCapabilities capabilitiesSimple;
61
62 void doSetup() {
63 this.capabilitiesHashed = createNiceMock(FabricCapabilities.class);
64 this.capabilitiesSimple = createNiceMock(FabricCapabilities.class);
65 expect(capabilitiesHashed.hasHashedTable()).andReturn(true).anyTimes();
66 expect(capabilitiesHashed.supportDoubleVlanTerm()).andReturn(true).anyTimes();
67 expect(capabilitiesSimple.hasHashedTable()).andReturn(false).anyTimes();
68 expect(capabilitiesSimple.supportDoubleVlanTerm()).andReturn(true).anyTimes();
69 replay(capabilitiesHashed);
70 replay(capabilitiesSimple);
71 }
72
73 @Test
74 public void fakeTest() {
75 // Needed otherwise Bazel complains about a test class without test cases.
76 assert true;
77 }
78}