Use neutron-utils 02/37702/1
authorJosh <jhershbe@redhat.com>
Sun, 17 Apr 2016 14:00:22 +0000 (16:00 +0200)
committerJosh <jhershbe@redhat.com>
Sun, 17 Apr 2016 14:14:20 +0000 (16:14 +0200)
Change-Id: Ibe4a5aee6f4b1d4a48584d9a7a0a750ce1aeaa11
Signed-off-by: Josh <jhershbe@redhat.com>
features/src/main/features/features.xml
openstack/net-virt-it/pom.xml
openstack/net-virt-it/src/test/java/org/opendaylight/netvirt/openstack/netvirt/it/NetvirtIT.java
openstack/net-virt-it/src/test/java/org/opendaylight/netvirt/openstack/netvirt/it/NeutronUtils.java [deleted file]

index 26722ee69f75e3b1b25857fc79f120a4d2bc39c8..3eb55672c4dbd28edbfc13fb41f01d9635241a73 100644 (file)
@@ -41,6 +41,7 @@
     <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>
+    <bundle>mvn:org.opendaylight.netvirt/utils.neutron-utils/{{VERSION}}</bundle>
   </feature>
 
   <feature name="odl-ovsdb-openstack-clusteraware" description="OpenDaylight :: OVSDB :: OpenStack Network Virtualization - Cluster Aware"
     <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.netvirt/utils.neutron-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 c3c00adf45d5629ad2d5291061752ac764aed503..d07c222ca6c34ec9fadae20154c465c369a1cb2f 100644 (file)
@@ -99,6 +99,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <version>${ovsdb.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>utils.neutron-utils</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
index ea09f1c4325aa992273190dbe64681b7fd50a65c..5a2a68e91dd933cd0d422318a7ab1bf4b97f0da0 100644 (file)
@@ -42,6 +42,7 @@ 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.netvirt.utils.neutron.utils.NeutronUtils;
 import org.opendaylight.neutron.spi.INeutronPortCRUD;
 import org.opendaylight.neutron.spi.INeutronSecurityGroupCRUD;
 import org.opendaylight.neutron.spi.INeutronSecurityRuleCRUD;
diff --git a/openstack/net-virt-it/src/test/java/org/opendaylight/netvirt/openstack/netvirt/it/NeutronUtils.java b/openstack/net-virt-it/src/test/java/org/opendaylight/netvirt/openstack/netvirt/it/NeutronUtils.java
deleted file mode 100644 (file)
index a2b0b4b..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.opendaylight.netvirt.openstack.netvirt.it;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.opendaylight.neutron.spi.INeutronNetworkCRUD;
-import org.opendaylight.neutron.spi.INeutronPortCRUD;
-import org.opendaylight.neutron.spi.INeutronSubnetCRUD;
-import org.opendaylight.neutron.spi.NeutronNetwork;
-import org.opendaylight.neutron.spi.NeutronPort;
-import org.opendaylight.neutron.spi.NeutronSecurityGroup;
-import org.opendaylight.neutron.spi.NeutronSubnet;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-
-public class NeutronUtils {
-    public NeutronPort createNeutronPort(String networkId, String subnetId,
-                                         String id, String owner, String ipaddr, String mac) {
-        INeutronPortCRUD iNeutronPortCRUD =
-                (INeutronPortCRUD) ServiceHelper.getGlobalInstance(INeutronPortCRUD.class, this);
-        NeutronPort np = new NeutronPort();
-        np.initDefaults();
-        np.setID(id);
-        np.setDeviceOwner(owner);
-        np.setMacAddress(mac);
-        np.setNetworkUUID(networkId);
-        List<org.opendaylight.neutron.spi.Neutron_IPs> srcAddressList =
-                new ArrayList<>();
-        org.opendaylight.neutron.spi.Neutron_IPs nip = new org.opendaylight.neutron.spi.Neutron_IPs();
-        nip.setIpAddress(ipaddr);
-        nip.setSubnetUUID(subnetId);
-        srcAddressList.add(nip);
-        np.setFixedIPs(srcAddressList);
-        List<NeutronSecurityGroup> nsgs = new ArrayList<>();
-        np.setSecurityGroups(nsgs);
-        iNeutronPortCRUD.add(np);
-        return np;
-    }
-
-    public NeutronSubnet createNeutronSubnet(String subnetId, String tenantId,
-                                              String networkId, String cidr) {
-        INeutronSubnetCRUD iNeutronSubnetCRUD =
-                (INeutronSubnetCRUD) ServiceHelper.getGlobalInstance(INeutronSubnetCRUD.class, this);
-        NeutronSubnet ns = new NeutronSubnet();
-        ns.setID(subnetId);
-        ns.setCidr(cidr);
-        ns.initDefaults();
-        ns.setNetworkUUID(networkId);
-        ns.setTenantID(tenantId);
-        iNeutronSubnetCRUD.add(ns);
-        return ns;
-    }
-
-    public NeutronNetwork createNeutronNetwork(String uuid, String tenantID, String networkTypeVxlan, String segId) {
-        INeutronNetworkCRUD iNeutronNetworkCRUD =
-                (INeutronNetworkCRUD) ServiceHelper.getGlobalInstance(INeutronNetworkCRUD.class, this);
-        NeutronNetwork nn = new NeutronNetwork();
-        nn.setID(uuid);
-        nn.initDefaults();
-        nn.setTenantID(tenantID);
-        nn.setProviderNetworkType(networkTypeVxlan);
-        nn.setProviderSegmentationID(segId);
-        iNeutronNetworkCRUD.addNetwork(nn);
-        return nn;
-    }
-}