mirror of https://github.com/apache/jclouds.git
Provide a method to prepare an before taking an snapshot from it
This commit is contained in:
parent
0793597891
commit
7f589821d4
|
@ -105,6 +105,8 @@ public abstract class BaseImageExtensionLiveTest extends BaseComputeServiceConte
|
||||||
NodeMetadata node = Iterables.getOnlyElement(computeService.createNodesInGroup(imageGroup, 1, template));
|
NodeMetadata node = Iterables.getOnlyElement(computeService.createNodesInGroup(imageGroup, 1, template));
|
||||||
checkReachable(node);
|
checkReachable(node);
|
||||||
|
|
||||||
|
prepareNodeBeforeCreatingImage(node);
|
||||||
|
|
||||||
logger.info("Creating image from node %s, started with template: %s", node, template);
|
logger.info("Creating image from node %s, started with template: %s", node, template);
|
||||||
ImageTemplate newImageTemplate = imageExtension.get().buildImageTemplateFromNode(imageGroup,
|
ImageTemplate newImageTemplate = imageExtension.get().buildImageTemplateFromNode(imageGroup,
|
||||||
node.getId());
|
node.getId());
|
||||||
|
@ -120,6 +122,13 @@ public abstract class BaseImageExtensionLiveTest extends BaseComputeServiceConte
|
||||||
assertTrue(optImage.isPresent());
|
assertTrue(optImage.isPresent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Subclasses can override this to prepare the node before creating an image (run cleanup scripts, etc)
|
||||||
|
*/
|
||||||
|
protected void prepareNodeBeforeCreatingImage(NodeMetadata node) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Test(groups = { "integration", "live" }, singleThreaded = true, dependsOnMethods = "testCreateImage")
|
@Test(groups = { "integration", "live" }, singleThreaded = true, dependsOnMethods = "testCreateImage")
|
||||||
public void testImageIsCachedAfterBeingCreated() {
|
public void testImageIsCachedAfterBeingCreated() {
|
||||||
Optional<Image> imageInCache = findImageWithNameInCache(imageGroup);
|
Optional<Image> imageInCache = findImageWithNameInCache(imageGroup);
|
||||||
|
|
Loading…
Reference in New Issue