public void testLiveMigrateServer() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/1/action"); ServerAdminApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, standardActionRequestBuilderVoidResponse(endpoint, "GONNAOVERWRITE") .payload(payloadFromStringWithContentType("{\"os-migrateLive\":{\"host\":\"bighost\",\"block_migration\":true,\"disk_over_commit\":false}}", MediaType.APPLICATION_JSON)).build(), HttpResponse.builder().statusCode(202).build() ).getServerAdminExtensionForZone("az-1.region-a.geo-1").get(); assertTrue(api.liveMigrate("1", "bighost", true, false)); }
public void testLiveMigrateServerFailsNotFound() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/servers/1/action"); ServerAdminApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, standardActionRequestBuilderVoidResponse(endpoint, "GONNAOVERWRITE") .payload(payloadFromStringWithContentType("{\"os-migrateLive\":{\"host\":\"bighost\",\"block_migration\":true,\"disk_over_commit\":false}}", MediaType.APPLICATION_JSON)).build(), HttpResponse.builder().statusCode(404).build() ).getServerAdminExtensionForZone("az-1.region-a.geo-1").get(); assertFalse(api.liveMigrate("1", "bighost", true, false)); }
public void testLiveMigrateServer() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers/1/action"); ServerAdminApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, standardActionRequestBuilderVoidResponse(endpoint, "GONNAOVERWRITE") .payload(payloadFromStringWithContentType("{\"os-migrateLive\":{\"host\":\"bighost\",\"block_migration\":true,\"disk_over_commit\":false}}", MediaType.APPLICATION_JSON)).build(), HttpResponse.builder().statusCode(202).build() ).getServerAdminApi("az-1.region-a.geo-1").get(); api.liveMigrate("1", "bighost", true, false); }