Merge "Added the robot framework to OVSDB VMs"
authorFlavio Fernandes <ffernand@redhat.com>
Mon, 29 Jun 2015 17:12:59 +0000 (17:12 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 29 Jun 2015 17:12:59 +0000 (17:12 +0000)
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/AbstractServiceInstance.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/InboundNatService.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/ConfigurationService.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/EgressAclProvider.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/IngressAclProvider.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/TenantNetworkManagerImpl.java

index 20fd37f3eb3191612abb0648683e924608de884c..62c3464867f05766a9813d43869bce967e6479ea 100644 (file)
@@ -190,7 +190,7 @@ public abstract class AbstractServiceInstance {
         return null;
     }
 
-    protected Long getDpid(Node node) {
+    private Long getDpid(Node node) {
         Long dpid = 0L;
         dpid = southbound.getDataPathId(node);
         if (dpid == 0) {
@@ -202,7 +202,7 @@ public abstract class AbstractServiceInstance {
     /**
      * Program Default Pipeline Flow.
      *
-     * @param Node on which the default pipeline flow is programmed.
+     * @param node on which the default pipeline flow is programmed.
      */
     protected void programDefaultPipelineRule(Node node) {
         if (!isBridgeInPipeline(node)) {
index 502f3ceedb3dbae1d7f7c5cd79978c70db73cf9a..c182ad4550c9b6885979deabe8eee787ffda9480 100644 (file)
@@ -27,14 +27,11 @@ import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
 import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
@@ -44,12 +41,10 @@ import com.google.common.collect.Lists;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg3;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxRegCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 
 public class InboundNatService extends AbstractServiceInstance implements ConfigInterface, InboundNatProvider {
-    public final static long REG_VALUE_NO_INBOUND_REWRITE = 0x0L;
     public static final Class<? extends NxmNxReg> REG_FIELD = NxmNxReg3.class;
 
     public InboundNatService() {
@@ -166,77 +161,6 @@ public class InboundNatService extends AbstractServiceInstance implements Config
         return new Status(StatusCode.SUCCESS);
     }
 
-    /**
-     * Program Default Pipeline Flow for Inbound NAT.
-     *
-     * @param node on which the default pipeline flow is programmed.
-     */
-    @Override
-    protected void programDefaultPipelineRule(Node node) {
-        if (!isBridgeInPipeline(node)) {
-            //logger.trace("Bridge is not in pipeline {} ", node);
-            return;
-        }
-        MatchBuilder matchBuilder = new MatchBuilder();
-        FlowBuilder flowBuilder = new FlowBuilder();
-        Long dpid = getDpid(node);
-        if (dpid == 0L) {
-            return;
-        }
-        String nodeName = OPENFLOW + getDpid(node);
-        NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
-
-        // Create the OF Actions and Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-
-        // Instructions List Stores Individual Instructions
-        List<Instruction> instructions = Lists.newArrayList();
-
-        // Set register to indicate that rewrite did _not_ take place
-        InstructionBuilder ib = new InstructionBuilder();
-        List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actionList =
-                Lists.newArrayList();
-        ActionBuilder ab = new ActionBuilder();
-        ab.setAction(ActionUtils.nxLoadRegAction(new DstNxRegCaseBuilder().setNxReg(REG_FIELD).build(),
-                BigInteger.valueOf(REG_VALUE_NO_INBOUND_REWRITE)));
-        ab.setOrder(1);
-        ab.setKey(new ActionKey(1));
-        actionList.add(ab.build());
-
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-        ib.setOrder(0);
-        ib.setKey(new InstructionKey(0));
-        instructions.add(ib.build());
-
-        // Call the InstructionBuilder Methods Containing Actions
-        ib = getMutablePipelineInstructionBuilder();
-        ib.setOrder(1);
-        ib.setKey(new InstructionKey(1));
-        instructions.add(ib.build());
-
-        // Add InstructionBuilder to the Instruction(s)Builder List
-        isb.setInstruction(instructions);
-
-        // Add InstructionsBuilder to FlowBuilder
-        flowBuilder.setInstructions(isb.build());
-
-        String flowId = "CUSTOM_DEFAULT_PIPELINE_FLOW_"+getTable();
-        flowBuilder.setId(new FlowId(flowId));
-        FlowKey key = new FlowKey(new FlowId(flowId));
-        flowBuilder.setMatch(matchBuilder.build());
-        flowBuilder.setPriority(0);
-        flowBuilder.setBarrier(true);
-        flowBuilder.setTableId(getTable());
-        flowBuilder.setKey(key);
-        flowBuilder.setFlowName(flowId);
-        flowBuilder.setHardTimeout(0);
-        flowBuilder.setIdleTimeout(0);
-        writeFlow(flowBuilder, nodeBuilder);
-    }
-
     @Override
     public void setDependencies(BundleContext bundleContext, ServiceReference serviceReference) {
         super.setDependencies(bundleContext.getServiceReference(InboundNatProvider.class.getName()), this);
index 5306d202365bcfe31e6b9f618f57815e7b747f82..57ec5d951c9eff82c23cef416f30e5088050a758 100644 (file)
@@ -26,52 +26,52 @@ public interface ConfigurationService {
     /**
      * Returns the name configured name of the Integration Bridge
      */
-    public String getIntegrationBridgeName();
+    String getIntegrationBridgeName();
 
     /**
      * Configures the name of the Integration Bridge
      */
-    public void setIntegrationBridgeName(String integrationBridgeName);
+    void setIntegrationBridgeName(String integrationBridgeName);
 
     /**
      * Returns the name configured name of the Network Bridge
      */
-    public String getNetworkBridgeName();
+    String getNetworkBridgeName();
 
     /**
      * Configures the name of the Network Bridge
      */
-    public void setNetworkBridgeName(String networkBridgeName);
+    void setNetworkBridgeName(String networkBridgeName);
 
     /**
      * Returns the name configured name of the ExternalBridge
      */
-    public String getExternalBridgeName();
+    String getExternalBridgeName();
 
     /**
      * Configures the name of the External Bridge
      */
-    public void setExternalBridgeName(String externalBridgeName);
+    void setExternalBridgeName(String externalBridgeName);
 
     /**
      * Returns the key used to access the Tunnel Endpoint configuration from Open vSwitch
      */
-    public String getTunnelEndpointKey();
+    String getTunnelEndpointKey();
 
     /**
      * Sets the key used to access the Tunnel Endpoint configuration from Open vSwitch
      */
-    public void setTunnelEndpointKey(String tunnelEndpointKey);
+    void setTunnelEndpointKey(String tunnelEndpointKey);
 
     /**
      * Returns a Map of patch port names where the key is a tuple of source bridge and destination bridge
      */
-    public Map<Pair<String, String>, String> getPatchPortNames();
+    Map<Pair<String, String>, String> getPatchPortNames();
 
     /**
      * Sets the Map of source/destination bridges to patch port name
      */
-    public void setPatchPortNames(Map<Pair<String, String>, String> patchPortNames);
+    void setPatchPortNames(Map<Pair<String, String>, String> patchPortNames);
 
     /**
      * Get the name of a patch port
@@ -79,27 +79,27 @@ public interface ConfigurationService {
      *                  is the source bridge and R the destination bridge
      * @return the name of the patch port
      */
-    public String getPatchPortName(Pair portTuple);
+    String getPatchPortName(Pair portTuple);
 
     /**
      * Returns the key used to access the Tunnel Endpoint configuration from Open vSwitch
      */
-    public String getProviderMappingsKey();
+    String getProviderMappingsKey();
 
     /**
      * Sets the key used to access the Tunnel Endpoint configuration from Open vSwitch
      */
-    public void setProviderMappingsKey(String providerMappingsKey);
+    void setProviderMappingsKey(String providerMappingsKey);
 
     /**
      * Gets the default provider mapping
      */
-    public String getDefaultProviderMapping();
+    String getDefaultProviderMapping();
 
     /**
      * Sets the default provider mapping
      */
-    public void setDefaultProviderMapping(String providerMapping);
+    void setDefaultProviderMapping(String providerMapping);
 
     /**
      * Gets the tunnel endpoint address for a given Node
@@ -107,7 +107,7 @@ public interface ConfigurationService {
      * @return the tunnel endpoint
      * @see java.net.InetAddress
      */
-    public InetAddress getTunnelEndPoint(Node node);
+    InetAddress getTunnelEndPoint(Node node);
 
     /**
      * Returns the OpenFlow version to be used by the {@link NetworkingProvider}
@@ -115,19 +115,19 @@ public interface ConfigurationService {
      * @param node the node to query
      * @return the OpenFlow version to use
      */
-    public String getOpenflowVersion(Node node);
+    String getOpenflowVersion(Node node);
 
     /**
      * Determine if L3 forwarding is enabled
      * @return true if ovsdb net-virt is configured to perform L3 forwarding
      */
-    public boolean isL3ForwardingEnabled();
+    boolean isL3ForwardingEnabled();
 
     /**
      * Determine if Distributed ARP Responder is enabled
      * @return true if ovsdb net-virt is configured for distributed arp responder
      */
-    public boolean isDistributedArpDisabled();
+    boolean isDistributedArpDisabled();
 
     /**
      * Returns the MacAddress to be used for the default gateway by the {@link L3ForwardingProvider}
@@ -135,5 +135,5 @@ public interface ConfigurationService {
      * @param node the node to query
      * @return the MacAddress to use for the default gateway; or null if none is configured.
      */
-    public String getDefaultGatewayMacAddress(Node node);
+    String getDefaultGatewayMacAddress(Node node);
 }
index c9266e601d0814b5dde9274d71833a5f925535f3..315a7846c9bd9dda50ca789cd9378b6ad3aafd5b 100644 (file)
@@ -10,7 +10,6 @@ public interface EgressAclProvider {
     /**
      * Program port security ACL.
      *
-     * @param node the node
      * @param dpid the dpid
      * @param segmentationId the segmentation id
      * @param attachedMac the attached mac
index 97deed200c1b6460823b9caec360b4c625fc89ca..7a0d0ae10ff6c2bdf2076df2edbcbcab61e4b00e 100644 (file)
@@ -19,7 +19,6 @@ public interface IngressAclProvider {
     /**
      * Program port security ACL.
      *
-     * @param node the node
      * @param dpid the dpid
      * @param segmentationId the segmentation id
      * @param attachedMac the attached mac
index f04f9df0c066dd15f4d6e260ec9ba6935611f192..1ecfa0168bb08c945d08f6df846c079601716eb8 100644 (file)
@@ -124,19 +124,16 @@ public class TenantNetworkManagerImpl implements ConfigInterface, TenantNetworkM
                 if (neutronNetwork != null) {
                     logger.debug("mapped to {}", neutronNetwork);
                 } else {
-                    logger.debug("getTenantNetwork: did not find neutronNetwork in cache");
+                    logger.debug("getTenantNetwork: did not find neutronNetwork in cache from neutronPort {}",
+                                 neutronPortId);
                 }
             } else {
-                logger.debug("getTenantNetwork: did not find neutronPort in cache");
+                logger.info("getTenantNetwork did not find neutronPort {} from termination point {}",
+                        neutronPortId, terminationPointAugmentation.getName());
             }
         } else {
             logger.debug("getTenantNetwork: did not find {} in external_ids", Constants.EXTERNAL_ID_INTERFACE_ID);
         }
-        if (neutronNetwork != null) {
-            logger.debug("mapped to {}", neutronNetwork);
-        } else {
-            logger.warn("getTenantNetwork did not find network for {}", terminationPointAugmentation.getName());
-        }
         return neutronNetwork;
     }