@Test(dependsOnMethods = "testGetAttachment") public void testDetachVolume() throws TimeoutException { volumeAttachmentApi.detachVolumeFromServer(volume.getId(), server.getId()); // Wait for the volume to become Detached (aka Available) before moving on if (!VolumePredicates.awaitAvailable(volumeApi).apply(volume)) { throw new TimeoutException("Timeout on volume: " + volume); } VolumeAttachment volumeAttachment = volumeAttachmentApi .getAttachmentForVolumeOnServer(volume.getId(), server.getId()); assertNull(volumeAttachment); } }
public void testGetAttachmentFail() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/instance-1/os-volume_attachments/1"); VolumeAttachmentApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, authenticatedGET().endpoint(endpoint).build(), HttpResponse.builder().statusCode(404).build() ).getVolumeAttachmentExtensionForZone("az-1.region-a.geo-1").get(); assertNull(api.getAttachmentForVolumeOnServer("1", "instance-1")); }
@Test(dependsOnMethods = "testListAttachments") public void testGetAttachment() { VolumeAttachment volumeAttachment = volumeAttachmentApi .getAttachmentForVolumeOnServer(volume.getId(), server.getId()); assertEquals(volumeAttachment.getVolumeId(), volume.getId()); assertEquals(volumeAttachment.getServerId(), server.getId()); }
public void testGetAttachment() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/instance-1/os-volume_attachments/1"); VolumeAttachmentApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, authenticatedGET().endpoint(endpoint).build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/attachment_details.json")).build() ).getVolumeAttachmentExtensionForZone("az-1.region-a.geo-1").get(); VolumeAttachment attachment = api.getAttachmentForVolumeOnServer("1", "instance-1"); assertEquals(attachment, testAttachment()); }
public void testGetAttachment() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers/instance-1/os-volume_attachments/1"); VolumeAttachmentApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, authenticatedGET().endpoint(endpoint).build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/attachment_details.json")).build() ).getVolumeAttachmentApi("az-1.region-a.geo-1").get(); VolumeAttachment attachment = api.getAttachmentForVolumeOnServer("1", "instance-1"); assertEquals(attachment, testAttachment()); }
for (VolumeAttachment att : attachments) { VolumeAttachment details = volumeAttachmentApi.get() .getAttachmentForVolumeOnServer(att.getVolumeId(), serverId); assertNotNull(details); assertNotNull(details.getId());