diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateClientLiveTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateClientLiveTest.java index 11a48e002b..e4ca89d875 100644 --- a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateClientLiveTest.java +++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateClientLiveTest.java @@ -44,9 +44,10 @@ import static org.testng.Assert.*; @Test(groups = "live", singleThreaded = true, testName = "TemplateClientLiveTest") public class TemplateClientLiveTest extends BaseCloudStackClientLiveTest { - private static final String IMPORT_VHD_URL = "http://www.frontiertown.co.uk/jclouds/openwrt.vhd"; + private static final String IMPORT_VHD_URL = "http://www.frontiertown.co.uk/jclouds/empty.vhd"; private VirtualMachine vm; - private Template template; + private Template createdTemplate; + private Template registeredTemplate; @Test public void testListTemplates() throws Exception { @@ -110,17 +111,17 @@ public class TemplateClientLiveTest extends BaseCloudStackClientLiveTest { CreateTemplateOptions options = CreateTemplateOptions.Builder.volumeId(volume.getId()); AsyncCreateResponse response = client.getTemplateClient().createTemplate(TemplateMetadata.builder().name(tmplName).osTypeId(vm.getGuestOSId()).displayText("jclouds live testCreateTemplate").build(), options); assert jobComplete.apply(response.getJobId()) : vm; - template = client.getTemplateClient().getTemplateInZone(response.getId(), vm.getZoneId()); + createdTemplate = client.getTemplateClient().getTemplateInZone(response.getId(), vm.getZoneId()); // Assertions - assertNotNull(template); + assertNotNull(createdTemplate); } - @Test(enabled = true, dependsOnMethods = "testCreateTemplate") + @Test(enabled = true, dependsOnMethods = "testRegisterTemplate") public void testExtractTemplate() throws Exception { // Initiate the extraction and wait for it to complete - AsyncCreateResponse response = client.getTemplateClient().extractTemplate(template.getId(), ExtractMode.HTTP_DOWNLOAD, template.getZoneId()); - assert jobComplete.apply(response.getJobId()) : template; + AsyncCreateResponse response = client.getTemplateClient().extractTemplate(registeredTemplate.getId(), ExtractMode.HTTP_DOWNLOAD, registeredTemplate.getZoneId()); + assert jobComplete.apply(response.getJobId()) : registeredTemplate; // Get the result AsyncJob asyncJob = client.getAsyncJobClient().getAsyncJob(response.getJobId()); @@ -153,11 +154,11 @@ public class TemplateClientLiveTest extends BaseCloudStackClientLiveTest { // Register a template String tmplName = "jclouds-" + Integer.toHexString(new Random().nextInt()); - RegisterTemplateOptions options = RegisterTemplateOptions.Builder.bits(32); + RegisterTemplateOptions options = RegisterTemplateOptions.Builder.bits(32).isExtractable(true); TemplateMetadata templateMetadata = TemplateMetadata.builder().name(tmplName).osTypeId(osType.getId()).displayText("jclouds live testRegisterTemplate").build(); - Set