You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pp...@apache.org on 2021/03/24 21:04:11 UTC
[camel-quarkus] branch master updated: openstack: added neutron
port, subnet and nova flavor tests #1943
This is an automated email from the ASF dual-hosted git repository.
ppalaga pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/master by this push:
new b90b5f8 openstack: added neutron port, subnet and nova flavor tests #1943
b90b5f8 is described below
commit b90b5f80b3d079effefc58736e33995215146bdc
Author: aldettinger <al...@gmail.com>
AuthorDate: Wed Mar 24 18:50:02 2021 +0100
openstack: added neutron port, subnet and nova flavor tests #1943
---
.../openstack/it/OpenstackNeutronPortResource.java | 83 ++++++++++++++++
.../it/OpenstackNeutronSubnetResource.java | 66 +++++++++++++
.../openstack/it/OpenstackNovaFlavorResource.java | 106 +++++++++++++++++++++
.../component/openstack/it/OpenstackResource.java | 40 +-------
.../openstack/it/OpenstackNeutronPortTest.java | 38 ++++++++
.../openstack/it/OpenstackNeutronSubnetTest.java | 33 +++++++
.../openstack/it/OpenstackNovaFlavorTest.java | 44 +++++++++
.../component/openstack/it/OpenstackTest.java | 24 -----
.../mappings/neutron/ports/port_external.json | 18 ++++
.../mappings/neutron/ports/ports_external.json | 22 +++++
.../mappings/neutron/subnets/subnet_ipv6.json | 18 ++++
.../resources/mappings/nova/flavors/flavor.json | 18 ++++
.../mappings/nova/flavors/flavor_create.json | 18 ++++
.../mappings/nova/flavors/flavors_detailed.json | 22 +++++
14 files changed, 487 insertions(+), 63 deletions(-)
diff --git a/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronPortResource.java b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronPortResource.java
new file mode 100644
index 0000000..274f07b
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronPortResource.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.openstack.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.neutron.NeutronConstants;
+import org.jboss.logging.Logger;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.network.AllowedAddressPair;
+import org.openstack4j.model.network.Port;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+@Path("/openstack/neutron/ports/")
+@ApplicationScoped
+public class OpenstackNeutronPortResource {
+
+ private static final Logger LOG = Logger.getLogger(OpenstackNeutronPortResource.class);
+
+ private static final String URI_FORMAT = "openstack-neutron://{{camel.openstack.test.host-url}}?username=user&password=secret&project=project&operation=%s&subsystem="
+ + NeutronConstants.NEUTRON_PORT_SYSTEM;
+
+ private static final String NETWORK_ID = "a87cc70a-3e15-4acf-8205-9b711a3531b7";
+
+ @Inject
+ ProducerTemplate template;
+
+ @Path("/createShouldSucceed")
+ @POST
+ public void createShouldSucceed() {
+ LOG.debug("Calling OpenstackNeutronPortResource.createShouldSucceed()");
+
+ Port in = Builders.port().networkId(NETWORK_ID).build();
+
+ String uri = String.format(URI_FORMAT, OpenstackConstants.CREATE);
+ Port out = template.requestBody(uri, in, Port.class);
+
+ assertNotNull(out);
+ assertEquals(NETWORK_ID, out.getNetworkId());
+ assertNotNull(out.getAllowedAddressPairs());
+ assertEquals(1, out.getAllowedAddressPairs().size());
+ AllowedAddressPair allowedAddressPair = out.getAllowedAddressPairs().iterator().next();
+ assertNotNull(allowedAddressPair.getIpAddress());
+ assertNotNull(allowedAddressPair.getMacAddress());
+ }
+
+ @Path("/getAllShouldSucceed")
+ @POST
+ public void getAllShouldSucceed() {
+ LOG.debug("Calling OpenstackNeutronPortResource.getAllShouldSucceed()");
+
+ String uri = String.format(URI_FORMAT, OpenstackConstants.GET_ALL);
+ Port[] ports = template.requestBody(uri, null, Port[].class);
+
+ assertNotNull(ports);
+ assertEquals(2, ports.length);
+ assertEquals(NETWORK_ID, ports[0].getNetworkId());
+ assertEquals("94225baa-9d3f-4b93-bf12-b41e7ce49cdb", ports[0].getId());
+ assertEquals(NETWORK_ID, ports[1].getNetworkId());
+ assertEquals("235b09e0-63c4-47f1-b221-66ba54c21760", ports[1].getId());
+ }
+}
diff --git a/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronSubnetResource.java b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronSubnetResource.java
new file mode 100644
index 0000000..1dc171e
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronSubnetResource.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.openstack.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.neutron.NeutronConstants;
+import org.jboss.logging.Logger;
+import org.openstack4j.model.network.Ipv6AddressMode;
+import org.openstack4j.model.network.Ipv6RaMode;
+import org.openstack4j.model.network.Subnet;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@Path("/openstack/neutron/subnets/")
+@ApplicationScoped
+public class OpenstackNeutronSubnetResource {
+
+ private static final Logger LOG = Logger.getLogger(OpenstackNeutronSubnetResource.class);
+
+ private static final String URI_FORMAT = "openstack-neutron://{{camel.openstack.test.host-url}}?username=user&password=secret&project=project&operation=%s&subsystem="
+ + NeutronConstants.NEUTRON_SUBNETS_SYSTEM;
+
+ private static final String SUBNET_NAME = "sub1";
+ private static final String SUBNET_ID = "3b80198d-4f7b-4f77-9ef5-774d54e17126";
+
+ @Inject
+ ProducerTemplate template;
+
+ @Path("/getShouldSucceed")
+ @POST
+ public void getShouldSucceed() {
+ LOG.debug("Calling OpenstackNeutronSubnetResource.getShouldSucceed()");
+
+ String uri = String.format(URI_FORMAT, OpenstackConstants.GET);
+ Subnet out = template.requestBodyAndHeader(uri, null, OpenstackConstants.ID, SUBNET_ID, Subnet.class);
+
+ assertNotNull(out);
+ assertEquals(SUBNET_NAME, out.getName());
+ assertEquals(Ipv6AddressMode.DHCPV6_STATEFUL, out.getIpv6AddressMode());
+ assertEquals(Ipv6RaMode.DHCPV6_STATEFUL, out.getIpv6RaMode());
+ assertNotNull(out.getDnsNames());
+ assertTrue(out.getDnsNames().isEmpty());
+ }
+}
diff --git a/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNovaFlavorResource.java b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNovaFlavorResource.java
new file mode 100644
index 0000000..683ce27
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNovaFlavorResource.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.openstack.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.nova.NovaConstants;
+import org.jboss.logging.Logger;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.compute.Flavor;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@Path("/openstack/nova/flavors/")
+@ApplicationScoped
+public class OpenstackNovaFlavorResource {
+
+ private static final Logger LOG = Logger.getLogger(OpenstackNovaFlavorResource.class);
+
+ private static final String URI_FORMAT = "openstack-nova://{{camel.openstack.test.host-url}}?username=user&password=secret&project=project&operation=%s&subsystem="
+ + NovaConstants.NOVA_SUBSYSTEM_FLAVORS;
+
+ private static final String FLAVOR_ID = "1";
+ private static final String FLAVOR_NAME = "m1.tiny";
+
+ @Inject
+ ProducerTemplate template;
+
+ @Path("/createShouldSucceed")
+ @POST
+ public void createShouldSucceed() {
+ LOG.debug("Calling OpenstackNovaFlavorResource.createShouldSucceed()");
+
+ Flavor in = Builders.flavor().name("safe_to_delete_flavor").vcpus(1).disk(2).isPublic(true).rxtxFactor(2.0f)
+ .ephemeral(1)
+ .ram(128).id("delete_1").swap(1).build();
+
+ String uri = String.format(URI_FORMAT, OpenstackConstants.CREATE);
+ Flavor out = template.requestBody(uri, in, Flavor.class);
+
+ assertNotNull(out);
+ assertEquals(1, out.getVcpus());
+ assertEquals(2, out.getDisk());
+ assertEquals(FLAVOR_NAME, out.getName());
+ assertTrue(out.isPublic());
+ assertEquals(2.0f, out.getRxtxFactor());
+ assertEquals(1, out.getEphemeral());
+ assertEquals(128, out.getRam());
+ assertEquals(FLAVOR_ID, out.getId());
+ assertEquals(1, out.getSwap());
+ }
+
+ @Path("/getShouldSucceed")
+ @POST
+ public void getShouldSucceed() {
+ LOG.debug("Calling OpenstackNovaFlavorResource.getShouldSucceed()");
+
+ String uri = String.format(URI_FORMAT, OpenstackConstants.GET);
+ Flavor out = template.requestBodyAndHeader(uri, null, OpenstackConstants.ID, FLAVOR_ID, Flavor.class);
+
+ assertNotNull(out);
+ assertEquals(1, out.getDisk());
+ assertEquals(FLAVOR_NAME, out.getName());
+ assertEquals(512, out.getRam());
+ assertTrue(out.isPublic());
+ assertEquals(0, out.getEphemeral());
+ assertFalse(out.isDisabled());
+ assertEquals(2.0f, out.getRxtxFactor());
+ assertEquals(1, out.getVcpus());
+ }
+
+ @Path("/getAllShouldSucceed")
+ @POST
+ public void getAllShouldSucceed() {
+ LOG.debug("Calling OpenstackNovaFlavorResource.getAllShouldSucceed()");
+
+ String uri = String.format(URI_FORMAT, OpenstackConstants.GET_ALL);
+ Flavor[] flavors = template.requestBody(uri, null, Flavor[].class);
+
+ assertNotNull(flavors);
+ assertEquals(2, flavors.length);
+ }
+
+}
diff --git a/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackResource.java b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackResource.java
index 50c04a6..4e661db 100644
--- a/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackResource.java
+++ b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackResource.java
@@ -33,50 +33,12 @@ public class OpenstackResource {
private static final Logger LOG = Logger.getLogger(OpenstackResource.class);
- private static final String COMPONENT_OPENSTACK_GLANCE = "openstack-glance";
- private static final String COMPONENT_OPENSTACK_KEYSTONE = "openstack-keystone";
- private static final String COMPONENT_OPENSTACK_NEUTRON = "openstack-neutron";
private static final String COMPONENT_OPENSTACK_NOVA = "openstack-nova";
private static final String COMPONENT_OPENSTACK_SWIFT = "openstack-swift";
+
@Inject
CamelContext context;
- @Path("/load/component/openstack-glance")
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- public Response loadComponentOpenstackGlance() throws Exception {
- /* This is an autogenerated test */
- if (context.getComponent(COMPONENT_OPENSTACK_GLANCE) != null) {
- return Response.ok().build();
- }
- LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_OPENSTACK_GLANCE);
- return Response.status(500, COMPONENT_OPENSTACK_GLANCE + " could not be loaded from the Camel context").build();
- }
-
- @Path("/load/component/openstack-keystone")
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- public Response loadComponentOpenstackKeystone() throws Exception {
- /* This is an autogenerated test */
- if (context.getComponent(COMPONENT_OPENSTACK_KEYSTONE) != null) {
- return Response.ok().build();
- }
- LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_OPENSTACK_KEYSTONE);
- return Response.status(500, COMPONENT_OPENSTACK_KEYSTONE + " could not be loaded from the Camel context").build();
- }
-
- @Path("/load/component/openstack-neutron")
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- public Response loadComponentOpenstackNeutron() throws Exception {
- /* This is an autogenerated test */
- if (context.getComponent(COMPONENT_OPENSTACK_NEUTRON) != null) {
- return Response.ok().build();
- }
- LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_OPENSTACK_NEUTRON);
- return Response.status(500, COMPONENT_OPENSTACK_NEUTRON + " could not be loaded from the Camel context").build();
- }
-
@Path("/load/component/openstack-nova")
@GET
@Produces(MediaType.TEXT_PLAIN)
diff --git a/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronPortTest.java b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronPortTest.java
new file mode 100644
index 0000000..28e2c39
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronPortTest.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.openstack.it;
+
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.Test;
+
+import static io.restassured.RestAssured.post;
+
+@QuarkusTest
+@QuarkusTestResource(OpenStackTestResource.class)
+class OpenstackNeutronPortTest {
+
+ @Test
+ public void createShouldSucceed() {
+ post("/openstack/neutron/ports/createShouldSucceed").then().statusCode(204);
+ }
+
+ @Test
+ public void getAllShouldSucceed() {
+ post("/openstack/neutron/ports/getAllShouldSucceed").then().statusCode(204);
+ }
+}
diff --git a/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronSubnetTest.java b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronSubnetTest.java
new file mode 100644
index 0000000..220e8df
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNeutronSubnetTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.openstack.it;
+
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.Test;
+
+import static io.restassured.RestAssured.post;
+
+@QuarkusTest
+@QuarkusTestResource(OpenStackTestResource.class)
+class OpenstackNeutronSubnetTest {
+
+ @Test
+ public void getShouldSucceed() {
+ post("/openstack/neutron/subnets/getShouldSucceed").then().statusCode(204);
+ }
+}
diff --git a/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNovaFlavorTest.java b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNovaFlavorTest.java
new file mode 100644
index 0000000..f5d708e
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackNovaFlavorTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.openstack.it;
+
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.Test;
+
+import static io.restassured.RestAssured.post;
+
+@QuarkusTest
+@QuarkusTestResource(OpenStackTestResource.class)
+class OpenstackNovaFlavorTest {
+
+ @Test
+ public void createShouldSucceed() {
+ post("/openstack/nova/flavors/createShouldSucceed").then().statusCode(204);
+ }
+
+ @Test
+ public void getShouldSucceed() {
+ post("/openstack/nova/flavors/getShouldSucceed").then().statusCode(204);
+ }
+
+ @Test
+ public void getAllShouldSucceed() {
+ post("/openstack/nova/flavors/getAllShouldSucceed").then().statusCode(204);
+ }
+
+}
diff --git a/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackTest.java b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackTest.java
index 30301a1..1a425d7 100644
--- a/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackTest.java
+++ b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackTest.java
@@ -24,30 +24,6 @@ import org.junit.jupiter.api.Test;
class OpenstackTest {
@Test
- public void loadComponentOpenstackGlance() {
- /* A simple autogenerated test */
- RestAssured.get("/openstack/load/component/openstack-glance")
- .then()
- .statusCode(200);
- }
-
- @Test
- public void loadComponentOpenstackKeystone() {
- /* A simple autogenerated test */
- RestAssured.get("/openstack/load/component/openstack-keystone")
- .then()
- .statusCode(200);
- }
-
- @Test
- public void loadComponentOpenstackNeutron() {
- /* A simple autogenerated test */
- RestAssured.get("/openstack/load/component/openstack-neutron")
- .then()
- .statusCode(200);
- }
-
- @Test
public void loadComponentOpenstackNova() {
/* A simple autogenerated test */
RestAssured.get("/openstack/load/component/openstack-nova")
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/neutron/ports/port_external.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/neutron/ports/port_external.json
new file mode 100644
index 0000000..ed34646
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/neutron/ports/port_external.json
@@ -0,0 +1,18 @@
+{
+ "id" : "a0f01c14-436c-423c-bb68-8f4314a5cf77",
+ "name" : "port_external.json",
+ "request" : {
+ "url" : "/v2.0/ports",
+ "method" : "POST"
+ },
+ "response" : {
+ "body" : "{\"port\":{\"network_id\":\"a87cc70a-3e15-4acf-8205-9b711a3531b7\",\"binding:host_id\":\"4df8d9ff-6f6f-438f-90a1-ef660d4586ad\",\"binding:profile\":{\"local_link_information\":[{\"port_id\":\"Ethernet3\/1\",\"switch_id\":\"0a:1b:2c:3d:4e:5f\",\"switch_info\":\"switch1\"}]},\"binding:vnic_type\":\"baremetal\",\"device_id\":\"d90a13da-be41-461f-9f99-1dbcf438fdf2\",\"device_owner\":\"baremetal:none\",\"allowed_address_pairs\":[{\"ip_address\":\"192.168.0.100\",\"mac_address\": [...]
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 201
+ },
+ "uuid" : "a0f01c14-436c-423c-bb68-8f4314a5cf77",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/neutron/ports/ports_external.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/neutron/ports/ports_external.json
new file mode 100644
index 0000000..97425e0
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/neutron/ports/ports_external.json
@@ -0,0 +1,22 @@
+{
+ "id" : "f57e2ac3-7897-424f-bde5-85bf1f961bcb",
+ "name" : "ports_external.json",
+ "request" : {
+ "url" : "/v2.0/ports",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" : "{\"ports\":[{\"admin_state_up\":false,\"data_plane_status\":null,\"description\":\"\",\"device_id\":\"\",\"device_owner\":\"\",\"fixed_ips\":[{\"ip_address\":\"10.0.0.5\",\"subnet_id\":\"a0304c3a-4f08-4c43-88af-d796509c97d2\"}],\"allowed_address_pairs\":[{\"ip_address\":\"192.168.0.100\",\"mac_address\":\"00:60:2f:38:62:8d\"}],\"id\":\"94225baa-9d3f-4b93-bf12-b41e7ce49cdb\",\"mac_address\":\"fa:16:3e:48:b8:9f\",\"name\":\"sample_port_1\",\"network_id\":\"a87cc70a-3e15-4acf- [...]
+ "headers" : {
+ "Content-Type": "application/json",
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-55376b13-eb5b-47cc-baac-7b8fe7bc00a3"
+ },
+ "status" : 200
+ },
+ "uuid" : "f57e2ac3-7897-424f-bde5-85bf1f961bcb",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/neutron/subnets/subnet_ipv6.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/neutron/subnets/subnet_ipv6.json
new file mode 100644
index 0000000..e1e38bd
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/neutron/subnets/subnet_ipv6.json
@@ -0,0 +1,18 @@
+{
+ "id" : "b6ace88f-27a9-4459-8add-5b67a6f5939f",
+ "name" : "subnet_ipv6.json",
+ "request" : {
+ "url" : "/v2.0/subnets/3b80198d-4f7b-4f77-9ef5-774d54e17126",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" : "{\"subnet\":{\"name\":\"sub1\",\"enable_dhcp\":true,\"network_id\":\"d32019d3-bc6e-4319-9c1d-6722fc136a22\",\"segment_id\":null,\"project_id\":\"4fd44f30292945e481c7b8a0c8908869\",\"tenant_id\":\"4fd44f30292945e481c7b8a0c8908869\",\"dns_nameservers\":[],\"allocation_pools\":[{\"start\":\"2620:0:2d0:200::2\",\"end\":\"2620:0:2d0:200:ffff:ffff:ffff:fffe\"}],\"host_routes\":[],\"ip_version\":6,\"gateway_ip\":\"2620:0:2d0:200::1\",\"cidr\":\"2620:0:2d0:200::\/64\",\"id\":\"3b80 [...]
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "b6ace88f-27a9-4459-8add-5b67a6f5939f",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/nova/flavors/flavor.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/nova/flavors/flavor.json
new file mode 100644
index 0000000..745e7b2
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/nova/flavors/flavor.json
@@ -0,0 +1,18 @@
+{
+ "id" : "248a9292-e129-4dbf-b83b-33f62e78d0d0",
+ "name" : "flavor.json",
+ "request" : {
+ "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/flavors/1",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" : "{\"flavor\":{\"disk\":1,\"id\":\"1\",\"links\":[{\"href\":\"http:\/\/openstack.example.com\/v2\/openstack\/flavors\/1\",\"rel\":\"self\"},{\"href\":\"http:\/\/openstack.example.com\/openstack\/flavors\/1\",\"rel\":\"bookmark\"}],\"name\":\"m1.tiny\",\"ram\":512,\"os-flavor-access:is_public\":true,\"OS-FLV-EXT-DATA:ephemeral\":0,\"OS-FLV-DISABLED:disabled\":false,\"rxtx_factor\":2,\"vcpus\":1}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "248a9292-e129-4dbf-b83b-33f62e78d0d0",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/nova/flavors/flavor_create.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/nova/flavors/flavor_create.json
new file mode 100644
index 0000000..695e117
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/nova/flavors/flavor_create.json
@@ -0,0 +1,18 @@
+{
+ "id" : "2c009df7-b577-4fc6-94ca-0309f623f945",
+ "name" : "flavor_create.json",
+ "request" : {
+ "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/flavors",
+ "method" : "POST"
+ },
+ "response" : {
+ "body" : "{\"flavor\":{\"vcpus\":1,\"disk\":2,\"name\":\"m1.tiny\",\"os-flavor-access:is_public\":true,\"rxtx_factor\":2,\"OS-FLV-EXT-DATA:ephemeral\":1,\"ram\":128,\"id\":\"1\",\"swap\":1}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 201
+ },
+ "uuid" : "2c009df7-b577-4fc6-94ca-0309f623f945",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/nova/flavors/flavors_detailed.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/nova/flavors/flavors_detailed.json
new file mode 100644
index 0000000..d9e99f4
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/nova/flavors/flavors_detailed.json
@@ -0,0 +1,22 @@
+{
+ "id" : "d12f65db-167e-4460-842b-e416ca93971c",
+ "name" : "flavors_detailed.json",
+ "request" : {
+ "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/flavors/detail",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" : "{\"flavors\":[{\"name\":\"m1.nano\",\"links\":[{\"href\":\"http:\/\/openstack.example.com:8774\/v2.1\/8fd2b4f2b5cf4fa184e5c3c5020408c7\/flavors\/0\",\"rel\":\"self\"},{\"href\":\"http:\/\/openstack.example.com:8774\/8fd2b4f2b5cf4fa184e5c3c5020408c7\/flavors\/0\",\"rel\":\"bookmark\"}],\"ram\":64,\"OS-FLV-DISABLED:disabled\":false,\"vcpus\":1,\"swap\":\"\",\"os-flavor-access:is_public\":true,\"rxtx_factor\":1,\"OS-FLV-EXT-DATA:ephemeral\":0,\"disk\":1,\"id\":\"0\"},{\"name\" [...]
+ "headers" : {
+ "Content-Type": "application/json",
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-243415fd-ddf2-428c-a3d9-e9a77f54ef97"
+ },
+ "status" : 200
+ },
+ "uuid" : "d12f65db-167e-4460-842b-e416ca93971c",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file