<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>
<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>
<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>
<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>
</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>
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;
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;
}
}
- 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
</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>
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;
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;
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;
}
}
- 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());
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;
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);
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());
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);
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 (
}
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));
- }
}
<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>
</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>
<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>
</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>
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;
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";
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);
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();
}
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");
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());
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... ");
*/
@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;
}
@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;
}
*/
@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));
}
*/
@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));
}
--- /dev/null
+{
+ "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
+++ /dev/null
-/*
- * 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;
- }
-}
+++ /dev/null
-/*
- * 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);
- }
-
-}
<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>
<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>
<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>
* 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() {
--- /dev/null
+/*
+ * 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;
+ }
+}
</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>