Merge "Use dpl portId"
authorSam Hague <shague@redhat.com>
Fri, 15 Apr 2016 18:01:13 +0000 (18:01 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 15 Apr 2016 18:01:13 +0000 (18:01 +0000)
19 files changed:
features/pom.xml
features/src/main/features/features.xml
netvirt/it/pom.xml
netvirt/it/src/test/java/org/opendaylight/netvirt/netvirt/it/NetvirtIT.java
openstack/net-virt-it/pom.xml
openstack/net-virt-it/src/test/java/org/opendaylight/netvirt/openstack/netvirt/it/NetvirtIT.java
openstack/net-virt-sfc/features/pom.xml
openstack/net-virt-sfc/features/src/main/features/features.xml
openstack/net-virt-sfc/it/pom.xml
openstack/net-virt-sfc/it/src/test/java/org/opendaylight/netvirt/openstack/netvirt/sfc/it/NetvirtSfcIT.java
openstack/net-virt/src/main/java/org/opendaylight/netvirt/openstack/netvirt/NetworkHandler.java
openstack/net-virt/src/test/java/org/opendaylight/netvirt/openstack/netvirt/NetworkHandlerTest.java
resources/commons/L2Gateway.json.postman_collection [new file with mode: 0644]
utils/it-utils/src/main/java/org/opendaylight/netvirt/utils/it/utils/ItUtils.java [deleted file]
utils/it-utils/src/main/java/org/opendaylight/netvirt/utils/it/utils/NodeInfo.java [deleted file]
utils/netvirt-it-utils/pom.xml [moved from utils/it-utils/pom.xml with 74% similarity]
utils/netvirt-it-utils/src/main/java/org/opendaylight/netvirt/utils/netvirt/it/utils/ItConstants.java [moved from utils/it-utils/src/main/java/org/opendaylight/netvirt/utils/it/utils/ItConstants.java with 95% similarity]
utils/netvirt-it-utils/src/main/java/org/opendaylight/netvirt/utils/netvirt/it/utils/NetvirtItUtils.java [new file with mode: 0644]
utils/pom.xml

index 3976135808b8d155cef8e1555f6dc015efa5eb4b..68f37ab3ee8bd392fbceeef183cec1c60f06cf01 100644 (file)
@@ -229,12 +229,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>utils.mdsal-utils</artifactId>
       <version>${ovsdb.version}</version>
     </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>utils.it-utils</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>ovsdb-ui-bundle</artifactId>
@@ -290,5 +284,17 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <classifier>features</classifier>
       <type>xml</type>
     </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>utils.netvirt-it-utils</artifactId>
+      <version>${project.version}</version>
+      <!--<scope>test</scope>-->
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.ovsdb</groupId>
+      <artifactId>utils.ovsdb-it-utils</artifactId>
+      <version>${ovsdb.version}</version>
+      <!--<scope>test</scope>-->
+    </dependency>
   </dependencies>
 </project>
index a14ad4c1ddce5766a8e7e670812610bd096ff094..26722ee69f75e3b1b25857fc79f120a4d2bc39c8 100644 (file)
@@ -38,7 +38,9 @@
   <feature name="odl-ovsdb-openstack-it" description="OpenDaylight :: OVSDB :: OpenStack Network Virtualization IT"
            version='${project.version}'>
     <feature version="${project.version}">odl-ovsdb-openstack</feature>
-    <bundle>mvn:org.opendaylight.netvirt/utils.it-utils/{{VERSION}}</bundle>
+    <bundle>mvn:org.opendaylight.ovsdb/utils.ovsdb-it-utils/{{VERSION}}</bundle>
+    <bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/{{VERSION}}</bundle>
+    <bundle>mvn:org.opendaylight.netvirt/utils.netvirt-it-utils/{{VERSION}}</bundle>
   </feature>
 
   <feature name="odl-ovsdb-openstack-clusteraware" description="OpenDaylight :: OVSDB :: OpenStack Network Virtualization - Cluster Aware"
     <feature version="${neutron.version}">odl-neutron-service</feature>
     <feature version="${project.version}">odl-netvirt-neutron</feature>
     <feature version="${ovsdb.version}">odl-ovsdb-southbound-api</feature>
-    <bundle>mvn:org.opendaylight.netvirt/utils.it-utils/{{VERSION}}</bundle>
-    <bundle>mvn:org.opendaylight.netvirt/utils.mdsal-utils/{{VERSION}}</bundle>
-    <bundle>mvn:org.opendaylight.netvirt/utils.neutron-utils/{{VERSION}}</bundle>
+    <feature version="${openflowplugin.version}">odl-openflowplugin-nsf-model</feature>
+    <feature version="${openflowplugin.version}">odl-openflowplugin-nxm-extensions</feature>
     <bundle>mvn:org.opendaylight.netvirt/utils.servicehelper/{{VERSION}}</bundle>
+    <bundle>mvn:org.opendaylight.netvirt/utils.neutron-utils/{{VERSION}}</bundle>
+    <bundle>mvn:org.opendaylight.netvirt/utils.mdsal-utils/{{VERSION}}</bundle>
+    <bundle>mvn:org.opendaylight.netvirt/utils.netvirt-it-utils/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.ovsdb/utils.southbound-utils/{{VERSION}}</bundle>
   </feature>
index 9130f74cc184503cd1057a440516c0c91387c0bb..87b7b27df1f80ea3e9958af59285750425e4a605 100644 (file)
@@ -26,11 +26,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 
   <properties>
     <controller.mdsal.version>1.4.0-SNAPSHOT</controller.mdsal.version>
-    <ovsdb.version>1.3.0-SNAPSHOT</ovsdb.version>
     <karaf.distro.groupId>org.opendaylight.ovsdb</karaf.distro.groupId>
     <karaf.distro.artifactId>karaf</karaf.distro.artifactId>
     <karaf.distro.version>${project.version}</karaf.distro.version>
     <karaf.distro.type>zip</karaf.distro.type>
+    <ovsdb.version>1.3.0-SNAPSHOT</ovsdb.version>
   </properties>
 
   <dependencies>
@@ -60,28 +60,39 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
-      <artifactId>utils.it-utils</artifactId>
+      <artifactId>utils.netvirt-it-utils</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>utils.mdsal-openflow</artifactId>
       <version>${project.version}</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>utils.mdsal-utils</artifactId>
       <version>${project.version}</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>utils.neutron-utils</artifactId>
       <version>${project.version}</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.ovsdb</groupId>
       <artifactId>utils.mdsal-utils</artifactId>
       <version>${ovsdb.version}</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.ovsdb</groupId>
       <artifactId>utils.southbound-utils</artifactId>
       <version>${ovsdb.version}</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.codehaus.sonar-plugins.java</groupId>
index 62a132ea90fed4dbc1b11fb6d6912dd7f6e0990b..4e4e90a660ea1c1e55898aec2e8337f85d90f612 100644 (file)
@@ -36,8 +36,8 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.neutron.spi.NeutronNetwork;
-import org.opendaylight.netvirt.utils.it.utils.ItConstants;
-import org.opendaylight.netvirt.utils.it.utils.ItUtils;
+import org.opendaylight.netvirt.utils.netvirt.it.utils.ItConstants;
+import org.opendaylight.netvirt.utils.netvirt.it.utils.NetvirtItUtils;
 import org.opendaylight.netvirt.utils.neutron.utils.NeutronModelsDataStoreHelper;
 import org.opendaylight.netvirt.utils.neutron.utils.NeutronUtils;
 import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
@@ -62,7 +62,7 @@ public class NetvirtIT extends AbstractMdsalTestBase {
     private static final Logger LOG = LoggerFactory.getLogger(NetvirtIT.class);
     private static final String FEATURE = "odl-netvirt-it";
     private static DataBroker dataBroker = null;
-    private static ItUtils itUtils;
+    private static NetvirtItUtils itUtils;
     private static String addressStr;
     private static String portStr;
     private static String connectionType;
@@ -200,8 +200,8 @@ public class NetvirtIT extends AbstractMdsalTestBase {
             }
         }
 
-        dataBroker = ItUtils.getDatabroker(getProviderContext());
-        itUtils = new ItUtils(dataBroker);
+        dataBroker = NetvirtItUtils.getDatabroker(getProviderContext());
+        itUtils = new NetvirtItUtils(dataBroker);
         mdsalUtils = new MdsalUtils(dataBroker);
         assertNotNull("mdsalUtils should not be null", mdsalUtils);
         // TODO: Not used yet since openstack is not running to write the netvirt:1 to mdsal
index 4b1aedce0f9a2f63b39b09c8aa501b3a14ccb6bf..c3c00adf45d5629ad2d5291061752ac764aed503 100644 (file)
@@ -77,10 +77,28 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
-      <artifactId>utils.it-utils</artifactId>
+      <artifactId>utils.mdsal-openflow</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.ovsdb</groupId>
+      <artifactId>utils.mdsal-utils</artifactId>
+      <version>${ovsdb.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>utils.netvirt-it-utils</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.ovsdb</groupId>
+      <artifactId>utils.ovsdb-it-utils</artifactId>
+      <version>${ovsdb.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
index af067bb1f1980f62812899137b57f8f0e8a62262..ea09f1c4325aa992273190dbe64681b7fd50a65c 100644 (file)
@@ -41,6 +41,7 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.netvirt.utils.netvirt.it.utils.NetvirtItUtils;
 import org.opendaylight.neutron.spi.INeutronPortCRUD;
 import org.opendaylight.neutron.spi.INeutronSecurityGroupCRUD;
 import org.opendaylight.neutron.spi.INeutronSecurityRuleCRUD;
@@ -55,8 +56,8 @@ import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
 import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
 import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
 import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.netvirt.utils.it.utils.ItUtils;
-import org.opendaylight.netvirt.utils.it.utils.NodeInfo;
+import org.opendaylight.ovsdb.utils.ovsdb.it.utils.OvsdbItUtils;
+import org.opendaylight.ovsdb.utils.ovsdb.it.utils.NodeInfo;
 import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
 import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
 import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
@@ -93,7 +94,8 @@ import org.slf4j.LoggerFactory;
 public class NetvirtIT extends AbstractMdsalTestBase {
     private static final Logger LOG = LoggerFactory.getLogger(NetvirtIT.class);
     private static DataBroker dataBroker = null;
-    private static ItUtils itUtils;
+    private static OvsdbItUtils itUtils;
+    private static NetvirtItUtils nvItUtils;
     private static String addressStr;
     private static String portStr;
     private static String connectionType;
@@ -240,8 +242,9 @@ public class NetvirtIT extends AbstractMdsalTestBase {
             }
         }
 
-        dataBroker = getDatabroker(getProviderContext());
-        itUtils = new ItUtils(dataBroker);
+        dataBroker = NetvirtItUtils.getDatabroker(getProviderContext());
+        itUtils = new OvsdbItUtils(dataBroker);
+        nvItUtils = new NetvirtItUtils(dataBroker);
         mdsalUtils = new MdsalUtils(dataBroker);
         assertNotNull("mdsalUtils should not be null", mdsalUtils);
         assertTrue("Did not find " + NETVIRT_TOPOLOGY_ID, getNetvirtTopology());
@@ -278,12 +281,6 @@ public class NetvirtIT extends AbstractMdsalTestBase {
         return providerContext;
     }
 
-    private DataBroker getDatabroker(BindingAwareBroker.ProviderContext providerContext) {
-        DataBroker dataBroker = providerContext.getSALService(DataBroker.class);
-        assertNotNull("dataBroker should not be null", dataBroker);
-        return dataBroker;
-    }
-
     private Boolean getNetvirtTopology() {
         LOG.info("getNetvirtTopology: looking for {}...", NETVIRT_TOPOLOGY_ID);
         Boolean found = false;
@@ -391,13 +388,13 @@ public class NetvirtIT extends AbstractMdsalTestBase {
                 staticPipelineFound.add(service);
             }
             String flowId = "DEFAULT_PIPELINE_FLOW_" + pipelineOrchestrator.getTable(service);
-            verifyFlow(datapathId, flowId, service);
+            nvItUtils.verifyFlow(datapathId, flowId, pipelineOrchestrator.getTable(service));
         }
         assertEquals("did not find all expected flows in static pipeline",
                 staticPipeline.size(), staticPipelineFound.size());
 
         String flowId = "TableOffset_" + pipelineOrchestrator.getTable(Service.CLASSIFIER);
-        verifyFlow(datapathId, flowId, Service.CLASSIFIER.getTable());
+        nvItUtils.verifyFlow(datapathId, flowId, Service.CLASSIFIER.getTable());
 
         Assert.assertTrue(southboundUtils.deleteBridge(connectionInfo, NetvirtITConstants.INTEGRATION_BRIDGE_NAME));
         Thread.sleep(1000);
@@ -454,7 +451,7 @@ public class NetvirtIT extends AbstractMdsalTestBase {
                 staticPipelineFound.add(service);
             }
             String flowId = "DEFAULT_PIPELINE_FLOW_" + pipelineOrchestrator.getTable(service);
-            verifyFlow(nodeInfo.datapathId, flowId, service);
+            nvItUtils.verifyFlow(nodeInfo.datapathId, flowId, pipelineOrchestrator.getTable(service));
         }
         assertEquals("did not find all expected flows in static pipeline",
                 staticPipeline.size(), staticPipelineFound.size());
@@ -520,7 +517,7 @@ public class NetvirtIT extends AbstractMdsalTestBase {
         Thread.sleep(1000);
 
         String flowId = "Egress_DHCP_Client"  + "_Permit_";
-        verifyFlow(nodeInfo.datapathId, flowId, Service.EGRESS_ACL);
+        nvItUtils.verifyFlow(nodeInfo.datapathId, flowId, pipelineOrchestrator.getTable(Service.EGRESS_ACL));
 
         testDefaultSG(nport, nodeInfo.datapathId, nn, tenantId, portId);
         Thread.sleep(1000);
@@ -583,10 +580,10 @@ public class NetvirtIT extends AbstractMdsalTestBase {
         LOG.info("Neutron ports have been added");
         Thread.sleep(10000);
         String flowId = "Egress_IP" + nn.getProviderSegmentationID() + "_" + nport.getMacAddress() + "_Permit_";
-        verifyFlow(datapathId, flowId, Service.EGRESS_ACL);
+        nvItUtils.verifyFlow(datapathId, flowId, pipelineOrchestrator.getTable(Service.EGRESS_ACL));
 
         flowId = "Ingress_IP" + nn.getProviderSegmentationID() + "_" + nport.getMacAddress() + "_Permit_";
-        verifyFlow(datapathId, flowId, Service.INGRESS_ACL);
+        nvItUtils.verifyFlow(datapathId, flowId, pipelineOrchestrator.getTable(Service.INGRESS_ACL));
     }
 
     private Flow getFlow (
@@ -607,20 +604,4 @@ public class NetvirtIT extends AbstractMdsalTestBase {
         }
         return flow;
     }
-
-    private void verifyFlow(long datapathId, String flowId, short table) throws InterruptedException {
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder nodeBuilder =
-                FlowUtils.createNodeBuilder(datapathId);
-        FlowBuilder flowBuilder =
-                FlowUtils.initFlowBuilder(new FlowBuilder(), flowId, table);
-        Flow flow = getFlow(flowBuilder, nodeBuilder, LogicalDatastoreType.CONFIGURATION);
-        assertNotNull("Could not find flow in config: " + flowBuilder.build() + "--" + nodeBuilder.build(), flow);
-        flow = getFlow(flowBuilder, nodeBuilder, LogicalDatastoreType.OPERATIONAL);
-        assertNotNull("Could not find flow in operational: " + flowBuilder.build() + "--" + nodeBuilder.build(),
-                flow);
-    }
-
-    private void verifyFlow(long datapathId, String flowId, Service service) throws InterruptedException {
-        verifyFlow(datapathId, flowId, pipelineOrchestrator.getTable(service));
-    }
 }
index ae12e52358abfe84c4b27ba407ff5a82be79578b..12b8d43e40d5cd02535f15c9f2b5e473fd935aef 100644 (file)
@@ -112,6 +112,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <artifactId>utils.mdsal-utils</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>utils.mdsal-openflow</artifactId>
+      <version>${project.version}</version>
+    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>utils.servicehelper</artifactId>
@@ -126,10 +131,16 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
-      <artifactId>utils.it-utils</artifactId>
+      <artifactId>utils.netvirt-it-utils</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.ovsdb</groupId>
+      <artifactId>utils.ovsdb-it-utils</artifactId>
+      <version>${ovsdb.version}</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.ovsdb</groupId>
       <artifactId>utils.mdsal-utils</artifactId>
index 86e10456701337a3d501f704bb7c40bc9ba55de3..dc31496d17a9f3f4e2bcd0c094f19bf48fa058d0 100644 (file)
@@ -49,7 +49,8 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <feature version="${dlux.version}">odl-dlux-yangui</feature>
   </feature>
   <feature name='odl-ovsdb-sfc-test' version='${project.version}' description='OpenDaylight :: ovsdb-sfc-test'>
-    <bundle>mvn:org.opendaylight.netvirt/utils.it-utils/{{VERSION}}</bundle>
+    <bundle>mvn:org.opendaylight.netvirt/utils.netvirt-it-utils/{{VERSION}}</bundle>
+    <bundle>mvn:org.opendaylight.ovsdb/utils.ovsdb-it-utils/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.netvirt/utils.mdsal-utils/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.ovsdb/utils.southbound-utils/{{VERSION}}</bundle>
index cbefc5eca57782676981e842e782927c352cddd6..850a59c61957b935c830516a7bb465ecae0a6ede 100644 (file)
@@ -91,10 +91,16 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
-      <artifactId>utils.it-utils</artifactId>
+      <artifactId>utils.netvirt-it-utils</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.ovsdb</groupId>
+      <artifactId>utils.ovsdb-it-utils</artifactId>
+      <version>${ovsdb.version}</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>concepts</artifactId>
index a5eef0e334ce3a04e9b5cb89086679077bb76167..0e45960461ee724728e125b644fd3ab3126e6891 100644 (file)
@@ -60,12 +60,13 @@ import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.NetvirtConfigUtil
 import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.ServiceFunctionForwarderUtils;
 import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.NetvirtSfcUtils;
 import org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services.FlowNames;
+import org.opendaylight.netvirt.utils.netvirt.it.utils.NetvirtItUtils;
 import org.opendaylight.ovsdb.southbound.SouthboundConstants;
-import org.opendaylight.netvirt.utils.it.utils.ItUtils;
+import org.opendaylight.ovsdb.utils.ovsdb.it.utils.OvsdbItUtils;
+import org.opendaylight.ovsdb.utils.ovsdb.it.utils.NodeInfo;
 import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
 import org.opendaylight.netvirt.utils.mdsal.utils.MdsalUtils;
 import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
-import org.opendaylight.netvirt.utils.it.utils.NodeInfo;
 import org.opendaylight.ovsdb.utils.mdsal.utils.NotifyingDataChangeListener;
 import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
 import org.opendaylight.sfc.provider.api.SfcProviderRenderedPathAPI;
@@ -170,7 +171,8 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
     private static PipelineOrchestrator pipelineOrchestrator;
     private static Southbound southbound;
     private static DataBroker dataBroker;
-    private static ItUtils itUtils;
+    private static OvsdbItUtils itUtils;
+    private static NetvirtItUtils nvItUtils;
     public static final String CONTROLLER_IPADDRESS = "ovsdb.controller.address";
     public static final String SERVER_IPADDRESS = "ovsdbserver.ipaddress";
     public static final String SERVER_PORT = "ovsdbserver.port";
@@ -346,7 +348,8 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
         getProperties();
 
         dataBroker = getDatabroker(getProviderContext());
-        itUtils = new ItUtils(dataBroker);
+        itUtils = new OvsdbItUtils(dataBroker);
+        nvItUtils = new NetvirtItUtils(dataBroker);
         mdsalUtils = new MdsalUtils(dataBroker);
         org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils sbMdsalUtils =
                 new org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils(dataBroker);
@@ -639,7 +642,7 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
         nodeInfo.connect();
 
         String flowId = "DEFAULT_PIPELINE_FLOW_" + pipelineOrchestrator.getTable(Service.SFC_CLASSIFIER);
-        verifyFlow(nodeInfo.datapathId, flowId, Service.SFC_CLASSIFIER);
+        nvItUtils.verifyFlow(nodeInfo.datapathId, flowId, pipelineOrchestrator.getTable(Service.SFC_CLASSIFIER));
 
         nodeInfo.disconnect();
     }
@@ -671,7 +674,7 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
         nodeInfo.connect();
 
         String flowId = "DEFAULT_PIPELINE_FLOW_" + pipelineOrchestrator.getTable(Service.SFC_CLASSIFIER);
-        verifyFlow(nodeInfo.datapathId, flowId, Service.SFC_CLASSIFIER);
+        nvItUtils.verifyFlow(nodeInfo.datapathId, flowId, pipelineOrchestrator.getTable(Service.SFC_CLASSIFIER));
 
         Map<String, String> externalIds = Maps.newHashMap();
         externalIds.put("attached-mac", "f6:00:00:0f:00:01");
@@ -723,18 +726,18 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
         assertNotNull("RSP was not found", rsp);
 
         flowId = FlowNames.getSfcIngressClass(RULENAME, rsp.getPathId(), rsp.getStartingIndex());
-        verifyFlow(nodeInfo.datapathId, flowId, Service.SFC_CLASSIFIER);
+        nvItUtils.verifyFlow(nodeInfo.datapathId, flowId, pipelineOrchestrator.getTable(Service.SFC_CLASSIFIER));
         RenderedServicePathHop lastHop = sfcUtils.getLastHop(rsp);
         short lastServiceindex = (short)((lastHop.getServiceIndex()).intValue() - 1);
         flowId = FlowNames.getSfcEgressClass(vxGpeOfPort, rsp.getPathId(), lastServiceindex);
-        verifyFlow(nodeInfo.datapathId, flowId, Service.SFC_CLASSIFIER);
+        nvItUtils.verifyFlow(nodeInfo.datapathId, flowId, pipelineOrchestrator.getTable(Service.SFC_CLASSIFIER));
         flowId = FlowNames.getSfcEgressClassBypass(rsp.getPathId(), lastServiceindex, 1);
-        verifyFlow(nodeInfo.datapathId, flowId, Service.CLASSIFIER);
+        nvItUtils.verifyFlow(nodeInfo.datapathId, flowId, pipelineOrchestrator.getTable(Service.CLASSIFIER));
         flowId = FlowNames.getArpResponder(SF1IP);
-        verifyFlow(nodeInfo.datapathId, flowId, Service.ARP_RESPONDER);
+        nvItUtils.verifyFlow(nodeInfo.datapathId, flowId, pipelineOrchestrator.getTable(Service.ARP_RESPONDER));
         // Only verify these flows if NetVirt adds them and not SFC
         //flowId = FlowNames.getSfEgress(GPEUDPPORT);
-        //verifyFlow(nodeInfo.datapathId, flowId, Service.SFC_CLASSIFIER);
+        //verifyFlow(nodeInfo.datapathId, flowId, pipelineOrchestrator.getTable(Service.SFC_CLASSIFIER));
         //flowId = FlowNames.getSfIngress(GPEUDPPORT, SF1IP);
         //verifyFlow(nodeInfo.datapathId, flowId, Service.CLASSIFIER.getTable());
 
@@ -880,22 +883,6 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
         return flow;
     }
 
-    private void verifyFlow(long datapathId, String flowId, short table) throws InterruptedException {
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder nodeBuilder =
-                FlowUtils.createNodeBuilder(datapathId);
-        FlowBuilder flowBuilder =
-                FlowUtils.initFlowBuilder(new FlowBuilder(), flowId, table);
-        Flow flow = getFlow(flowBuilder, nodeBuilder, LogicalDatastoreType.CONFIGURATION);
-        assertNotNull("Could not find flow in config: " + flowBuilder.build() + "--" + nodeBuilder.build(), flow);
-        flow = getFlow(flowBuilder, nodeBuilder, LogicalDatastoreType.OPERATIONAL);
-        assertNotNull("Could not find flow in operational: " + flowBuilder.build() + "--" + nodeBuilder.build(),
-                flow);
-    }
-
-    private void verifyFlow(long datapathId, String flowId, Service service) throws InterruptedException {
-        verifyFlow(datapathId, flowId, pipelineOrchestrator.getTable(service));
-    }
-
     private void readwait() {
         if (ovsdb_wait) {
             LOG.warn("Waiting, kill with ps -ef | grep java, kill xxx... ");
index 067c3e5b519d0ec947c5792856334c0a749e1c54..9daa5fe9aecc1ff58d93141a8e015106f6adbd1d 100644 (file)
@@ -55,11 +55,6 @@ public class NetworkHandler extends AbstractHandler implements INeutronNetworkAw
      */
     @Override
     public int canCreateNetwork(NeutronNetwork network) {
-        if (network.isShared() && !network.getRouterExternal()) {
-            LOG.error("Shared attribute is only supported on external networks");
-            return HttpURLConnection.HTTP_NOT_ACCEPTABLE;
-        }
-
         return HttpURLConnection.HTTP_OK;
     }
 
@@ -89,11 +84,6 @@ public class NetworkHandler extends AbstractHandler implements INeutronNetworkAw
     @Override
     public int canUpdateNetwork(NeutronNetwork delta,
                                 NeutronNetwork original) {
-        if (delta.isShared() && !delta.getRouterExternal()) {
-            LOG.error("Shared attribute is only supported on external networks");
-            return HttpURLConnection.HTTP_NOT_ACCEPTABLE;
-        }
-
         return HttpURLConnection.HTTP_OK;
     }
 
index eda7f44d64ca590dce87e17658da76dbe058f8b7..bf4c1f17dba41ce42f41945979112c3c046ec067 100644 (file)
@@ -74,7 +74,7 @@ public class NetworkHandlerTest {
      */
     @Test
     public void testCanCreateNetwork() {
-        assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_NOT_ACCEPTABLE, networkHandler.canCreateNetwork(sharedNeutronNetwork));
+        assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canCreateNetwork(sharedNeutronNetwork));
         assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canCreateNetwork(nonSharedNeutronNetwork));
     }
 
@@ -83,7 +83,7 @@ public class NetworkHandlerTest {
      */
     @Test
     public void testCanUpdateNetwork() {
-        assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_NOT_ACCEPTABLE, networkHandler.canUpdateNetwork(sharedNeutronNetwork, sharedNeutronNetwork));
+        assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canUpdateNetwork(sharedNeutronNetwork, sharedNeutronNetwork));
         assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canUpdateNetwork(nonSharedNeutronNetwork, nonSharedNeutronNetwork));
     }
 
diff --git a/resources/commons/L2Gateway.json.postman_collection b/resources/commons/L2Gateway.json.postman_collection
new file mode 100644 (file)
index 0000000..0217f8a
--- /dev/null
@@ -0,0 +1,455 @@
+{
+       "id": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+       "name": "L2 Gateway",
+       "description": "",
+       "order": [],
+       "folders": [
+               {
+                       "id": "c7e3f572-cbc4-93cb-6050-b97b67850e31",
+                       "name": "L2 Gateway",
+                       "description": "",
+                       "order": [
+                               "fba3ec18-97b5-6a84-0b8f-8a41ca1bd075",
+                               "d1522560-e286-4c16-635d-239d935ffcbe",
+                               "9e399879-8048-7435-b3af-a6e715f246c3",
+                               "d8b975eb-8fb6-9ec9-8abb-b73322410b7d",
+                               "d56f7137-9ea3-136f-c237-ee9a583c1bb6"
+                       ],
+                       "owner": 0,
+                       "collectionId": "8ed3570d-1ce1-06a1-e720-1192b852a411"
+               },
+               {
+                       "id": "5733d57d-90b7-6926-12ce-709b81ac492f",
+                       "name": "L2 Gateway Connection",
+                       "description": "",
+                       "order": [
+                               "1f37f9a9-c644-83e0-ea01-c0ea9234ac13",
+                               "9cbb9282-f4fd-d8dc-107a-a12a8c5119b7",
+                               "9a6da9e9-8fb9-4d5e-821d-2b12da2af9dd"
+                       ],
+                       "owner": 0
+               },
+               {
+                       "id": "d2c53196-d8f7-ccef-48d4-b5999c943fe0",
+                       "name": "Neutron",
+                       "description": "",
+                       "order": [
+                               "5fff0085-3e2b-d8d9-f706-7f24e907258f",
+                               "9c323185-f2f9-1c5d-c6e3-aa42a1d40302",
+                               "c12b0610-73d2-9529-e2d8-21771e6f5a87",
+                               "5568645c-4629-74f0-622b-d5211a62ccbf",
+                               "c8e5c92e-c0f5-f7b4-b121-bb7021d49a30",
+                               "d03c715b-c817-cf9c-6c82-2a21b3b3d59c",
+                               "6925af47-8f78-57b4-ed09-1691dc8e6441",
+                               "1dc716ce-bd83-a6fd-046c-e6b7e34a519c",
+                               "fbfd7afd-05c9-937a-4e18-25f37a2cb99f",
+                               "761e694c-c493-92cb-039a-e7a278b369de",
+                               "314e62ca-26a2-2e91-9d0e-c118e4288b13"
+                       ],
+                       "owner": 0,
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93"
+               }
+       ],
+       "timestamp": 1453438450886,
+       "owner": 0,
+       "remoteLink": "",
+       "public": false,
+       "requests": [
+               {
+                       "id": "1dc716ce-bd83-a6fd-046c-e6b7e34a519c",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/ports",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "POST",
+                       "data": [],
+                       "dataMode": "raw",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1456928762606,
+                       "name": "Neutron Port Create - 2",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "rawModeData": "{\r\n    \"port\": \r\n    {\r\n        \"mac_address\": \"00:00:00:00:00:02\",\r\n        \"name\": \"tap23701c04-76\",\r\n        \"network_id\": \"9227c228-6bba-4bbe-bdb8-6942768ff0f1\",\r\n        \"id\": \"23701c04-7668-4c65-9425-78a80d49a219\",\r\n        \"tenant_id\": \"de0a7495-05c4-4be0-b796-1412835c6820\",\r\n        \"admin_state_up\": \"true\",\r\n        \"device_id\": \"\",\r\n        \"device_owner\": \"test\", \r\n        \"fixed_ips\": \r\n        [\r\n            {\r\n                \"subnet_id\": \"9b09f1a7-250f-4562-8093-e6018aeceaf6\",\r\n                \"ip_address\": \"10.0.0.2\"\r\n            } \r\n        ]\r\n     }\r\n}",
+                       "folder": "d2c53196-d8f7-ccef-48d4-b5999c943fe0"
+               },
+               {
+                       "id": "1f37f9a9-c644-83e0-ea01-c0ea9234ac13",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/l2gateway-connections",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "POST",
+                       "data": [],
+                       "dataMode": "raw",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1454644623496,
+                       "name": "L2GW Connection Create",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "rawModeData": "{\r\n    \"l2gateway_connection\": \r\n    {\r\n        \"tenant_id\":\"de0a7495-05c4-4be0-b796-1412835c6820\",\r\n        \"id\":\"5227c228-6bba-4bbe-bdb8-6942768ff0e1\",\r\n        \"port_id\": \"9ea656c7c9b8447494f33b0bc741d9a9\",\r\n        \"network_id\": \"9227c228-6bba-4bbe-bdb8-6942768ff0f1\",\r\n        \"default_segmentation_id\": 100,\r\n        \"gateway_id\": \"5227c228-6bba-4bbe-bdb8-6942768ff0f1\"\r\n    }\r\n}",
+                       "folder": "5733d57d-90b7-6926-12ce-709b81ac492f"
+               },
+               {
+                       "id": "314e62ca-26a2-2e91-9d0e-c118e4288b13",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/ports/23701c04-7668-4c65-9425-78a80d49a219",
+                       "pathVariables": {},
+                       "preRequestScript": "",
+                       "method": "DELETE",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "data": [],
+                       "dataMode": "raw",
+                       "name": "Neutron Port Delete - 2",
+                       "description": "",
+                       "descriptionFormat": "html",
+                       "time": 1453441723388,
+                       "version": 2,
+                       "responses": [],
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "folder": "d2c53196-d8f7-ccef-48d4-b5999c943fe0",
+                       "rawModeData": "{\n    \"port\": {\n        \"admin_state_up\": true,\n        \"device_id\": \"d6b4d3a5-c700-476f-b609-1493dd9dadc0\",\n        \"name\": \"port2\",\n        \"network_id\": \"2775510e-4c75-4f94-92bf-6743a43c7002\",\n        \"tenant_id\":\"38470401580249029f5b811e841e16a4\",\n        \"mac_address\": \"fa:16:3e:70:d2:8c\"\n        \n    }\n}"
+               },
+               {
+                       "id": "5568645c-4629-74f0-622b-d5211a62ccbf",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/subnets",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "POST",
+                       "data": [],
+                       "dataMode": "raw",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1456487331767,
+                       "name": "Neutron Subnet Create",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "rawModeData": "{ \r\n    \"subnet\" :\r\n    {\r\n        \"enable_dhcp\": \"false\",\r\n        \"name\": \"Substring\",\r\n        \"network_id\": \"9227c228-6bba-4bbe-bdb8-6942768ff0f1\",\r\n        \"id\": \"9b09f1a7-250f-4562-8093-e6018aeceaf6\",\r\n        \"tenant_id\": \"de0a7495-05c4-4be0-b796-1412835c6820\",\r\n        \"ip_version\": 4,\r\n        \"cidr\": \"10.0.0.0/24\"\r\n    }\r\n}",
+                       "folder": "d2c53196-d8f7-ccef-48d4-b5999c943fe0"
+               },
+               {
+                       "id": "5fff0085-3e2b-d8d9-f706-7f24e907258f",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/networks",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "POST",
+                       "data": [],
+                       "dataMode": "raw",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1455768028805,
+                       "name": "Neutron Network Create",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "rawModeData": "{  \n   \"network\":{  \n      \"status\":\"ACTIVE\",\n      \"subnets\":[  \n          \"9b09f1a7-250f-4562-8093-e6018aeceaf6\"\n      ],\n      \"name\":\"net1\",\n      \"router:external\":false,\n      \"tenant_id\":\"de0a7495-05c4-4be0-b796-1412835c6820\",\n      \"admin_state_up\":true,\n      \"shared\":false,\n      \"id\":\"9227c228-6bba-4bbe-bdb8-6942768ff0f1\",\n      \"provider:segmentation_id\": \"100\",\n      \"provider:physical_network\": \"8bab8453-1bc9-45af-8c70-f83aa9b50450\",\n      \"provider:network_type\": \"vxlan\"\n   }\n}",
+                       "folder": "d2c53196-d8f7-ccef-48d4-b5999c943fe0"
+               },
+               {
+                       "id": "6925af47-8f78-57b4-ed09-1691dc8e6441",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/ports",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "POST",
+                       "data": [],
+                       "dataMode": "raw",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1456928750206,
+                       "name": "Neutron Port Create - 1",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "rawModeData": "{\r\n    \"port\": \r\n     {\r\n        \"mac_address\": \"00:00:00:00:00:01\",\r\n        \"name\": \"tap23701c04-75\",\r\n        \"network_id\": \"9227c228-6bba-4bbe-bdb8-6942768ff0f1\",\r\n        \"id\": \"23701c04-7558-4c65-9425-78a80d49a218\",\r\n        \"tenant_id\": \"de0a7495-05c4-4be0-b796-1412835c6820\",\r\n        \"admin_state_up\": \"true\",\r\n        \"device_id\": \"\",\r\n        \"device_owner\": \"test\", \r\n        \"fixed_ips\": \r\n        [\r\n            {\r\n                \"subnet_id\": \"9b09f1a7-250f-4562-8093-e6018aeceaf6\",\r\n                \"ip_address\": \"10.0.0.1\"\r\n            } \r\n        ]\r\n     }\r\n}",
+                       "folder": "d2c53196-d8f7-ccef-48d4-b5999c943fe0"
+               },
+               {
+                       "id": "761e694c-c493-92cb-039a-e7a278b369de",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/ports/23701c04-7558-4c65-9425-78a80d49a218",
+                       "pathVariables": {},
+                       "preRequestScript": "",
+                       "method": "DELETE",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "data": [],
+                       "dataMode": "raw",
+                       "name": "Neutron Port Delete - 1",
+                       "description": "",
+                       "descriptionFormat": "html",
+                       "time": 1453441716290,
+                       "version": 2,
+                       "responses": [],
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "folder": "d2c53196-d8f7-ccef-48d4-b5999c943fe0",
+                       "rawModeData": "{\n    \"port\": {\n        \"admin_state_up\": true,\n        \"device_id\": \"d6b4d3a5-c700-476f-b609-1493dd9dadc0\",\n        \"name\": \"port1\",\n        \"network_id\": \"2775510e-4c75-4f94-92bf-6743a43c7002\",\n        \"tenant_id\":\"38470401580249029f5b811e841e16a4\",\n        \"mac_address\": \"fa:16:3e:70:d2:8c\"\n        \n    }\n}"
+               },
+               {
+                       "id": "9a6da9e9-8fb9-4d5e-821d-2b12da2af9dd",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/l2gateway-connections/5227c228-6bba-4bbe-bdb8-6942768ff0e1",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "DELETE",
+                       "data": [],
+                       "dataMode": "params",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1453446976189,
+                       "name": "L2GW Connection Delete",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "folder": "5733d57d-90b7-6926-12ce-709b81ac492f"
+               },
+               {
+                       "id": "9c323185-f2f9-1c5d-c6e3-aa42a1d40302",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/networks",
+                       "pathVariables": {},
+                       "preRequestScript": "",
+                       "method": "GET",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "data": [],
+                       "dataMode": "params",
+                       "name": "Neutron Network Get",
+                       "description": "",
+                       "descriptionFormat": "html",
+                       "time": 1453441666005,
+                       "version": 2,
+                       "responses": [],
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "folder": "d2c53196-d8f7-ccef-48d4-b5999c943fe0"
+               },
+               {
+                       "id": "9cbb9282-f4fd-d8dc-107a-a12a8c5119b7",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/l2gateway-connections",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "GET",
+                       "data": [],
+                       "dataMode": "params",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1453446923466,
+                       "name": "L2GW Connection Get",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "folder": "5733d57d-90b7-6926-12ce-709b81ac492f"
+               },
+               {
+                       "id": "9e399879-8048-7435-b3af-a6e715f246c3",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/l2-gateways",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "GET",
+                       "data": [],
+                       "dataMode": "params",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1453440994169,
+                       "name": "L2GWs Get",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "folder": "c7e3f572-cbc4-93cb-6050-b97b67850e31"
+               },
+               {
+                       "id": "c12b0610-73d2-9529-e2d8-21771e6f5a87",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/networks/9227c228-6bba-4bbe-bdb8-6942768ff0f1",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "DELETE",
+                       "data": [],
+                       "dataMode": "raw",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1453441856431,
+                       "name": "Neutron Network Delete",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "rawModeData": "{  \n   \"network\":{  \n      \"status\":\"ACTIVE\",\n      \"subnets\":[  \n\n      ],\n      \"name\":\"net1\",\n      \"router:external\":false,\n      \"tenant_id\":\"38470401580249029f5b811e841e16a4\",\n      \"admin_state_up\":true,\n      \"mtu\":0,\n      \"shared\":false,\n      \"id\":\"2775510e-4c75-4f94-92bf-6743a43c7002\"\n   }\n}",
+                       "folder": "d2c53196-d8f7-ccef-48d4-b5999c943fe0"
+               },
+               {
+                       "id": "c8e5c92e-c0f5-f7b4-b121-bb7021d49a30",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/subnets",
+                       "pathVariables": {},
+                       "preRequestScript": "",
+                       "method": "GET",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "data": [],
+                       "dataMode": "params",
+                       "name": "Neutron Subnet Get",
+                       "description": "",
+                       "descriptionFormat": "html",
+                       "time": 1453441742471,
+                       "version": 2,
+                       "responses": [],
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "folder": "d2c53196-d8f7-ccef-48d4-b5999c943fe0"
+               },
+               {
+                       "id": "d03c715b-c817-cf9c-6c82-2a21b3b3d59c",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/subnets/9b09f1a7-250f-4562-8093-e6018aeceaf6",
+                       "pathVariables": {},
+                       "preRequestScript": "",
+                       "method": "DELETE",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "data": [],
+                       "dataMode": "params",
+                       "name": "Neutron Subnet Delete",
+                       "description": "",
+                       "descriptionFormat": "html",
+                       "time": 1453441748540,
+                       "version": 2,
+                       "responses": [],
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "folder": "d2c53196-d8f7-ccef-48d4-b5999c943fe0"
+               },
+               {
+                       "id": "d1522560-e286-4c16-635d-239d935ffcbe",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/l2-gateways",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "POST",
+                       "data": [],
+                       "dataMode": "raw",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1456120958967,
+                       "name": "L2GW Create - 2",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "rawModeData": "{\r\n    \"l2_gateway\": \r\n    {\r\n        \"tenant_id\":\"de0a7495-05c4-4be0-b796-1412835c6820\",\r\n        \"id\":\"5227c228-6bba-4bbe-bdb8-6942768ff0f2\",\r\n        \"name\": \"<gateway-name>\",\r\n        \"devices\": \r\n        [\r\n            {\r\n                \"device_name\": \"s2\",\r\n                \"interfaces\": \r\n                [\r\n                    {\r\n                        \"name\":\"s2-eth1\",\r\n                        \"segmentation_id\":103\r\n                    },\r\n                    {\r\n                        \"name\":\"s2-eth1\",\r\n                        \"segmentation_id\":[154,155]\r\n                        \r\n                    }\r\n                ]\r\n            }\r\n        ]\r\n    }\r\n}",
+                       "folder": "c7e3f572-cbc4-93cb-6050-b97b67850e31"
+               },
+               {
+                       "id": "d56f7137-9ea3-136f-c237-ee9a583c1bb6",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/l2-gateways/5227c228-6bba-4bbe-bdb8-6942768ff0f2",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "DELETE",
+                       "data": [],
+                       "dataMode": "params",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1453873711216,
+                       "name": "L2GW Delete - 2",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "folder": "c7e3f572-cbc4-93cb-6050-b97b67850e31"
+               },
+               {
+                       "id": "d8b975eb-8fb6-9ec9-8abb-b73322410b7d",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/l2-gateways/5227c228-6bba-4bbe-bdb8-6942768ff0f1",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "DELETE",
+                       "data": [],
+                       "dataMode": "params",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1453441271022,
+                       "name": "L2GW Delete - 1",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "folder": "c7e3f572-cbc4-93cb-6050-b97b67850e31"
+               },
+               {
+                       "id": "fba3ec18-97b5-6a84-0b8f-8a41ca1bd075",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/l2-gateways",
+                       "preRequestScript": "",
+                       "pathVariables": {},
+                       "method": "POST",
+                       "data": [],
+                       "dataMode": "raw",
+                       "version": 2,
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "time": 1456487197833,
+                       "name": "L2GW Create - 1",
+                       "description": "",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "responses": [],
+                       "rawModeData": "{\r\n    \"l2_gateway\": \r\n    {\r\n        \"tenant_id\":\"de0a7495-05c4-4be0-b796-1412835c6820\",\r\n        \"id\":\"5227c228-6bba-4bbe-bdb8-6942768ff0f1\",\r\n        \"name\": \"<gateway-name>\",\r\n        \"devices\": \r\n        [\r\n            {\r\n                \"device_name\": \"s2\",\r\n                \"interfaces\": \r\n                [\r\n                    {\r\n                        \"name\":\"s2-eth1\",\r\n                        \"segmentation_id\":0\r\n                    },\r\n                    {\r\n                        \"name\":\"s2-eth1\",\r\n                        \"segmentation_id\":[0,152]\r\n                        \r\n                    }\r\n                ]\r\n            },\r\n            {\r\n                \"device_name\": \"s2\",\r\n                \"interfaces\": \r\n                [\r\n                    {\r\n                        \"name\":\"s2-eth1\",\r\n                        \"segmentation_id\":101\r\n                    },\r\n                    {\r\n                        \"name\":\"s2-eth1\",\r\n                        \"segmentation_id\":[153]\r\n                        \r\n                    }\r\n                ]\r\n            }            \r\n        ]\r\n    }\r\n}",
+                       "folder": "c7e3f572-cbc4-93cb-6050-b97b67850e31"
+               },
+               {
+                       "id": "fbfd7afd-05c9-937a-4e18-25f37a2cb99f",
+                       "headers": "Content-Type: application/json\nCache-Control: no-cache\nAccept: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+                       "url": "http://localhost:8080/controller/nb/v2/neutron/ports",
+                       "pathVariables": {},
+                       "preRequestScript": "",
+                       "method": "GET",
+                       "collectionId": "a0aa0801-64e9-6ac6-63bf-113a98143e93",
+                       "data": [],
+                       "dataMode": "params",
+                       "name": "Neutron Ports Get",
+                       "description": "",
+                       "descriptionFormat": "html",
+                       "time": 1453441707144,
+                       "version": 2,
+                       "responses": [],
+                       "tests": "",
+                       "currentHelper": "normal",
+                       "helperAttributes": {},
+                       "folder": "d2c53196-d8f7-ccef-48d4-b5999c943fe0"
+               }
+       ]
+}
\ No newline at end of file
diff --git a/utils/it-utils/src/main/java/org/opendaylight/netvirt/utils/it/utils/ItUtils.java b/utils/it-utils/src/main/java/org/opendaylight/netvirt/utils/it/utils/ItUtils.java
deleted file mode 100644 (file)
index 1ee2ab3..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 2016 Red Hat, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.netvirt.utils.it.utils;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.List;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.ovsdb.utils.mdsal.utils.NotifyingDataChangeListener;
-import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class contains various utility methods used in OVSDB integration tests (IT).
- */
-public class ItUtils {
-    private static final Logger LOG = LoggerFactory.getLogger(ItUtils.class);
-    MdsalUtils mdsalUtils;
-    SouthboundUtils southboundUtils;
-    DataBroker dataBroker;
-
-    /**
-     * Create a new ItUtils instance
-     * @param dataBroker  md-sal data broker
-     */
-    public ItUtils(DataBroker dataBroker) {
-        this.dataBroker = dataBroker;
-        mdsalUtils = new MdsalUtils(dataBroker);
-        southboundUtils = new SouthboundUtils(mdsalUtils);
-    }
-
-    /**
-     * Get a NodeInfo instance initialized with this ItUtil's DataBroker
-     * @param connectionInfo ConnectionInfo for the OVSDB server
-     * @param waitList For tracking outstanding md-sal events notifications
-     * @return
-     */
-    public NodeInfo createNodeInfo(ConnectionInfo connectionInfo, List<NotifyingDataChangeListener> waitList) {
-        return new NodeInfo(connectionInfo, this, waitList);
-    }
-
-    /**
-     * Checks whether the OVSDB controller is connected. This method will retry 10 times and will through an
-     * AssertionError for any number of unexpected states.
-     * @param connectionInfo
-     * @return true if connected
-     * @throws InterruptedException
-     */
-    public boolean isControllerConnected(ConnectionInfo connectionInfo) throws InterruptedException {
-        LOG.info("isControllerConnected enter");
-        ControllerEntry controllerEntry;
-        Node ovsdbNode = southboundUtils.getOvsdbNode(connectionInfo);
-        assertNotNull("ovsdb node not found", ovsdbNode);
-
-        String controllerTarget = southboundUtils.getControllersFromOvsdbNode(ovsdbNode).get(0);
-        assertNotNull("Failed to get controller target", controllerTarget);
-
-        for (int i = 0; i < 10; i++) {
-            LOG.info("isControllerConnected try {}: looking for controller: {}", i, controllerTarget);
-            OvsdbBridgeAugmentation bridge =
-                    southboundUtils.getBridge(connectionInfo, "br-int");
-            if (bridge != null && bridge.getControllerEntry() != null) {
-                controllerEntry = bridge.getControllerEntry().iterator().next();
-                assertEquals(controllerTarget, controllerEntry.getTarget().getValue());
-                if (controllerEntry.isIsConnected()) {
-                    LOG.info("isControllerConnected exit: true {}", controllerTarget);
-                    return true;
-                }
-            }
-            Thread.sleep(1000);
-        }
-        LOG.info("isControllerConnected exit: false {}", controllerTarget);
-        return false;
-    }
-
-    public static DataBroker getDatabroker(BindingAwareBroker.ProviderContext providerContext) {
-        DataBroker dataBroker = providerContext.getSALService(DataBroker.class);
-        assertNotNull("dataBroker should not be null", dataBroker);
-        return dataBroker;
-    }
-
-    public Boolean getNetvirtTopology() {
-        LOG.info("getNetvirtTopology: looking for {}...", ItConstants.NETVIRT_TOPOLOGY_ID);
-        Boolean found = false;
-        final TopologyId topologyId = new TopologyId(new Uri(ItConstants.NETVIRT_TOPOLOGY_ID));
-        InstanceIdentifier<Topology> path =
-                InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId));
-        for (int i = 0; i < 60; i++) {
-            Topology topology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, path);
-            if (topology != null) {
-                LOG.info("getNetvirtTopology: found {}...", ItConstants.NETVIRT_TOPOLOGY_ID);
-                found = true;
-                break;
-            } else {
-                LOG.info("getNetvirtTopology: still looking (try {})...", i);
-                try {
-                    Thread.sleep(1000);
-                } catch (InterruptedException e) {
-                    LOG.warn("Interrupted while waiting for {}", ItConstants.NETVIRT_TOPOLOGY_ID, e);
-                }
-            }
-        }
-        return found;
-    }
-}
diff --git a/utils/it-utils/src/main/java/org/opendaylight/netvirt/utils/it/utils/NodeInfo.java b/utils/it-utils/src/main/java/org/opendaylight/netvirt/utils/it/utils/NodeInfo.java
deleted file mode 100644 (file)
index 85a29e3..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2016 Red Hat, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.netvirt.utils.it.utils;
-
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.utils.mdsal.utils.NotifyingDataChangeListener;
-import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Utility class for connections to an OVSDB node. Contains various info for the node
- * as public data members.
- */
-public class NodeInfo {
-    private static final Logger LOG = LoggerFactory.getLogger(NodeInfo.class);
-    public static final String INTEGRATION_BRIDGE_NAME = "br-int";
-
-    private ConnectionInfo connectionInfo;
-    private InstanceIdentifier<Node> ovsdbIid;
-    InstanceIdentifier<Node> bridgeIid;
-    public long datapathId;
-    public Node ovsdbNode;
-    public Node bridgeNode;
-    NotifyingDataChangeListener ovsdbWaiter;
-    NotifyingDataChangeListener bridgeWaiter;
-    List<NotifyingDataChangeListener> waitList;
-    ItUtils itUtils;
-
-    /**
-     * Create a new NodeInfo object
-     * @param connectionInfo of the OVSDB node
-     * @param itUtils ItUtils instance
-     * @param waitList for tracking outstanding md-sal events
-     */
-    NodeInfo(ConnectionInfo connectionInfo, ItUtils itUtils, List<NotifyingDataChangeListener> waitList) {
-        this.connectionInfo = connectionInfo;
-        this.itUtils = itUtils;
-        this.waitList = waitList;
-        ovsdbIid = SouthboundUtils.createInstanceIdentifier(connectionInfo);
-        bridgeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo, INTEGRATION_BRIDGE_NAME);
-    }
-
-    /**
-     * Connect to the OVSDB node, wait for the connection to be established and for the integration bridge
-     * to be successfully created. Contains assertions for unexpected states
-     * @throws InterruptedException
-     */
-    public void connect() throws InterruptedException {
-        ovsdbWaiter = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, ovsdbIid, waitList);
-        ovsdbWaiter.registerDataChangeListener(itUtils.dataBroker);
-        bridgeWaiter = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, bridgeIid, waitList);
-        bridgeWaiter.registerDataChangeListener(itUtils.dataBroker);
-
-        assertNotNull("connection failed", itUtils.southboundUtils.addOvsdbNode(connectionInfo, 0));
-
-        ovsdbWaiter.waitForCreation();
-        ovsdbNode = itUtils.southboundUtils.getOvsdbNode(connectionInfo);
-        assertNotNull("node is not connected", ovsdbNode);
-
-        bridgeWaiter.waitForCreation();
-        assertTrue("Controller " + SouthboundUtils.connectionInfoToString(connectionInfo)
-                + " is not connected", itUtils.isControllerConnected(connectionInfo));
-
-        bridgeNode = itUtils.southboundUtils.getBridgeNode(ovsdbNode, INTEGRATION_BRIDGE_NAME);
-        assertNotNull("bridge " + INTEGRATION_BRIDGE_NAME + " was not found", bridgeNode);
-        datapathId = itUtils.southboundUtils.getDataPathId(bridgeNode);
-        String datapathIdString = itUtils.southboundUtils.getDatapathId(bridgeNode);
-        LOG.info("testNetVirt: bridgeNode: {}, datapathId: {} - {}", bridgeNode, datapathIdString, datapathId);
-        assertNotEquals("datapathId was not found", datapathId, 0);
-    }
-
-    /**
-     * Remove integration bridge and teardown connection. Contains assertions for unexpected states.
-     * @throws InterruptedException
-     */
-    public void disconnect() throws InterruptedException {
-        assertTrue(itUtils.southboundUtils.deleteBridge(connectionInfo, INTEGRATION_BRIDGE_NAME, 0));
-        itUtils.southboundUtils.deleteBridge(connectionInfo, INTEGRATION_BRIDGE_NAME, 0);
-        bridgeWaiter.waitForDeletion();
-        Node bridgeNode = itUtils.mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, bridgeIid);
-        assertNull("Bridge should not be found", bridgeNode);
-        assertTrue(itUtils.southboundUtils.disconnectOvsdbNode(connectionInfo, 0));
-        itUtils.southboundUtils.disconnectOvsdbNode(connectionInfo, 0);
-        ovsdbWaiter.waitForDeletion();
-        Node ovsdbNode = itUtils.mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, ovsdbIid);
-        assertNull("Ovsdb node should not be found", ovsdbNode);
-    }
-
-}
similarity index 74%
rename from utils/it-utils/pom.xml
rename to utils/netvirt-it-utils/pom.xml
index be18d67afce87925c50d77eedabeb4472abef282..59b7c002d6591167e1668ff808bb39691927329e 100644 (file)
@@ -19,7 +19,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.opendaylight.netvirt</groupId>
-  <artifactId>utils.it-utils</artifactId>
+  <artifactId>utils.netvirt-it-utils</artifactId>
   <version>1.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
@@ -59,6 +59,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
           <artifactId>utils.southbound-utils</artifactId>
           <version>${project.version}</version>
       </dependency>
+      <dependency>
+          <groupId>org.opendaylight.netvirt</groupId>
+          <artifactId>utils.mdsal-openflow</artifactId>
+          <version>${project.version}</version>
+      </dependency>
       <dependency>
           <groupId>org.opendaylight.mdsal.model</groupId>
           <artifactId>ietf-inet-types</artifactId>
@@ -73,4 +78,24 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
           <scope>compile</scope>
       </dependency>
   </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Embed-Dependency>
+              utils.mdsal-openflow;groupId=org.opendaylight.netvirt;type=!pom;inline=false
+            </Embed-Dependency>
+            <Embed-Transitive>true</Embed-Transitive>
+            <Export-Package>
+              org.opendaylight.netvirt.utils.netvirt.it.utils
+            </Export-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>
similarity index 95%
rename from utils/it-utils/src/main/java/org/opendaylight/netvirt/utils/it/utils/ItConstants.java
rename to utils/netvirt-it-utils/src/main/java/org/opendaylight/netvirt/utils/netvirt/it/utils/ItConstants.java
index e6c14a40e61954c389611494569085637cef0283..eac8a9720d3caffdd30136e9b2bbb40a68bdef1e 100644 (file)
@@ -5,10 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.netvirt.utils.it.utils;
+
+package org.opendaylight.netvirt.utils.netvirt.it.utils;
 
 /**
- * Constants for SouthboundIT
+ * Constants for SouthboundIT.
  */
 public final class ItConstants {
     private ItConstants() {
diff --git a/utils/netvirt-it-utils/src/main/java/org/opendaylight/netvirt/utils/netvirt/it/utils/NetvirtItUtils.java b/utils/netvirt-it-utils/src/main/java/org/opendaylight/netvirt/utils/netvirt/it/utils/NetvirtItUtils.java
new file mode 100644 (file)
index 0000000..2e694b4
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2016 Red Hat, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.netvirt.utils.netvirt.it.utils;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.ovsdb.utils.mdsal.utils.NotifyingDataChangeListener;
+import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class contains various utility methods used in netvirt integration tests (IT).
+ */
+public class NetvirtItUtils {
+    private static final Logger LOG = LoggerFactory.getLogger(NetvirtItUtils.class);
+    MdsalUtils mdsalUtils;
+    SouthboundUtils southboundUtils;
+    DataBroker dataBroker;
+
+    /**
+     * Create a new NetvirtItUtils instance.
+     * @param dataBroker  md-sal data broker
+     */
+    public NetvirtItUtils(DataBroker dataBroker) {
+        this.dataBroker = dataBroker;
+        mdsalUtils = new MdsalUtils(dataBroker);
+        southboundUtils = new SouthboundUtils(mdsalUtils);
+    }
+
+    /**
+     * Check that the netvirt topology is in the operational mdsal.
+     * @return true if the netvirt topology was successfully retrieved
+     */
+    public Boolean getNetvirtTopology() {
+        LOG.info("getNetvirtTopology: looking for {}...", ItConstants.NETVIRT_TOPOLOGY_ID);
+        final TopologyId topologyId = new TopologyId(new Uri(ItConstants.NETVIRT_TOPOLOGY_ID));
+        InstanceIdentifier<Topology> path =
+                InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId));
+        NotifyingDataChangeListener waitForIt = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL,
+                path, null);
+        waitForIt.registerDataChangeListener(dataBroker);
+        try {
+            waitForIt.waitForCreation(60 * 1000);
+        } catch (InterruptedException e) {
+            LOG.info("getNetvirtTopology: InterruptedException while wait(ing)ForCreation");
+        }
+
+        boolean found = null != mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, path);
+
+        LOG.info("getNetvirtTopology: found {} == {}", ItConstants.NETVIRT_TOPOLOGY_ID, found);
+
+        return found;
+    }
+
+    /**
+     * Verify that the given flow was installed in a table. This method will wait 10 seconds for the flows
+     * to appear in each of the md-sal CONFIGURATION and OPERATIONAL data stores
+     * @param datapathId dpid where flow is installed
+     * @param flowId The "name" of the flow, e.g., "TunnelFloodOut_100"
+     * @param table integer value of table
+     * @throws InterruptedException if interrupted while waiting for flow to appear in mdsal
+     */
+    public void verifyFlow(long datapathId, String flowId, short table) throws InterruptedException {
+        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder nodeBuilder =
+                FlowUtils.createNodeBuilder(datapathId);
+        FlowBuilder flowBuilder =
+                FlowUtils.initFlowBuilder(new FlowBuilder(), flowId, table);
+        InstanceIdentifier<Flow> iid = FlowUtils.createFlowPath(flowBuilder, nodeBuilder);
+
+        NotifyingDataChangeListener waitForIt = new NotifyingDataChangeListener(LogicalDatastoreType.CONFIGURATION,
+                iid, null);
+        waitForIt.registerDataChangeListener(dataBroker);
+        waitForIt.waitForCreation(10000);
+
+        Flow flow = FlowUtils.getFlow(flowBuilder, nodeBuilder,
+                        dataBroker.newReadOnlyTransaction(), LogicalDatastoreType.CONFIGURATION);
+        assertNotNull("Could not find flow in config: " + flowBuilder.build() + "--" + nodeBuilder.build(), flow);
+
+        waitForIt = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, iid, null);
+        waitForIt.registerDataChangeListener(dataBroker);
+        waitForIt.waitForCreation(10000);
+
+        flow = FlowUtils.getFlow(flowBuilder, nodeBuilder,
+                        dataBroker.newReadOnlyTransaction(), LogicalDatastoreType.OPERATIONAL);
+        assertNotNull("Could not find flow in operational: " + flowBuilder.build() + "--" + nodeBuilder.build(),
+                flow);
+    }
+
+    /**
+     * Get a DataBroker and assert that it is not null.
+     * @param providerContext ProviderContext from which to retrieve the DataBroker
+     * @return the Databroker
+     */
+    public static DataBroker getDatabroker(BindingAwareBroker.ProviderContext providerContext) {
+        DataBroker dataBroker = providerContext.getSALService(DataBroker.class);
+        assertNotNull("dataBroker should not be null", dataBroker);
+        return dataBroker;
+    }
+}
index 373fb355124a01d5287ede08e674ae33d67cb9b2..5e61d5fb97ab03d55f0bc03146b51200e1c7a792 100644 (file)
@@ -50,9 +50,9 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   </prerequisites>
   <modules>
     <module>config</module>
-    <module>it-utils</module>
     <module>mdsal-openflow</module>
     <module>mdsal-utils</module>
+    <module>netvirt-it-utils</module>
     <module>neutron-utils</module>
     <module>servicehelper</module>
   </modules>