use of com.vmware.photon.controller.model.tasks.ImageEnumerationTaskService.ImageEnumerationTaskState in project photon-model by vmware.
the class TestAzureImageEnumerationTask method testPublicImageEnumeration_defaultThroughFilter.
@Test
public void testPublicImageEnumeration_defaultThroughFilter() throws Throwable {
Assume.assumeFalse(this.isMock);
ImageEnumerationTaskState task = kickOffImageEnumeration(this.endpointState, PUBLIC, AZURE_DEFAULT_IMAGES_FILTER);
// Validate 11 image states are created.
assertDefaultImages(task);
}
use of com.vmware.photon.controller.model.tasks.ImageEnumerationTaskService.ImageEnumerationTaskState in project photon-model by vmware.
the class TestVSphereProvisionFromImageLink method doRefresh.
private void doRefresh() throws Throwable {
ImageEnumerationTaskState task = new ImageEnumerationTaskState();
if (isMock()) {
task.options = EnumSet.of(TaskOption.IS_MOCK);
}
task.enumerationAction = EnumerationAction.REFRESH;
task.endpointLink = this.endpoint.documentSelfLink;
ImageEnumerationTaskState outTask = TestUtils.doPost(this.host, task, ImageEnumerationTaskState.class, UriUtils.buildUri(this.host, ImageEnumerationTaskService.FACTORY_LINK));
this.host.waitForFinishedTask(ImageEnumerationTaskState.class, outTask.documentSelfLink);
}
use of com.vmware.photon.controller.model.tasks.ImageEnumerationTaskService.ImageEnumerationTaskState in project photon-model by vmware.
the class TestVSphereImageEnumerationTask method doRefresh.
private void doRefresh() throws Throwable {
ImageEnumerationTaskState task = new ImageEnumerationTaskState();
if (isMock()) {
task.options = EnumSet.of(TaskOption.IS_MOCK);
}
task.enumerationAction = EnumerationAction.REFRESH;
task.endpointLink = this.endpoint.documentSelfLink;
ImageEnumerationTaskState outTask = TestUtils.doPost(this.host, task, ImageEnumerationTaskState.class, UriUtils.buildUri(this.host, ImageEnumerationTaskService.FACTORY_LINK));
this.host.waitForFinishedTask(ImageEnumerationTaskState.class, outTask.documentSelfLink);
}
use of com.vmware.photon.controller.model.tasks.ImageEnumerationTaskService.ImageEnumerationTaskState in project photon-model by vmware.
the class TestAzureImageEnumerationTask method testPublicImageEnumeration_all.
@Test
public void testPublicImageEnumeration_all() throws Throwable {
Assume.assumeFalse(this.isMock);
Assume.assumeTrue(this.enableLongRunning);
// This test takes about 30 mins!
getHost().setTimeoutSeconds((int) TimeUnit.MINUTES.toSeconds(40));
ImageEnumerationTaskState task = kickOffImageEnumeration(this.endpointState, PUBLIC, null);
// Validate at least 4.5K image states are created
QueryByPages<ImageState> queryAll = new QueryByPages<ImageState>(getHost(), Builder.create().addKindFieldClause(ImageState.class).build(), ImageState.class, task.tenantLinks);
queryAll.setMaxPageSize(QueryUtils.DEFAULT_MAX_RESULT_LIMIT);
Long imagesCount = PhotonModelUtils.waitToComplete(queryAll.collectLinks(Collectors.counting()));
Assert.assertTrue("Expected at least " + 4_500 + " images, but found only " + imagesCount, imagesCount > 4_500);
}
use of com.vmware.photon.controller.model.tasks.ImageEnumerationTaskService.ImageEnumerationTaskState in project photon-model by vmware.
the class TestAzureImageEnumerationTask method testPublicImageEnumeration_defaultThroughMode.
@Test
public void testPublicImageEnumeration_defaultThroughMode() throws Throwable {
Assume.assumeFalse(this.isMock);
setImagesLoadMode(ImagesLoadMode.DEFAULT);
try {
ImageEnumerationTaskState task = kickOffImageEnumeration(this.endpointState, PUBLIC, AZURE_ALL_IMAGES_FILTER);
assertDefaultImages(task);
} finally {
setImagesLoadMode(ImagesLoadMode.ALL);
}
}
Aggregations