Merge "Added Router code generation and unit tests for runtime code generator"
authorEd Warnicke <eaw@cisco.com>
Wed, 18 Sep 2013 15:36:19 +0000 (15:36 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 18 Sep 2013 15:36:19 +0000 (15:36 +0000)
17 files changed:
opendaylight/clustering/integrationtest/pom.xml
opendaylight/clustering/services_implementation/pom.xml
opendaylight/commons/opendaylight/pom.xml
opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/ContainerConfig.java
opendaylight/forwardingrulesmanager/implementation/pom.xml
opendaylight/forwardingrulesmanager/integrationtest/pom.xml
opendaylight/hosttracker/implementation/pom.xml
opendaylight/hosttracker/integrationtest/pom.xml
opendaylight/hosttracker_new/implementation/pom.xml
opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/group-types.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/group-service.yang [new file with mode: 0644]
opendaylight/statisticsmanager/implementation/pom.xml
opendaylight/statisticsmanager/integrationtest/pom.xml
opendaylight/switchmanager/api/pom.xml
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/SpanConfig.java
opendaylight/switchmanager/implementation/pom.xml
opendaylight/switchmanager/integrationtest/pom.xml

index 0fadb128901cd16749511f32c58e2ea71973fc75..93b3624c82e69e5b12c2f759ae4211656048b5f2 100644 (file)
@@ -69,7 +69,7 @@
       <plugin>
         <groupId>org.jacoco</groupId>
         <artifactId>jacoco-maven-plugin</artifactId>
-        <version>0.5.3.201107060350</version>
+        <version>${jacoco.version}</version>
         <configuration>
           <destFile>../implementation/target/jacoco-it.exec</destFile>
           <includes>org.opendaylight.controller.*</includes>
index c0a8064493d6d303ba24fb75466751f8f8c75aa0..d6bd287434a499c19b1aa1576b0aa11ee303344d 100644 (file)
@@ -30,7 +30,7 @@
         <plugin>
           <groupId>org.jacoco</groupId>
           <artifactId>jacoco-maven-plugin</artifactId>
-          <version>0.5.3.201107060350</version>
+          <version>${jacoco.version}</version>
         </plugin>
       </plugins>
     </pluginManagement>
index cb1892ae664513667693413eac0fef5824ef35e6..9d7950af7395fd1c1f5a5fa79012574eee321870 100644 (file)
@@ -55,6 +55,7 @@
     <sample-toaster.version>1.0-SNAPSHOT</sample-toaster.version>
     <releaseplugin.version>2.3.2</releaseplugin.version>
     <commons.lang.version>3.1</commons.lang.version>
+    <jacoco.version>0.5.3.201107060350</jacoco.version>
   </properties>
 
   <pluginRepositories>
index a34746949e8d9697251da00b32b442ea0c9147f4..89bf424e67a4465c885c82b2ec3206d559709064 100644 (file)
@@ -386,11 +386,38 @@ public class ContainerConfig implements Serializable {
                             config.getName()));
                 }
             }
+        } else {
+            // Check for conflicting names with existing cFlows
+            List<String> conflicting = new ArrayList<String>(existingNames);
+            conflicting.retainAll(proposedNames);
+            if (!conflicting.isEmpty()) {
+                return new Status(StatusCode.CONFLICT,
+                        "Invalid Flow Spec configuration: flow spec name(s) conflict with existing flow specs: "
+                                + conflicting.toString());
+            }
+
+            /*
+             * Check for conflicting flow spec match (we only check for strict
+             * equality). Remove this in case (*) is reintroduced
+             */
+            if (this.containerFlows != null && !this.containerFlows.isEmpty()) {
+                Set<Match> existingMatches = new HashSet<Match>();
+                for (ContainerFlowConfig existing : this.containerFlows) {
+                    existingMatches.addAll(existing.getMatches());
+                }
+                for (ContainerFlowConfig proposed : cFlowConfigs) {
+                    if (existingMatches.removeAll(proposed.getMatches())) {
+                        return new Status(StatusCode.CONFLICT, String.format(
+                                "Invalid Flow Spec configuration: %s conflicts with existing flow spec",
+                                proposed.getName()));
+                    }
+                }
+            }
         }
+
         /*
          * Revisit the following flow-spec confict validation later based on more testing.
-         */
-         /*
+         * (*)
         if (!delete) {
             // Check for overlapping container flows in the request
             int size = cFlowConfigs.size();
index ea55ac8b08951f14191cbcd900a6309c7154fcfc..d146eead6f0168e7e25cdd290459fb5ff20be7d2 100644 (file)
@@ -33,7 +33,7 @@
         <plugin>
           <groupId>org.jacoco</groupId>
           <artifactId>jacoco-maven-plugin</artifactId>
-          <version>0.5.3.201107060350</version>
+          <version>${jacoco.version}</version>
         </plugin>
       </plugins>
     </pluginManagement>
index 77792435991ce414a6edf14590b7f9fe071a9b56..770fef03f261dc7f6435eb8ac5644f53afd306ca 100644 (file)
       <plugin>
         <groupId>org.jacoco</groupId>
         <artifactId>jacoco-maven-plugin</artifactId>
-        <version>0.5.3.201107060350</version>
+        <version>${jacoco.version}</version>
         <configuration>
           <destFile>../implementation/target/jacoco-it.exec</destFile>
           <includes>org.opendaylight.controller.*</includes>
index 268dd4f67f6039f9bde419b8a726d4fe23063ac7..e93559b42ccae19ac461607d5680b4a3db1e0ec6 100644 (file)
@@ -33,7 +33,7 @@
         <plugin>
           <groupId>org.jacoco</groupId>
           <artifactId>jacoco-maven-plugin</artifactId>
-          <version>0.5.3.201107060350</version>
+          <version>${jacoco.version}</version>
         </plugin>
       </plugins>
     </pluginManagement>
index 81551650c34fe2a0eb49d0afeb2405ec75de4549..f2fefcdabcc05e7265ba811dbb9acd90fc14e4e1 100644 (file)
       <plugin>\r
         <groupId>org.jacoco</groupId>\r
         <artifactId>jacoco-maven-plugin</artifactId>\r
-        <version>0.5.3.201107060350</version>\r
+        <version>${jacoco.version}</version>\r
         <configuration>\r
           <destFile>../implementation/target/jacoco-it.exec</destFile>\r
           <includes>org.opendaylight.controller.*</includes>\r
index af2ea7b3475970cde2db15dfd660e13cdf177144..a4ff57b7f04348af9b9fbbee2a8b7f345905ef93 100644 (file)
@@ -33,7 +33,7 @@
         <plugin>
           <groupId>org.jacoco</groupId>
           <artifactId>jacoco-maven-plugin</artifactId>
-          <version>0.5.3.201107060350</version>
+          <version>${jacoco.version}</version>
         </plugin>
       </plugins>
     </pluginManagement>
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/group-types.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/group-types.yang
new file mode 100644 (file)
index 0000000..626eabd
--- /dev/null
@@ -0,0 +1,175 @@
+module opendaylight-group-types {
+    namespace "urn:opendaylight:group:types";
+    prefix group;
+
+    import ietf-inet-types {prefix inet;}
+    import ietf-yang-types {prefix yang;}
+       import opendaylight-flow-types {prefix flow-types;}
+
+    revision "2013-09-17" {
+        description "Initial revision of group service";
+    }
+
+       typedef group-ref {
+               type instance-identifier;
+       }
+       
+       grouping group-types {
+               leaf group-type {
+                       type enumeration {
+                               enum group-all;
+                               enum group_select;
+                               enum group_indirect;
+                               enum group_ff;
+                       }
+               }
+       }
+       
+       grouping group {
+        
+        uses group-types;       
+               
+               leaf group-id {
+            type group-ref;
+        }
+               
+               container buckets {
+                       list bucket {
+                               key "order";
+                               leaf order {
+                                       type int32;
+                               }
+                               
+                               leaf weight {
+                                       type uint16;
+                               }
+                               
+                               leaf watch_port {
+                                       type uint32;
+                               }
+                               
+                               leaf watch_group {
+                                       type uint32;
+                               }
+                               
+                               container actions {
+                                       list action {
+                                               key "action-order";
+                                               leaf action-order {
+                                                       type int32;
+                                               }
+            
+                                               uses flow-types:action;
+                                       }
+                               }
+                       }
+               }
+    }
+       
+       grouping group-statistics-request {
+               list group-stats {
+                       key "group-id";                 
+                       
+                       leaf group-id {
+                               type int32;
+                       }                       
+               }
+       }
+       
+       grouping group-statistics {
+                       
+               leaf group-id {
+            type int32;
+               }
+               
+           leaf ref-count {
+            type yang:counter32;
+               }
+               
+               leaf packet-count {
+            type yang:counter64;
+        } 
+               
+        leaf byte-count {
+            type yang:counter64;
+        }
+
+        container duration {
+            leaf second {
+                type yang:counter32;
+            }
+            leaf nanosecond {
+                type yang:counter32;
+            }
+        }
+               
+               container buckets {
+                       list bucket-counter {
+                               key "order";
+                               leaf order {
+                                       type int32;
+                               }
+                               
+                               leaf packet-count {
+                                       type yang:counter64;
+                               } 
+               
+                               leaf byte-count {
+                                       type yang:counter64;
+                               }
+                       }
+               }               
+    }
+
+       grouping group-statistics-reply {
+               list group-stats {
+                       key "group-stats-order";
+                       leaf group-stats-order {
+                               type int32;
+                       }
+                       
+                       uses group-statistics;
+               }
+       }
+       
+       grouping group-desc-stats {
+               list group-desc-stats {
+                       key "order-id";                 
+                       
+                       leaf order-id {
+                               type int32;
+                       }
+                       
+                       uses group;
+               }
+       }
+       
+    grouping group-features {
+               list group-features {
+                       key "order";
+                       leaf order {
+                               type int32;
+                       }
+                       
+                       uses group-types;
+                       type capabilities {
+                               enum select-weight;
+                               enum select-liveness;
+                               enum chaining;
+                               enum chaining-checks;
+                       }       
+
+                       leaf-list max-groups {
+                               type uint32;
+                               description "Maximum number of groups for each type";
+                               max-elements 4;
+                       }
+                       
+                       leaf-list actions {
+                               type uint32;
+                               description "Bitmap number OFPAT_* that are supported";
+                               max-elements 4;
+                       }
+               }
+       }    
+}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/group-service.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/group-service.yang
new file mode 100644 (file)
index 0000000..1ea2d34
--- /dev/null
@@ -0,0 +1,49 @@
+module sal-group {
+    namespace "urn:opendaylight:group:service";
+    prefix group;
+
+    import yang-ext {prefix ext;}
+    import opendaylight-inventory {prefix inv;}
+    import ietf-inet-types {prefix inet;}
+    import opendaylight-group-types {prefix group-type;}
+
+    revision "2013-09-17" {
+        description "Initial revision of group service";
+    }        
+       
+    grouping node-group {
+        leaf node {
+            type inv:node-ref;
+        }
+        
+        uses group-type:group;
+    }
+
+    /** Base configuration structure **/
+    grouping group-update {
+        container original-group {
+            uses group-type:group;
+        }
+        container updated-group {
+            uses group-type:group;
+        }
+    }
+
+    rpc add-group {
+        input {
+            uses node-group;
+        }
+    }
+
+    rpc remove-group {
+        input {
+            uses node-group;
+        }
+    }
+
+    rpc update-group {
+        input {
+            uses node-group;
+        }
+    }     
+}
\ No newline at end of file
index 8be254e6b5eef24bae8eaf087289a81fbf3a851e..a6c938a2eb4f5137ccb15f22830580a9b613c1eb 100644 (file)
@@ -31,7 +31,7 @@
         <plugin>
           <groupId>org.jacoco</groupId>
           <artifactId>jacoco-maven-plugin</artifactId>
-          <version>0.5.3.201107060350</version>
+          <version>${jacoco.version}</version>
         </plugin>
       </plugins>
     </pluginManagement>
index 527dd0a02b3671451d6e612d3df25d69c7b0d1ba..e0251f8a27c82a852ed9705ce04216a7863b5131 100644 (file)
       <plugin>
         <groupId>org.jacoco</groupId>
         <artifactId>jacoco-maven-plugin</artifactId>
-        <version>0.5.3.201107060350</version>
+        <version>${jacoco.version}</version>
         <configuration>
           <destFile>../implementation/target/jacoco-it.exec</destFile>
           <includes>org.opendaylight.controller.*</includes>
index 607c42858e7b4ee52d8e9974c4d677ce1d61cc2f..14a056d5fee3b50ba27f2fe240d378495dc7ad85 100644 (file)
@@ -32,7 +32,7 @@
         <plugin>
           <groupId>org.jacoco</groupId>
           <artifactId>jacoco-maven-plugin</artifactId>
-          <version>0.5.3.201107060350</version>
+          <version>${jacoco.version}</version>
         </plugin>
       </plugins>
     </pluginManagement>
index 522f45946d98fbdc170db4ec9531d9128df53f97..4bb6438b32ce40a71b89796ecc81e91e7382c543 100644 (file)
@@ -14,10 +14,8 @@ import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
 import org.opendaylight.controller.sal.utils.GUIField;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -116,32 +114,12 @@ public class SpanConfig implements Serializable {
     }
 
     public ArrayList<NodeConnector> getPortArrayList() {
-        Node node = Node.fromString(nodeId);
         ArrayList<NodeConnector> portList = new ArrayList<NodeConnector>();
         String[] elemArray = spanPort.split(",");
         for (String elem : elemArray) {
-            if (elem.contains("-")) {
-                String[] limits = elem.split("-");
-                for (short j = Short.valueOf(limits[0]); j <= Short
-                        .valueOf(limits[1]); j++) {
-                    try {
-                        portList.add(new NodeConnector(
-                                NodeConnectorIDType.OPENFLOW, Short.valueOf(j),
-                                node));
-                    } catch (ConstructionException e) {
-                        logger.error("",e);
-                    }
-                }
-            } else {
-                try {
-                    portList.add(new NodeConnector(
-                            NodeConnectorIDType.OPENFLOW, Short.valueOf(elem),
-                            node));
-                } catch (NumberFormatException e) {
-                    logger.error("",e);
-                } catch (ConstructionException e) {
-                    logger.error("",e);
-                }
+            NodeConnector nodeConnector = NodeConnector.fromString(elem);
+            if (nodeConnector != null) {
+                portList.add(nodeConnector);
             }
         }
         return portList;
index 1b09f3c34d62a26a204288c9143fc8b1e54f3dd4..ee126f3408ce51d6b1036f351f4ffb7a1be218b8 100644 (file)
@@ -32,7 +32,7 @@
         <plugin>
           <groupId>org.jacoco</groupId>
           <artifactId>jacoco-maven-plugin</artifactId>
-          <version>0.5.3.201107060350</version>
+          <version>${jacoco.version}</version>
         </plugin>
       </plugins>
     </pluginManagement>
index d571d9df532d682650033bdf0ae94eca349d176a..4ebe9bbc9380dab400625d7ed069d971dcd1a81a 100644 (file)
   </properties>
 
   <build>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.jacoco</groupId>
-          <artifactId>jacoco-maven-plugin</artifactId>
-          <version>0.5.3.201107060350</version>
-        </plugin>
-      </plugins>
-    </pluginManagement>
     <plugins>
       <plugin>
         <groupId>org.jacoco</groupId>
         <artifactId>jacoco-maven-plugin</artifactId>
-        <version>0.5.3.201107060350</version>
+        <version>${jacoco.version}</version>
         <configuration>
           <destFile>../implementation/target/jacoco-it.exec</destFile>
           <includes>org.opendaylight.controller.*</includes>