diff --git a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/MastersCache.java b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/MastersCache.java index ea8a4e0864..bd909bdcce 100644 --- a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/MastersCache.java +++ b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/MastersCache.java @@ -73,7 +73,6 @@ public class MastersCache extends AbstractLoadingCache { private final Function masterCreatorAndInstaller; private final Map imageMapping; private final String workingDir; - private final String adminDisk; private final String guestAdditionsIso; private final String installationKeySequence; private final String isosDir; @@ -96,7 +95,6 @@ public class MastersCache extends AbstractLoadingCache { wdFile.mkdirs(); } this.isosDir = wdFile.getAbsolutePath() + File.separator + "isos"; - this.adminDisk = workingDir + "/testadmin.vdi"; this.imageMapping = Maps.newLinkedHashMap(); for (Entry entry : yamlMapper.get().entrySet()) { this.imageMapping.put(entry.getKey().getId(), entry.getValue()); @@ -123,6 +121,8 @@ public class MastersCache extends AbstractLoadingCache { String vmName = VIRTUALBOX_IMAGE_PREFIX + yamlImage.id; + String adminDisk = workingDir + File.separator + vmName + ".vdi"; + HardDisk hardDisk = HardDisk.builder().diskpath(adminDisk).autoDelete(true).controllerPort(0).deviceSlot(1) .build(); diff --git a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/NodeCreator.java b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/NodeCreator.java index d9a089eb00..5388a735f0 100644 --- a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/NodeCreator.java +++ b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/NodeCreator.java @@ -1,5 +1,5 @@ /** - * Licensed to jclouds, Inc. (jclouds) under one or more +mh * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. jclouds licenses this file diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/BaseVirtualBoxClientLiveTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/BaseVirtualBoxClientLiveTest.java index 206fedf97c..586b879798 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/BaseVirtualBoxClientLiveTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/BaseVirtualBoxClientLiveTest.java @@ -79,7 +79,6 @@ public class BaseVirtualBoxClientLiveTest extends BaseVersionedServiceLiveTest { protected String hostVersion; protected String operatingSystemIso; protected String guestAdditionsIso; - protected String adminDisk; protected String workingDir; protected String isosDir; protected Supplier host; @@ -144,7 +143,6 @@ public class BaseVirtualBoxClientLiveTest extends BaseVersionedServiceLiveTest { machineUtils = context.utils().injector().getInstance(MachineUtils.class); hostVersion = Iterables.get(Splitter.on('r').split(context.getProviderSpecificContext().getBuildVersion()), 0); - adminDisk = workingDir + "/testadmin.vdi"; operatingSystemIso = String.format("%s/%s.iso", isosDir, imageId); guestAdditionsIso = String.format("%s/VBoxGuestAdditions_%s.iso", isosDir, hostVersion); } @@ -178,6 +176,10 @@ public class BaseVirtualBoxClientLiveTest extends BaseVersionedServiceLiveTest { } } } + + public String adminDisk(String vmName) { + return workingDir + File.separator + vmName + ".vdi"; + } @AfterClass(groups = "live") protected void tearDown() throws Exception { diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxComputeServiceAdapterLiveTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxComputeServiceAdapterLiveTest.java index 386b378384..70c1200bbd 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxComputeServiceAdapterLiveTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxComputeServiceAdapterLiveTest.java @@ -35,7 +35,7 @@ import org.virtualbox_4_1.IMachine; import com.google.common.collect.Iterables; -@Test(groups = "live", singleThreaded = true, testName = "VirtualBoxComputeServiceAdapterLiveTest") +@Test(groups = "plive", singleThreaded = true, testName = "VirtualBoxComputeServiceAdapterLiveTest", enabled = false) public class VirtualBoxComputeServiceAdapterLiveTest extends BaseVirtualBoxClientLiveTest { private VirtualBoxComputeServiceAdapter adapter; @@ -47,7 +47,7 @@ public class VirtualBoxComputeServiceAdapterLiveTest extends BaseVirtualBoxClien adapter = context.utils().injector().getInstance(VirtualBoxComputeServiceAdapter.class); } - @Test + @Test(enabled = false) public void testCreateNodeWithGroupEncodedIntoNameThenStoreCredentials() { String group = "foo"; String name = "foo-ef4"; @@ -83,13 +83,13 @@ public class VirtualBoxComputeServiceAdapterLiveTest extends BaseVirtualBoxClien } } - @Test + @Test(enabled = false) public void testListHardwareProfiles() { Iterable profiles = adapter.listHardwareProfiles(); assertEquals(1, Iterables.size(profiles)); } - @Test + @Test(enabled = false) public void testListImages() { Iterable iMageIterable = adapter.listImages(); for (Image image : iMageIterable) { @@ -101,7 +101,7 @@ public class VirtualBoxComputeServiceAdapterLiveTest extends BaseVirtualBoxClien @Override protected void tearDown() throws Exception { if (machine != null) - // adapter.destroyNode(machine.getNodeId() + ""); - super.tearDown(); + adapter.destroyNode(machine.getNodeId() + ""); + super.tearDown(); } } diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CloneAndRegisterMachineFromIMachineIfNotAlreadyExistsLiveTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CloneAndRegisterMachineFromIMachineIfNotAlreadyExistsLiveTest.java index 1ca1540c3a..c72f0c98cf 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CloneAndRegisterMachineFromIMachineIfNotAlreadyExistsLiveTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CloneAndRegisterMachineFromIMachineIfNotAlreadyExistsLiveTest.java @@ -78,8 +78,8 @@ public class CloneAndRegisterMachineFromIMachineIfNotAlreadyExistsLiveTest exten .bus(StorageBus.IDE) .attachISO(0, 0, operatingSystemIso) .attachHardDisk( - HardDisk.builder().diskpath(adminDisk).controllerPort(0).deviceSlot(1).autoDelete(true).build()) - .attachISO(1, 1, guestAdditionsIso).build(); + HardDisk.builder().diskpath(adminDisk(sourceName)).controllerPort(0).deviceSlot(1) + .autoDelete(true).build()).attachISO(1, 1, guestAdditionsIso).build(); VmSpec sourceVmSpec = VmSpec.builder().id(sourceName).name(sourceName).osTypeId("").memoryMB(512) .cleanUpMode(CleanupMode.Full).controller(ideController).forceOverwrite(true).build(); diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndInstallVmLiveTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndInstallVmLiveTest.java index e1be3b6bfa..272dfe1edd 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndInstallVmLiveTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndInstallVmLiveTest.java @@ -91,8 +91,8 @@ public class CreateAndInstallVmLiveTest extends BaseVirtualBoxClientLiveTest { this.vmName = VIRTUALBOX_IMAGE_PREFIX + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, getClass().getSimpleName()); - HardDisk hardDisk = HardDisk.builder().diskpath(adminDisk).autoDelete(true).controllerPort(0).deviceSlot(1) - .build(); + HardDisk hardDisk = HardDisk.builder().diskpath(adminDisk(vmName)).autoDelete(true).controllerPort(0) + .deviceSlot(1).build(); StorageController ideController = StorageController.builder().name("IDE Controller").bus(StorageBus.IDE) .attachISO(0, 0, operatingSystemIso).attachHardDisk(hardDisk).attachISO(1, 1, guestAdditionsIso).build(); vmSpecification = VmSpec.builder().id(vmName).name(vmName).memoryMB(512).osTypeId("").controller(ideController) diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndRegisterMachineFromIsoIfNotAlreadyExistsLiveTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndRegisterMachineFromIsoIfNotAlreadyExistsLiveTest.java index b9e20770d5..204f758d10 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndRegisterMachineFromIsoIfNotAlreadyExistsLiveTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndRegisterMachineFromIsoIfNotAlreadyExistsLiveTest.java @@ -51,28 +51,23 @@ public class CreateAndRegisterMachineFromIsoIfNotAlreadyExistsLiveTest extends private String ideControllerName; private CleanupMode mode; - private StorageController ideController; @Override public void setupClient() { super.setupClient(); ideControllerName = "IDE Controller"; mode = CleanupMode.Full; - ideController = StorageController - .builder() - .name(ideControllerName) - .bus(StorageBus.IDE) - .attachISO(0, 0, operatingSystemIso) - .attachHardDisk( - HardDisk.builder().diskpath(adminDisk) - .controllerPort(0).deviceSlot(1).build()) - .attachISO(1, 1, guestAdditionsIso).build(); } @Test public void testCreateNewMachine() throws Exception { String vmName = "jclouds-test-create-1-node"; String vmId = UUID.randomUUID().toString(); + + StorageController ideController = StorageController.builder().name(ideControllerName).bus(StorageBus.IDE) + .attachISO(0, 0, operatingSystemIso) + .attachHardDisk(HardDisk.builder().diskpath(adminDisk(vmName)).controllerPort(0).deviceSlot(1).build()) + .attachISO(1, 1, guestAdditionsIso).build(); VmSpec vmSpec = VmSpec.builder().id(vmId).name(vmName).memoryMB(512) .controller(ideController).cleanUpMode(mode).osTypeId("Debian") @@ -110,6 +105,11 @@ public class CreateAndRegisterMachineFromIsoIfNotAlreadyExistsLiveTest extends public void testCreateNewMachineWithBadOsType() throws Exception { String vmName = "jclouds-test-create-2-node"; String vmId = UUID.randomUUID().toString(); + + StorageController ideController = StorageController.builder().name(ideControllerName).bus(StorageBus.IDE) + .attachISO(0, 0, operatingSystemIso) + .attachHardDisk(HardDisk.builder().diskpath(adminDisk(vmName)).controllerPort(0).deviceSlot(1).build()) + .attachISO(1, 1, guestAdditionsIso).build(); VmSpec vmSpec = VmSpec.builder().id(vmId).name(vmName).memoryMB(512) .controller(ideController).cleanUpMode(mode) diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/predicates/GuestAdditionsInstallerLiveTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/predicates/GuestAdditionsInstallerLiveTest.java index d4f8c18708..eafbea88d7 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/predicates/GuestAdditionsInstallerLiveTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/predicates/GuestAdditionsInstallerLiveTest.java @@ -68,16 +68,14 @@ public class GuestAdditionsInstallerLiveTest extends + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, getClass() .getSimpleName()); - StorageController ideController = StorageController - .builder() - .name("IDE Controller") - .bus(StorageBus.IDE) - .attachISO(0, 0, operatingSystemIso) - .attachHardDisk( - HardDisk.builder().diskpath(adminDisk) - .controllerPort(0).deviceSlot(1) - .autoDelete(true).build()) - .attachISO(1, 1, guestAdditionsIso).build(); + StorageController ideController = StorageController + .builder() + .name("IDE Controller") + .bus(StorageBus.IDE) + .attachISO(0, 0, operatingSystemIso) + .attachHardDisk( + HardDisk.builder().diskpath(adminDisk(sourceName)).controllerPort(0).deviceSlot(1) + .autoDelete(true).build()).attachISO(1, 1, guestAdditionsIso).build(); VmSpec sourceVmSpec = VmSpec.builder().id(sourceName).name(sourceName) .osTypeId("").memoryMB(512).cleanUpMode(CleanupMode.Full) diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/predicates/IMachinePredicatesLiveTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/predicates/IMachinePredicatesLiveTest.java index 64a005ce6b..978782a994 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/predicates/IMachinePredicatesLiveTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/predicates/IMachinePredicatesLiveTest.java @@ -73,7 +73,8 @@ public class IMachinePredicatesLiveTest extends BaseVirtualBoxClientLiveTest { cloneName = VIRTUALBOX_IMAGE_PREFIX + "Clone#" + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, getClass().getSimpleName()); - HardDisk hardDisk = HardDisk.builder().diskpath(adminDisk).autoDelete(true).controllerPort(0).deviceSlot(1).build(); + HardDisk hardDisk = HardDisk.builder().diskpath(adminDisk(vmName)).autoDelete(true).controllerPort(0) + .deviceSlot(1).build(); masterStorageController = StorageController.builder().name(ideControllerName).bus(StorageBus.IDE) .attachISO(0, 0, operatingSystemIso).attachHardDisk(hardDisk).attachISO(1, 1, guestAdditionsIso).build(); VmSpec masterSpec = VmSpec.builder().id(vmName).name(vmName).memoryMB(512).osTypeId(osTypeId)