You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Trevor Flanagan <no...@github.com> on 2018/10/04 11:56:03 UTC

[jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

I have removed the reliance on pre-seeded servers, images, networks and vlans and instead the tests will setup and importantly clear down what they create.

The tests will now be run with the following
```
mvn clean install -Plive -pl dimensiondata -Dtest.dimensiondata-cloudcontrol.identity=apache_jclouds -Dtest.dimensiondata-cloudcontrol.credential=XXXXXXX -Dtest.dimensiondata-cloudcontrol.endpoint=https://api-au.dimensiondata.com -Djclou 
ds.compute.timeout.node-terminated=1800000 -Djclouds.compute.timeout.node-suspended=1800000 -Djclouds.regions=au -Djclouds.region.au.zones=AU9
```
I would like to remove the dependence on passing the region and zone, and would like advice on how we might do that. I know that using the endpoint we could parse out the region. Any tips on this would be useful.
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs/pull/446

-- Commit Summary --

  * JCLOUDS-1431 - Support AU geo for Live Tests
  * JCLOUDS-1431 - Support AU geo for Live Tests
  * JCLOUDS-1431 - Support AU geo for Live Tests
  * JCLOUDS-1431 - Support AU geo for Live Tests

-- File Changes --

    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/DimensionDataCloudControlApi.java (4)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/DimensionDataCloudControlApiMetadata.java (2)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/DimensionDataCloudControlProviderMetadata.java (3)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/config/DimensionDataCloudControlComputeServiceContextModule.java (31)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/CustomerImage.java (6)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OsImage.java (2)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/AccountApi.java (2)
    A dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/CustomerImageApi.java (47)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/InfrastructureApi.java (2)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/NetworkApi.java (2)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/ServerApi.java (2)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/ServerImageApi.java (2)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/features/TagApi.java (2)
    M dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/filters/OrganisationIdFilter.java (1)
    M dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/compute/functions/BaseImageToHardwareTest.java (3)
    A dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/features/CustomerImageApiMockTest.java (43)
    M dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/features/NetworkApiLiveTest.java (69)
    M dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/features/ServerApiLiveTest.java (214)
    M dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/features/ServerImageApiLiveTest.java (23)
    M dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/features/TagApiLiveTest.java (43)
    M dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/internal/BaseDimensionDataCloudControlApiLiveTest.java (31)
    M dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/internal/BaseDimensionDataCloudControlMockTest.java (2)
    M dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/parse/CustomerImagesParseTest.java (3)

-- Patch Links --

https://github.com/jclouds/jclouds-labs/pull/446.patch
https://github.com/jclouds/jclouds-labs/pull/446.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
@trevorflanagan pushed 1 commit.

315b896  JCLOUDS-1431 - Support AU geo for Live Tests.


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446/files/11cf5137239fa8177a79be948c3b7dc4757bce6e..315b8965e221bbd8463a4b12e1a966f49af1429a

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
trevorflanagan commented on this pull request.



> @@ -89,8 +89,17 @@ public void setUp() {
       datacenters = getZones();
    }
 
+   //   private Set<String> getZones() {
+   //      return ctx.utils().injector().getInstance(ZoneIdsSupplier.class).get();
+   //   }
+
+   // TODO this leads to a warning - WARNING: failed to find key for value https://api-na.dimensiondata.com in {au=https://api-au.dimensiondata.com}; choosing first: au

Thanks @nacx I will send that mail.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#discussion_r226424580

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
trevorflanagan commented on this pull request.



>        assertNotNull(cloneImageId);
       assertTrue(serverNormalPredicate.apply(serverId), "server was not NORMAL after timeout");
    }
 
+   @Test(dependsOnMethods = "testCloneServerToMakeCustomerImage")
+   public void testListCustomerImages() {
+      FluentIterable<CustomerImage> customerImages = api.getServerImageApi().listCustomerImages().concat();
+      assertNotNull(customerImages);
+      for (CustomerImage customerImage : customerImages) {
+         assertNotNull(customerImage);
+      }

Change made as requested.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#discussion_r226429146

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Ignasi Barrera <no...@github.com>.
nacx commented on this pull request.



> +import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.MapBinder;
+import org.jclouds.rest.annotations.PayloadParam;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.binders.BindToJsonPayload;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@RequestFilters({ BasicAuthentication.class, OrganisationIdFilter.class })
+@Consumes(MediaType.APPLICATION_JSON)
+@Path("/caas/2.7/image")

This version differs from the base api version defined for the provider. Could we bump it and use the same version everywhere?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#pullrequestreview-166416885

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
trevorflanagan commented on this pull request.



> +import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@RequestFilters({ BasicAuthentication.class, OrganisationIdFilter.class })
+@Consumes(MediaType.APPLICATION_JSON)
+@Path("/caas/2.7/image")
+public interface CustomerImageApi {
+
+   @Named("image:deleteCustomerImage")
+   @POST
+   @Path("/deleteCustomerImage")
+   @Produces(MediaType.APPLICATION_JSON)
+   @MapBinder(BindToJsonPayload.class)
+   @Fallback(Fallbacks.VoidOnNotFoundOr404.class)
+   void deleteCustomerImage(@PayloadParam("id") String id);

Change made as requested.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#discussion_r226429245

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Ignasi Barrera <no...@github.com>.
Squashed and merged to [master](http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/85c46b82) and [2.1.x](http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/f7b8c2ca). Thx!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#issuecomment-431293328

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
Commits squashed in advance merge.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#issuecomment-431126798

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
trevorflanagan commented on this pull request.



> @@ -54,7 +54,7 @@ protected Builder() {
          id("dimensiondata-cloudcontrol").name("DimensionData CloudControl API").identityName("user name")
                .credentialName("user password")
                .documentation(URI.create("http://www.dimensiondata.com/en-US/Solutions/Cloud"))
-               .defaultEndpoint("https://api-REGION.dimensiondata.com/caas").version("2.4")
+               .defaultEndpoint("https://api-REGION.dimensiondata.com").version("2.4")

I have removed the reliance on caas being part of the configuration and instead hide that within the Path annotation in the API classes.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#pullrequestreview-161571933

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
I have re-based onto master.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#issuecomment-431126111

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
trevorflanagan commented on this pull request.



> @@ -89,8 +89,17 @@ public void setUp() {
       datacenters = getZones();
    }
 
+   //   private Set<String> getZones() {
+   //      return ctx.utils().injector().getInstance(ZoneIdsSupplier.class).get();
+   //   }
+
+   // TODO this leads to a warning - WARNING: failed to find key for value https://api-na.dimensiondata.com in {au=https://api-au.dimensiondata.com}; choosing first: au

Would like some help with this TODO if possible.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#pullrequestreview-161572784

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
trevorflanagan commented on this pull request.



>     }
 
-   private void applyTagToAsset() {

I am doing this test in the ServerApiLiveTest now

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#pullrequestreview-161572519

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Ignasi Barrera <no...@github.com>.
nacx commented on this pull request.



>        assertNotNull(cloneImageId);
       assertTrue(serverNormalPredicate.apply(serverId), "server was not NORMAL after timeout");
    }
 
+   @Test(dependsOnMethods = "testCloneServerToMakeCustomerImage")
+   public void testListCustomerImages() {
+      FluentIterable<CustomerImage> customerImages = api.getServerImageApi().listCustomerImages().concat();
+      assertNotNull(customerImages);
+      customerImages.anyMatch(new Predicate<CustomerImage>() {

`assertTrue(customerImages.anyMatch(new Predicate<CustomerImage>() {`

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#pullrequestreview-166417109

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
trevorflanagan commented on this pull request.



>        assertNotNull(cloneImageId);
       assertTrue(serverNormalPredicate.apply(serverId), "server was not NORMAL after timeout");
    }
 
+   @Test(dependsOnMethods = "testCloneServerToMakeCustomerImage")
+   public void testListCustomerImages() {
+      FluentIterable<CustomerImage> customerImages = api.getServerImageApi().listCustomerImages().concat();
+      assertNotNull(customerImages);
+      customerImages.anyMatch(new Predicate<CustomerImage>() {

Thanks for spotting that one! Not much point in having the predicate without the assertion.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#discussion_r226566609

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
rebuild please

appears to be a failure unrelated to my changes on jenkins

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#issuecomment-427003272

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Ignasi Barrera <no...@github.com>.
nacx approved this pull request.

Just a couple minors. Will merge once addressed.

> +import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@RequestFilters({ BasicAuthentication.class, OrganisationIdFilter.class })
+@Consumes(MediaType.APPLICATION_JSON)
+@Path("/caas/2.7/image")
+public interface CustomerImageApi {
+
+   @Named("image:deleteCustomerImage")
+   @POST
+   @Path("/deleteCustomerImage")
+   @Produces(MediaType.APPLICATION_JSON)
+   @MapBinder(BindToJsonPayload.class)
+   @Fallback(Fallbacks.VoidOnNotFoundOr404.class)
+   void deleteCustomerImage(@PayloadParam("id") String id);

Usually better to return a boolean, and use the return false fallback.

>        assertNotNull(cloneImageId);
       assertTrue(serverNormalPredicate.apply(serverId), "server was not NORMAL after timeout");
    }
 
+   @Test(dependsOnMethods = "testCloneServerToMakeCustomerImage")
+   public void testListCustomerImages() {
+      FluentIterable<CustomerImage> customerImages = api.getServerImageApi().listCustomerImages().concat();
+      assertNotNull(customerImages);
+      for (CustomerImage customerImage : customerImages) {
+         assertNotNull(customerImage);
+      }

Instead of asserting not null, let's better just check if the image we're interested in is in the list.

> @@ -89,8 +89,17 @@ public void setUp() {
       datacenters = getZones();
    }
 
+   //   private Set<String> getZones() {
+   //      return ctx.utils().injector().getInstance(ZoneIdsSupplier.class).get();
+   //   }
+
+   // TODO this leads to a warning - WARNING: failed to find key for value https://api-na.dimensiondata.com in {au=https://api-au.dimensiondata.com}; choosing first: au

Can you send an email to the dev@ mailing list with the details of what you are trying to achieve, the current config, and the failure? Just to have the whole context outside this PR and we can help properly.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#pullrequestreview-166008822

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Ignasi Barrera <no...@github.com>.
Closed #446.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#event-1914224442

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
trevorflanagan commented on this pull request.



> +import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.MapBinder;
+import org.jclouds.rest.annotations.PayloadParam;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.binders.BindToJsonPayload;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@RequestFilters({ BasicAuthentication.class, OrganisationIdFilter.class })
+@Consumes(MediaType.APPLICATION_JSON)
+@Path("/caas/2.7/image")

We are attempting to incrementally move towards 2.7 and have PR open for updating ServerAPI (https://github.com/jclouds/jclouds-labs/pull/447). We have significant model changes to handle in order to get there. We are also working on `org.jclouds.dimensiondata.cloudcontrol.features.ServerImageApi` but that is internally under review at the moment.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#discussion_r226565773

Re: [jclouds/jclouds-labs] JCLOUDS-1431 - Support AU geo for Live Tests (#446)

Posted by Trevor Flanagan <no...@github.com>.
trevorflanagan commented on this pull request.



> @@ -45,4 +46,7 @@
 
    @Delegate
    TagApi getTagApi();
+
+   @Delegate
+   CustomerImageApi getCustomerImageApi();

A new API added as part of this so that we can delete the image we create when we test the clone api.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/446#pullrequestreview-161571599