mirror of https://github.com/apache/jclouds.git
solved a problem running most live tests where the admin disk was the same
This commit is contained in:
parent
d2e1e36256
commit
2421847527
|
@ -73,7 +73,6 @@ public class MastersCache extends AbstractLoadingCache<Image, Master> {
|
|||
private final Function<MasterSpec, IMachine> masterCreatorAndInstaller;
|
||||
private final Map<String, YamlImage> 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<Image, Master> {
|
|||
wdFile.mkdirs();
|
||||
}
|
||||
this.isosDir = wdFile.getAbsolutePath() + File.separator + "isos";
|
||||
this.adminDisk = workingDir + "/testadmin.vdi";
|
||||
this.imageMapping = Maps.newLinkedHashMap();
|
||||
for (Entry<Image, YamlImage> entry : yamlMapper.get().entrySet()) {
|
||||
this.imageMapping.put(entry.getKey().getId(), entry.getValue());
|
||||
|
@ -123,6 +121,8 @@ public class MastersCache extends AbstractLoadingCache<Image, Master> {
|
|||
|
||||
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();
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<NodeMetadata> 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 {
|
||||
|
|
|
@ -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<IMachine> profiles = adapter.listHardwareProfiles();
|
||||
assertEquals(1, Iterables.size(profiles));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(enabled = false)
|
||||
public void testListImages() {
|
||||
Iterable<Image> 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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue