From: Giovanni Meo Date: Wed, 18 Sep 2013 10:18:22 +0000 (+0000) Subject: Merge "Add missing validation on ContainerFlowConfig objects" X-Git-Tag: releasepom-0.1.0~71 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=90eed73c5c4dbd851fcb7665b20f6ac04dfa9dfd;hp=35ad7fd59840898927b9a9c331b6a71f5808908c Merge "Add missing validation on ContainerFlowConfig objects" --- diff --git a/opendaylight/clustering/integrationtest/pom.xml b/opendaylight/clustering/integrationtest/pom.xml index 8339c4a4db..93b3624c82 100644 --- a/opendaylight/clustering/integrationtest/pom.xml +++ b/opendaylight/clustering/integrationtest/pom.xml @@ -56,11 +56,20 @@ java + + + + org.jacoco + jacoco-maven-plugin + 0.5.3.201107060350 + + + org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} ../implementation/target/jacoco-it.exec org.opendaylight.controller.* diff --git a/opendaylight/clustering/services_implementation/pom.xml b/opendaylight/clustering/services_implementation/pom.xml index c0a8064493..d6bd287434 100644 --- a/opendaylight/clustering/services_implementation/pom.xml +++ b/opendaylight/clustering/services_implementation/pom.xml @@ -30,7 +30,7 @@ org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} diff --git a/opendaylight/commons/opendaylight/pom.xml b/opendaylight/commons/opendaylight/pom.xml index cb1892ae66..9d7950af73 100644 --- a/opendaylight/commons/opendaylight/pom.xml +++ b/opendaylight/commons/opendaylight/pom.xml @@ -55,6 +55,7 @@ 1.0-SNAPSHOT 2.3.2 3.1 + 0.5.3.201107060350 diff --git a/opendaylight/containermanager/it.implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerManager.java b/opendaylight/containermanager/it.implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerManager.java index b5624af6af..24ef0c08ef 100644 --- a/opendaylight/containermanager/it.implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerManager.java +++ b/opendaylight/containermanager/it.implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerManager.java @@ -192,8 +192,7 @@ public class ContainerManager implements IContainerManager { @Override public boolean doesContainerExist(String ContainerId) { - // TODO Auto-generated method stub - return false; + return GlobalConstants.DEFAULT.toString().equalsIgnoreCase(ContainerId); } @Override diff --git a/opendaylight/forwardingrulesmanager/implementation/pom.xml b/opendaylight/forwardingrulesmanager/implementation/pom.xml index ea55ac8b08..d146eead6f 100644 --- a/opendaylight/forwardingrulesmanager/implementation/pom.xml +++ b/opendaylight/forwardingrulesmanager/implementation/pom.xml @@ -33,7 +33,7 @@ org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} diff --git a/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java b/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java index 58d23655ca..4e6818c306 100644 --- a/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java +++ b/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java @@ -1867,9 +1867,13 @@ public class ForwardingRulesManager implements } } if (target != null) { - // Program the network node - Status status = (target.installInHw()) ? this.uninstallFlowEntry(target.getFlowEntry()) : this - .installFlowEntry(target.getFlowEntry()); + Status status = target.validate(container); + if (!status.isSuccess()) { + log.warn(status.getDescription()); + return status; + } + status = (target.installInHw()) ? this.uninstallFlowEntry(target.getFlowEntry()) : this + .installFlowEntry(target.getFlowEntry()); if (status.isSuccess()) { // Update Configuration database target.setStatus(SUCCESS); diff --git a/opendaylight/forwardingrulesmanager/integrationtest/pom.xml b/opendaylight/forwardingrulesmanager/integrationtest/pom.xml index 797dec0264..770fef03f2 100644 --- a/opendaylight/forwardingrulesmanager/integrationtest/pom.xml +++ b/opendaylight/forwardingrulesmanager/integrationtest/pom.xml @@ -134,11 +134,20 @@ java + + + + org.jacoco + jacoco-maven-plugin + 0.5.3.201107060350 + + + org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} ../implementation/target/jacoco-it.exec org.opendaylight.controller.* diff --git a/opendaylight/hosttracker/implementation/pom.xml b/opendaylight/hosttracker/implementation/pom.xml index 268dd4f67f..e93559b42c 100644 --- a/opendaylight/hosttracker/implementation/pom.xml +++ b/opendaylight/hosttracker/implementation/pom.xml @@ -33,7 +33,7 @@ org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} diff --git a/opendaylight/hosttracker/integrationtest/pom.xml b/opendaylight/hosttracker/integrationtest/pom.xml index 450a6a13a6..f2fefcdabc 100644 --- a/opendaylight/hosttracker/integrationtest/pom.xml +++ b/opendaylight/hosttracker/integrationtest/pom.xml @@ -104,11 +104,20 @@ + + + + org.jacoco + jacoco-maven-plugin + 0.5.3.201107060350 + + + org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} ../implementation/target/jacoco-it.exec org.opendaylight.controller.* diff --git a/opendaylight/hosttracker_new/implementation/pom.xml b/opendaylight/hosttracker_new/implementation/pom.xml index af2ea7b347..a4ff57b7f0 100644 --- a/opendaylight/hosttracker_new/implementation/pom.xml +++ b/opendaylight/hosttracker_new/implementation/pom.xml @@ -33,7 +33,7 @@ org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/ISwitch.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/ISwitch.java index af3641823c..d924b66a09 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/ISwitch.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/ISwitch.java @@ -232,4 +232,9 @@ public interface ISwitch { * until the Barrier reply arrives. */ public Object asyncSendBarrierMessage(); + + /** + * Send a FLOW_MOD message with a wildcard match and action=DELETE. + */ + public void deleteAllFlows(); } diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/SwitchHandler.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/SwitchHandler.java index 91909d20f5..6e000022df 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/SwitchHandler.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/SwitchHandler.java @@ -372,12 +372,6 @@ public class SwitchHandler implements ISwitch { // send feature request OFMessage featureRequest = factory.getMessage(OFType.FEATURES_REQUEST); asyncFastSend(featureRequest); - // delete all pre-existing flows - OFMatch match = new OFMatch().setWildcards(OFMatch.OFPFW_ALL); - OFFlowMod flowMod = (OFFlowMod) factory.getMessage(OFType.FLOW_MOD); - flowMod.setMatch(match).setCommand(OFFlowMod.OFPFC_DELETE).setOutPort(OFPort.OFPP_NONE) - .setLength((short) OFFlowMod.MINIMUM_LENGTH); - asyncFastSend(flowMod); this.state = SwitchState.WAIT_FEATURES_REPLY; startSwitchTimer(); break; @@ -925,4 +919,14 @@ public class SwitchHandler implements ISwitch { return result; } } + + @Override + public void deleteAllFlows() { + logger.trace("deleteAllFlows on switch {}", HexString.toHexString(this.sid)); + OFMatch match = new OFMatch().setWildcards(OFMatch.OFPFW_ALL); + OFFlowMod flowMod = (OFFlowMod) factory.getMessage(OFType.FLOW_MOD); + flowMod.setMatch(match).setCommand(OFFlowMod.OFPFC_DELETE).setOutPort(OFPort.OFPP_NONE) + .setLength((short) OFFlowMod.MINIMUM_LENGTH); + asyncFastSend(flowMod); + } } diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryServiceShim.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryServiceShim.java index 8db83f0fc7..15bba670d2 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryServiceShim.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryServiceShim.java @@ -239,6 +239,11 @@ public class InventoryServiceShim implements IContainerListener, if (sw == null) { return; } + Node node = NodeCreator.createOFNode(sw.getId()); + if ((nodeProps.get(node) != null) && (connectionOutService.isLocal(node))) { + logger.debug("Ignore switchAdded {}", sw); + return; + } // Add all the nodeConnectors of this switch Map> ncProps = InventoryServiceHelper @@ -437,7 +442,6 @@ public class InventoryServiceShim implements IContainerListener, for (String container : containers) { notifyInventoryShimInternalListener(container, node, type, props); } - // Notify external listener notifyInventoryShimExternalListener(node, type, props); @@ -511,6 +515,11 @@ public class InventoryServiceShim implements IContainerListener, props.add(b); } + if ((nodeProps.get(node) == null) && (connectionOutService.isLocal(node))) { + // The switch is connected for the first time, flush all flows + // that may exist on this switch + sw.deleteAllFlows(); + } nodeProps.put(node, props); // Notify all internal and external listeners notifyInventoryShimListener(node, type, props); diff --git a/opendaylight/statisticsmanager/implementation/pom.xml b/opendaylight/statisticsmanager/implementation/pom.xml index 8be254e6b5..a6c938a2eb 100644 --- a/opendaylight/statisticsmanager/implementation/pom.xml +++ b/opendaylight/statisticsmanager/implementation/pom.xml @@ -31,7 +31,7 @@ org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} diff --git a/opendaylight/statisticsmanager/integrationtest/pom.xml b/opendaylight/statisticsmanager/integrationtest/pom.xml index deeccfaa70..e0251f8a27 100644 --- a/opendaylight/statisticsmanager/integrationtest/pom.xml +++ b/opendaylight/statisticsmanager/integrationtest/pom.xml @@ -108,11 +108,20 @@ java + + + + org.jacoco + jacoco-maven-plugin + 0.5.3.201107060350 + + + org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} ../implementation/target/jacoco-it.exec org.opendaylight.controller.* diff --git a/opendaylight/switchmanager/api/pom.xml b/opendaylight/switchmanager/api/pom.xml index 607c42858e..14a056d5fe 100644 --- a/opendaylight/switchmanager/api/pom.xml +++ b/opendaylight/switchmanager/api/pom.xml @@ -32,7 +32,7 @@ org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} diff --git a/opendaylight/switchmanager/implementation/pom.xml b/opendaylight/switchmanager/implementation/pom.xml index 1b09f3c34d..ee126f3408 100644 --- a/opendaylight/switchmanager/implementation/pom.xml +++ b/opendaylight/switchmanager/implementation/pom.xml @@ -32,7 +32,7 @@ org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} diff --git a/opendaylight/switchmanager/integrationtest/pom.xml b/opendaylight/switchmanager/integrationtest/pom.xml index d571d9df53..4ebe9bbc93 100644 --- a/opendaylight/switchmanager/integrationtest/pom.xml +++ b/opendaylight/switchmanager/integrationtest/pom.xml @@ -83,20 +83,11 @@ - - - - org.jacoco - jacoco-maven-plugin - 0.5.3.201107060350 - - - org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 + ${jacoco.version} ../implementation/target/jacoco-it.exec org.opendaylight.controller.*