From 4549b25cd16b15f47b10b46dc195c2064b863964 Mon Sep 17 00:00:00 2001 From: Michal Rehak Date: Thu, 29 Oct 2015 15:09:33 +0100 Subject: [PATCH] BUG-4551: impact of YT BUG 2399 - action model fixing - 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 Signed-off-by: Michal Rehak --- .../main/yang/opendaylight-action-types.yang | 122 ++++++++++-------- .../openflow/md/it/OFPluginFlowTest.java | 14 +- .../openflow/md/it/OFPluginToLibraryTest.java | 4 +- .../openflow/md/it/SalIntegrationTest.java | 4 +- 4 files changed, 74 insertions(+), 70 deletions(-) diff --git a/model/model-flow-base/src/main/yang/opendaylight-action-types.yang b/model/model-flow-base/src/main/yang/opendaylight-action-types.yang index 041fc576a1..e23648dcde 100644 --- a/model/model-flow-base/src/main/yang/opendaylight-action-types.yang +++ b/model/model-flow-base/src/main/yang/opendaylight-action-types.yang @@ -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" + } + } } } } diff --git a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginFlowTest.java b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginFlowTest.java index e5eab9c665..a59e53d067 100644 --- a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginFlowTest.java +++ b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginFlowTest.java @@ -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); } /** diff --git a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginToLibraryTest.java b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginToLibraryTest.java index bc02caee38..1d96a68705 100644 --- a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginToLibraryTest.java +++ b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginToLibraryTest.java @@ -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); } /** diff --git a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/SalIntegrationTest.java b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/SalIntegrationTest.java index f7483aa3b2..ede61e07de 100644 --- a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/SalIntegrationTest.java +++ b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/SalIntegrationTest.java @@ -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); } /** -- 2.36.6