X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=interfacemgr%2Finterfacemgr-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fvpnservice%2Finterfacemgr%2Ftest%2FFlowBasedServicesStateConfigurationTest.java;h=84efb2277c41e3fd1133acb633b18bc37759c934;hb=bc9a454112d4456fe65538bb887b3c0be0e3b5bc;hp=ce7e9779f41d1c5300d96e2c8df6720156b3bf89;hpb=aeaccc092bb29499199a0fa99d2291cb1a756dfd;p=vpnservice.git diff --git a/interfacemgr/interfacemgr-impl/src/test/java/org/opendaylight/vpnservice/interfacemgr/test/FlowBasedServicesStateConfigurationTest.java b/interfacemgr/interfacemgr-impl/src/test/java/org/opendaylight/vpnservice/interfacemgr/test/FlowBasedServicesStateConfigurationTest.java index ce7e9779..84efb227 100644 --- a/interfacemgr/interfacemgr-impl/src/test/java/org/opendaylight/vpnservice/interfacemgr/test/FlowBasedServicesStateConfigurationTest.java +++ b/interfacemgr/interfacemgr-impl/src/test/java/org/opendaylight/vpnservice/interfacemgr/test/FlowBasedServicesStateConfigurationTest.java @@ -2,6 +2,7 @@ package org.opendaylight.vpnservice.interfacemgr.test; import com.google.common.base.Optional; import com.google.common.util.concurrent.Futures; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,6 +20,7 @@ import org.opendaylight.vpnservice.interfacemgr.servicebindings.flowbased.stateh import org.opendaylight.vpnservice.interfacemgr.servicebindings.flowbased.statehelpers.FlowBasedServicesStateUnbindHelper; import org.opendaylight.vpnservice.mdsalutil.*; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; @@ -33,6 +35,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.serviceb import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.servicebinding.rev151015.service.bindings.ServicesInfoKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.servicebinding.rev151015.service.bindings.services.info.BoundServices; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.servicebinding.rev151015.service.bindings.services.info.BoundServicesKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.interfacemgr.rev150331.IfL2vlan; import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.interfacemgr.rev150331.TunnelTypeGre; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -63,7 +66,7 @@ public class FlowBasedServicesStateConfigurationTest { Instruction instruction = null; InstructionKey instructionKey = null; Listinstructions = new ArrayList<>(); - short key =2; + short key =0; int ifIndexval = 100; int flowpriority = 2; String serviceName = "VPN"; @@ -100,8 +103,8 @@ public class FlowBasedServicesStateConfigurationTest { .setIfIndex(ifIndexval) .setLowerLayerIf(lowerLayerIfList) .setKey(IfmUtil.getStateInterfaceKeyFromName(InterfaceManagerTestUtil.interfaceName)) - .setName(InterfaceManagerTestUtil.interfaceName); - stypeOpenflow = InterfaceManagerTestUtil.buildStypeOpenflow(dpId,flowpriority, NwConstants.VLAN_INTERFACE_INGRESS_TABLE, instructions); + .setName(InterfaceManagerTestUtil.interfaceName).setType(interfaceEnabled.getType()); + stypeOpenflow = InterfaceManagerTestUtil.buildStypeOpenflow(dpId,flowpriority, NwConstants.LPORT_DISPATCHER_TABLE, instructions); instructionKey = new InstructionKey(instructionKeyval); BigInteger[] metadataValues = IfmUtil.mergeOpenflowMetadataWriteInstructions(instructions); boundService = InterfaceManagerTestUtil.buildBoundServices(serviceName,key,new BoundServicesKey(key),stypeOpenflow); @@ -125,7 +128,9 @@ public class FlowBasedServicesStateConfigurationTest { List instructionList = boundService.getAugmentation(StypeOpenflow.class).getInstruction(); String serviceRef = boundService.getServiceName(); List matches = new ArrayList<>(); - matches.add(new MatchInfo(MatchFieldType.in_port, new BigInteger[]{dpId, BigInteger.valueOf(portNum)})); + matches.add(new MatchInfo(MatchFieldType.metadata, new BigInteger[] { + MetaDataUtil.getMetaDataForLPortDispatcher(ifaceBuilder.getIfIndex(), boundService.getServicePriority()), + MetaDataUtil.getMetaDataMaskForLPortDispatcher() })); ingressFlow = MDSALUtil.buildFlowNew(stypeOpenflow.getDispatcherTableId(), flowRef, boundService.getServicePriority(), serviceRef, 0, 0, stypeOpenflow.getFlowCookie(), matches, instructionList); FlowKey flowKey = new FlowKey(new FlowId(ingressFlow.getId()));