mirror of https://github.com/apache/jclouds.git
issue 384: fix IsoToIMachineLiveTest
This commit is contained in:
parent
572e05d631
commit
53b652cafe
|
@ -76,6 +76,7 @@ public class IMachineToImage implements Function<IMachine, Image> {
|
|||
@Override
|
||||
public OsFamily apply(String osDescription) {
|
||||
if (osDescription.startsWith("linux")) return OsFamily.LINUX;
|
||||
if (osDescription.startsWith("Ubuntu")) return OsFamily.LINUX;
|
||||
return OsFamily.UNRECOGNIZED;
|
||||
}
|
||||
};
|
||||
|
@ -91,7 +92,7 @@ public class IMachineToImage implements Function<IMachine, Image> {
|
|||
@Override
|
||||
public String apply(String osDescription) {
|
||||
OsFamily family = osFamily().apply(osDescription);
|
||||
if (family.equals(OsFamily.UBUNTU))
|
||||
if (family.equals(OsFamily.LINUX))
|
||||
return parseVersion(osDescription, UBUNTU);
|
||||
else
|
||||
return "";
|
||||
|
|
|
@ -66,7 +66,7 @@ public class IMachineToImageTest {
|
|||
assertEquals(image.getDescription(), "my-ubuntu-machine");
|
||||
assertEquals(image.getOperatingSystem().getDescription(), linuxDescription);
|
||||
assertTrue(image.getOperatingSystem().is64Bit());
|
||||
assertEquals(image.getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
||||
assertEquals(image.getOperatingSystem().getFamily(), OsFamily.LINUX);
|
||||
assertEquals(image.getOperatingSystem().getVersion(), "10.04");
|
||||
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public class IsoToIMachineLiveTest extends BaseVirtualBoxClientLiveTest {
|
|||
|
||||
private String settingsFile = null;
|
||||
private boolean forceOverwrite = true;
|
||||
private String vmId = "jclouds-image-1";
|
||||
private String vmId = "jclouds-image-iso-1";
|
||||
private String osTypeId = "";
|
||||
private String controllerIDE = "IDE Controller";
|
||||
private String diskFormat = "";
|
||||
|
@ -85,6 +85,7 @@ public class IsoToIMachineLiveTest extends BaseVirtualBoxClientLiveTest {
|
|||
|
||||
IMachineToImage iMachineToImage = new IMachineToImage(manager);
|
||||
Image newImage = iMachineToImage.apply(imageMachine);
|
||||
//TODO add the description to the cache of the images or serialize to YAML the image desc
|
||||
Set<? extends Image> images = context.getComputeService().listImages();
|
||||
|
||||
assertTrue(any(images, equalTo(newImage)));
|
||||
|
|
|
@ -35,7 +35,8 @@ import com.google.common.collect.ImmutableMap;
|
|||
*
|
||||
* @author Andrea Turli
|
||||
*/
|
||||
public class ImageFromYamlStreamTest extends BaseVirtualBoxClientLiveTest {
|
||||
@Test(groups = "unit")
|
||||
public class ImageFromYamlStreamTest {
|
||||
|
||||
public static final Image TEST1 = new ImageBuilder()
|
||||
.id("myTestId")
|
||||
|
|
Loading…
Reference in New Issue