Merge "L2 Gw create changes related to ITM Tunnels creation in neutronvpn module"
[vpnservice.git] / interfacemgr / interfacemgr-impl / src / test / java / org / opendaylight / vpnservice / interfacemgr / test / InterfaceManagerTestUtil.java
index 89d7db18a4b3e0d8ab75f0dad761d2052778a22a..9b1e0feb2dbe34da65d24ec935b1417b3886733b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -146,11 +146,11 @@ public class InterfaceManagerTestUtil {
                                            BigInteger dpn) {
         InterfaceBuilder builder = new InterfaceBuilder().setKey(new InterfaceKey(ifName)).setName(ifName)
                 .setDescription(desc).setEnabled(enabled).setType((Class<? extends InterfaceType>) ifType);
-        ParentRefs parentRefs = new ParentRefsBuilder().setDatapathNodeIdentifier(dpn).build();
+        ParentRefs parentRefs = new ParentRefsBuilder().setDatapathNodeIdentifier(dpn).setParentInterface(ifName).build();
         builder.addAugmentation(ParentRefs.class, parentRefs);
         if(ifType.equals(L2vlan.class)){
             IfL2vlan l2vlan = new IfL2vlanBuilder().setVlanId(VlanId.getDefaultInstance("0"))
-                    .setL2vlanMode(IfL2vlan.L2vlanMode.Access).build();
+                    .setL2vlanMode(IfL2vlan.L2vlanMode.Trunk).build();
             builder.addAugmentation(IfL2vlan.class, l2vlan);
         }else if(ifType.equals(IfTunnel.class)){
             IfTunnel tunnel = new IfTunnelBuilder().setTunnelDestination(null).setTunnelGateway(null).setTunnelSource(null)
@@ -169,7 +169,7 @@ public class InterfaceManagerTestUtil {
         IpAddress remoteIp = new IpAddress(Ipv4Address.getDefaultInstance(remoteIpStr));
         IpAddress localIp =  new IpAddress(Ipv4Address.getDefaultInstance(localIpStr));
         IfTunnel tunnel = new IfTunnelBuilder().setTunnelDestination(remoteIp).setTunnelGateway(localIp).setTunnelSource(localIp)
-                    .setTunnelInterfaceType( tunType).build();
+                    .setTunnelInterfaceType( tunType).setInternal(true).build();
         builder.addAugmentation(IfTunnel.class, tunnel);
         return builder.build();
     }
@@ -218,8 +218,7 @@ public class InterfaceManagerTestUtil {
     public static String buildflowRef(BigInteger dpId,String servicaName,String boundServicename, short servicePriority)
     {
         String flowRef = new StringBuffer().append(dpId).append(NwConstants.VLAN_INTERFACE_INGRESS_TABLE).append(NwConstants.FLOWID_SEPARATOR).
-                append(servicaName).append(NwConstants.FLOWID_SEPARATOR).append(boundServicename).
-                append(NwConstants.FLOWID_SEPARATOR).append(servicePriority).toString();
+                append(servicaName).append(NwConstants.FLOWID_SEPARATOR).append(servicePriority).toString();
         return flowRef;
     }