BUG-4551: impact of YT BUG 2399 - action model fixing 55/28955/2
authorMichal Rehak <mirehak@cisco.com>
Thu, 29 Oct 2015 14:09:33 +0000 (15:09 +0100)
committerMichal Rehak <mirehak@cisco.com>
Thu, 29 Oct 2015 19:11:00 +0000 (20:11 +0100)
 - added presence element to empty action containers
 - added sleep in order to follow port openings with some time reserve

Change-Id: Ia96c0f821455600a412df56c3d353b76184f26ef
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
Signed-off-by: Michal Rehak <mirehak@cisco.com>
model/model-flow-base/src/main/yang/opendaylight-action-types.yang
openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginFlowTest.java
openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginToLibraryTest.java
openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/SalIntegrationTest.java

index 041fc576a112582c5804ec126ddd2067dda69895..e23648dcdeb369586bf16f37c512cc4e8f7fb2f0 100644 (file)
@@ -6,13 +6,13 @@ module opendaylight-action-types {
     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
     import opendaylight-l2-types {prefix l2t; revision-date "2013-08-27";}
     import opendaylight-match-types {prefix match; revision-date "2013-10-26";}
-    
+
     revision "2013-11-12" {
         description "Initial revision of action service";
     }
-    
+
     typedef vlan-cfi {
-        type int32;    
+        type int32;
     }
 
     grouping address {
@@ -28,9 +28,9 @@ module opendaylight-action-types {
                 }
             }
         }
-    }  
-    
-    container action-types {   
+    }
+
+    container action-types {
        uses action-list;
     }
 
@@ -39,7 +39,7 @@ module opendaylight-action-types {
           type int32;
         }
     }
-    
+
     grouping action-list {
         list action {
             key "order";
@@ -47,7 +47,7 @@ module opendaylight-action-types {
             uses action;
         }
     }
-    
+
     grouping action {
         choice action {
             case output-action-case {
@@ -55,7 +55,7 @@ module opendaylight-action-types {
                     leaf output-node-connector {
                         type inet:uri;
                     }
-                    
+
                     leaf max-length {
                         type uint16;
                     }
@@ -69,7 +69,7 @@ module opendaylight-action-types {
                  }
              }
             }
-             
+
 
 
             case set-field-case {
@@ -77,15 +77,15 @@ module opendaylight-action-types {
                      uses match:match;
                  }
              }
-             
+
 
             case set-queue-action-case {
                 container set-queue-action {
                  leaf queue {
-                     type string; 
+                     type string;
                  }
                  leaf queue-id {
-                     type uint32; 
+                     type uint32;
                  }
              }
             }
@@ -97,7 +97,7 @@ module opendaylight-action-types {
                  }
              }
             }
+
 
             case set-mpls-ttl-action-case {
                 container set-mpls-ttl-action {
@@ -106,7 +106,7 @@ module opendaylight-action-types {
                  }
              }
             }
+
 
             case set-nw-ttl-action-case {
                 container set-nw-ttl-action {
@@ -115,7 +115,7 @@ module opendaylight-action-types {
                  }
              }
             }
+
 
             case push-pbb-action-case {
                 container push-pbb-action {
@@ -124,14 +124,14 @@ module opendaylight-action-types {
                  }
              }
             }
+
 
             case pop-pbb-action-case {
                 container pop-pbb-action {
-                 
-             }
+                    presence "no content action";
+                }
             }
-             
+
 
             case push-mpls-action-case {
                 container push-mpls-action {
@@ -140,57 +140,65 @@ module opendaylight-action-types {
                  }
              }
             }
-             
+
 
             case dec-mpls-ttl-case {
                 container dec-mpls-ttl {
+                    presence "no content action";
                 }
              }
-             
+
 
             case dec-nw-ttl-case {
                 container dec-nw-ttl {
+                    presence "no content action";
                 }
              }
-             
+
 
             case drop-action-case {
                 container drop-action {
+                    presence "no content action";
                 }
              }
-             
+
 
             case flood-action-case {
                 container flood-action {
+                    presence "no content action";
                 }
              }
-             
+
 
             case flood-all-action-case {
                 container flood-all-action {
+                    presence "no content action";
                 }
              }
-             
+
 
             case hw-path-action-case {
                 container hw-path-action {
+                    presence "no content action";
                 }
              }
-             
+
 
             case loopback-action-case {
                 container loopback-action {
+                    presence "no content action";
                 }
              }
-             
+
 
             case pop-vlan-action-case {
                 container pop-vlan-action {
+                    presence "no content action";
                 }
              }
-             
-            
-            
+
+
+
             case push-vlan-action-case {
                 container push-vlan-action {
                  leaf ethernet-type {
@@ -198,7 +206,7 @@ module opendaylight-action-types {
                  }
                 leaf tag {               // TPID - 16 bits
                     type int32;
-                } 
+                }
                 leaf pcp {               // PCP - 3 bits
                     type int32;
                 }
@@ -210,22 +218,24 @@ module opendaylight-action-types {
                 }
 //                leaf tci {               //TCI = [PCP + CFI + VID]
 //                }
-//                leaf header {            //header = [TPID + TCI] 
+//                leaf header {            //header = [TPID + TCI]
 //                }
                 }
              }
-            
+
             case copy-ttl-out-case {
                 container copy-ttl-out {
+                    presence "no content action"
                 }
              }
-             
+
 
             case copy-ttl-in-case {
                 container copy-ttl-in {
+                    presence "no content action"
                 }
              }
-             
+
 
             case set-dl-dst-action-case {
                 container set-dl-dst-action {
@@ -234,7 +244,7 @@ module opendaylight-action-types {
                  }
              }
             }
-             
+
 
             case set-dl-src-action-case {
                 container set-dl-src-action {
@@ -249,13 +259,13 @@ module opendaylight-action-types {
                  leaf group {
                      type string;
                  }
-                
+
                 leaf group-id {
                     type uint32;
                 }
              }
             }
-            
+
             case set-dl-type-action-case {
                 container set-dl-type-action {
                  leaf dl-type {
@@ -263,28 +273,28 @@ module opendaylight-action-types {
                  }
              }
             }
-             
+
 
             case set-next-hop-action-case {
                 container set-next-hop-action {
                  uses address;
              }
             }
-             
+
 
             case set-nw-dst-action-case {
                 container set-nw-dst-action {
-                 uses address;            
+                 uses address;
              }
             }
-             
+
 
             case set-nw-src-action-case {
                 container set-nw-src-action {
-                 uses address;            
+                 uses address;
              }
             }
-             
+
 
             case set-nw-tos-action-case {
                 container set-nw-tos-action {
@@ -293,13 +303,13 @@ module opendaylight-action-types {
                  }
              }
             }
-             
+
 
             case set-tp-dst-action-case {
                 container set-tp-dst-action {
                  leaf port {
                      type inet:port-number;
-                 }                
+                 }
              }
 
             }
@@ -307,7 +317,7 @@ module opendaylight-action-types {
                 container set-tp-src-action {
                  leaf port {
                      type inet:port-number;
-                 }                
+                 }
              }
 
             }
@@ -318,34 +328,36 @@ module opendaylight-action-types {
                  }
              }
             }
-             
+
 
             case set-vlan-id-action-case {
                 container set-vlan-id-action {
                  leaf vlan-id {
                      type l2t:vlan-id;
-                 } 
+                 }
              }
             }
-             
+
 
             case set-vlan-pcp-action-case {
                 container set-vlan-pcp-action {
                  leaf vlan-pcp {
                      type l2t:vlan-pcp;
-                 }            
+                 }
              }
             }
 
            case strip-vlan-action-case {
                 container strip-vlan-action {
+                    presence "no content action"
                 }
              }
 
-            case sw-path-action-case {            
+            case sw-path-action-case {
                 container sw-path-action {
-                }  
-             }  
+                    presence "no content action"
+                }
+             }
          }
      }
 }
index e5eab9c665394b3cef4ee89d4bcdad6ddefa91e0..a59e53d067428a1b97328b547d90cce7d80614da 100644 (file)
@@ -10,6 +10,10 @@ package org.opendaylight.openflowplugin.openflow.md.it;
 import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Deque;
@@ -18,9 +22,7 @@ import java.util.Set;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-
 import javax.inject.Inject;
-
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -36,7 +38,6 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.test.sal.binding.it.TestHelper;
 import org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent;
 import org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler;
 import org.opendaylight.openflowjava.protocol.impl.clients.SimpleClient;
@@ -87,11 +88,6 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-
 /**
  * covers basic handshake scenarios
  */
@@ -128,7 +124,7 @@ public class OFPluginFlowTest {
         LOG.debug("openflowPluginProvider: "+openflowPluginProvider);
         scenarioPool = new ThreadPoolLoggingExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, SCENARIO_POOL_QUEUE, "scenario");
         //FIXME: plugin should provide service exposing startup result via future
-        Thread.sleep(5000);
+        Thread.sleep(5000L);
     }
 
     /**
index bc02caee38a92584be98da6eb0a7d9349fa3fc89..1d96a68705889d5292c3cf380b12c179865b402d 100644 (file)
@@ -13,14 +13,11 @@ import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 import java.util.Deque;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.TimeUnit;
-
 import javax.inject.Inject;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.opendaylight.controller.test.sal.binding.it.TestHelper;
 import org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent;
 import org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler;
 import org.opendaylight.openflowjava.protocol.impl.clients.SimpleClient;
@@ -67,6 +64,7 @@ public class OFPluginToLibraryTest {
         LOG.debug("openflowPluginProvider: "+openflowPluginProvider);
         switchSim = createSimpleClient();
         scenarioPool = new ThreadPoolLoggingExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, SCENARIO_POOL_QUEUE, "scenario");
+        Thread.sleep(5000L);
     }
 
     /**
index f7483aa3b2c834885b61dd3848da729c3b81e572..ede61e07de1572eb8ef7b8e73387c0e2e2fd3b58 100644 (file)
@@ -16,9 +16,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.TimeUnit;
-
 import javax.inject.Inject;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -27,7 +25,6 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
 import org.opendaylight.controller.sal.binding.api.NotificationService;
-import org.opendaylight.controller.test.sal.binding.it.TestHelper;
 import org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler;
 import org.opendaylight.openflowjava.protocol.impl.clients.SimpleClient;
 import org.opendaylight.openflowplugin.openflow.md.core.ThreadPoolLoggingExecutor;
@@ -85,6 +82,7 @@ public class SalIntegrationTest {
     public void setUp() throws InterruptedException {
         switchSim = new SimpleClient("localhost", 6653);
         scenarioPool = new ThreadPoolLoggingExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, SCENARIO_POOL_QUEUE, "scenario");
+        Thread.sleep(5000L);
     }
 
     /**