passwordAuthentication is now default for keystone

This commit is contained in:
Adrian Cole 2012-03-27 14:04:18 -04:00
parent c56043db08
commit e46cef9fbb
17 changed files with 71 additions and 63 deletions

View File

@ -72,7 +72,7 @@ public class NovaComputeServiceAdapterExpectTest extends BaseNovaComputeServiceC
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder() Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder()
.put(keystoneAuthWithAccessKeyAndSecretKey, responseWithKeystoneAccess) .put(keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess)
.put(extensionsOfNovaRequest, extensionsOfNovaResponse) .put(extensionsOfNovaRequest, extensionsOfNovaResponse)
.put(listImagesDetail, listImagesDetailResponse) .put(listImagesDetail, listImagesDetailResponse)
.put(listFlavorsDetail, listFlavorsDetailResponse) .put(listFlavorsDetail, listFlavorsDetailResponse)
@ -115,7 +115,7 @@ public class NovaComputeServiceAdapterExpectTest extends BaseNovaComputeServiceC
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder() Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder()
.put(keystoneAuthWithAccessKeyAndSecretKey, responseWithKeystoneAccess) .put(keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess)
.put(extensionsOfNovaRequest, extensionsOfNovaResponse) .put(extensionsOfNovaRequest, extensionsOfNovaResponse)
.put(listImagesDetail, listImagesDetailResponse) .put(listImagesDetail, listImagesDetailResponse)
.put(listFlavorsDetail, listFlavorsDetailResponse) .put(listFlavorsDetail, listFlavorsDetailResponse)

View File

@ -51,7 +51,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe
public void testListLocationsWhenResponseIs2xx() throws Exception { public void testListLocationsWhenResponseIs2xx() throws Exception {
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder().put( Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder().put(
keystoneAuthWithAccessKeyAndSecretKey, responseWithKeystoneAccess).put(extensionsOfNovaRequest, keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess).put(extensionsOfNovaRequest,
extensionsOfNovaResponse).put(listImagesDetail, listImagesDetailResponse).put(listServers, extensionsOfNovaResponse).put(listImagesDetail, listImagesDetailResponse).put(listServers,
listServersResponse).put(listFlavorsDetail, listFlavorsDetailResponse).build(); listServersResponse).put(listFlavorsDetail, listFlavorsDetailResponse).build();
@ -72,7 +72,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe
public void testDefaultTemplateTryStack() throws Exception { public void testDefaultTemplateTryStack() throws Exception {
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder().put( Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder().put(
keystoneAuthWithAccessKeyAndSecretKey, keystoneAuthWithUsernameAndPassword,
HttpResponse.builder().statusCode(200).message("HTTP/1.1 200").payload( HttpResponse.builder().statusCode(200).message("HTTP/1.1 200").payload(
payloadFromResourceWithContentType("/keystoneAuthResponse_trystack.json", "application/json")) payloadFromResourceWithContentType("/keystoneAuthResponse_trystack.json", "application/json"))
.build()).put( .build()).put(
@ -117,7 +117,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe
HttpResponse listServersResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse listServersResponse = HttpResponse.builder().statusCode(404).build();
ComputeService clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, ComputeService clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, listServers, listServersResponse); responseWithKeystoneAccess, listServers, listServersResponse);
assertTrue(clientWhenNoServersExist.listNodes().isEmpty()); assertTrue(clientWhenNoServersExist.listNodes().isEmpty());
@ -127,7 +127,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe
public void testCreateNodeSetsCredential() throws Exception { public void testCreateNodeSetsCredential() throws Exception {
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder().put( Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder().put(
keystoneAuthWithAccessKeyAndSecretKey, responseWithKeystoneAccess).put(extensionsOfNovaRequest, keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess).put(extensionsOfNovaRequest,
extensionsOfNovaResponse).put(listImagesDetail, listImagesDetailResponse).put(listServers, extensionsOfNovaResponse).put(listImagesDetail, listImagesDetailResponse).put(listServers,
listServersResponse).put(listFlavorsDetail, listFlavorsDetailResponse).build(); listServersResponse).put(listFlavorsDetail, listFlavorsDetailResponse).build();

View File

@ -71,7 +71,7 @@ public class AllocateAndAddFloatingIpToNodeExpectTest extends BaseNovaComputeSer
HttpRequest addFloatingIPRequest = addFloatingIPForAddress("10.0.0.3"); HttpRequest addFloatingIPRequest = addFloatingIPForAddress("10.0.0.3");
AllocateAndAddFloatingIpToNode fn = requestsSendResponses( AllocateAndAddFloatingIpToNode fn = requestsSendResponses(
ImmutableMap.<HttpRequest, HttpResponse> builder().put(keystoneAuthWithAccessKeyAndSecretKey, ImmutableMap.<HttpRequest, HttpResponse> builder().put(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess).put(extensionsOfNovaRequest, extensionsOfNovaResponse).put( responseWithKeystoneAccess).put(extensionsOfNovaRequest, extensionsOfNovaResponse).put(
allocateFloatingIP, allocateFloatingIPResponse) allocateFloatingIP, allocateFloatingIPResponse)
.put(addFloatingIPRequest, addFloatingIPResponse).build()).getContext().utils().injector() .put(addFloatingIPRequest, addFloatingIPResponse).build()).getContext().utils().injector()
@ -117,7 +117,7 @@ public class AllocateAndAddFloatingIpToNodeExpectTest extends BaseNovaComputeSer
HttpRequest addFloatingIPRequest = addFloatingIPForAddress("10.0.0.5"); HttpRequest addFloatingIPRequest = addFloatingIPForAddress("10.0.0.5");
AllocateAndAddFloatingIpToNode fn = requestsSendResponses( AllocateAndAddFloatingIpToNode fn = requestsSendResponses(
ImmutableMap.<HttpRequest, HttpResponse> builder().put(keystoneAuthWithAccessKeyAndSecretKey, ImmutableMap.<HttpRequest, HttpResponse> builder().put(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess).put(extensionsOfNovaRequest, extensionsOfNovaResponse).put( responseWithKeystoneAccess).put(extensionsOfNovaRequest, extensionsOfNovaResponse).put(
allocateFloatingIP, allocateFloatingIPResponse) allocateFloatingIP, allocateFloatingIPResponse)
.put(addFloatingIPRequest, addFloatingIPResponse).put(listFloatingIPs, .put(addFloatingIPRequest, addFloatingIPResponse).put(listFloatingIPs,

View File

@ -46,7 +46,7 @@ public class FloatingIPAsyncClientExpectTest extends BaseNovaAsyncClientExpectTe
public void testWhenNamespaceInExtensionsListFloatingIpPresent() throws Exception { public void testWhenNamespaceInExtensionsListFloatingIpPresent() throws Exception {
NovaAsyncClient clientWhenExtensionNotInList = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaAsyncClient clientWhenExtensionNotInList = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse);
assertEquals(clientWhenExtensionNotInList.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1")); assertEquals(clientWhenExtensionNotInList.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
@ -57,7 +57,7 @@ public class FloatingIPAsyncClientExpectTest extends BaseNovaAsyncClientExpectTe
public void testWhenNamespaceNotInExtensionsListFloatingIpNotPresent() throws Exception { public void testWhenNamespaceNotInExtensionsListFloatingIpNotPresent() throws Exception {
NovaAsyncClient clientWhenExtensionNotInList = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaAsyncClient clientWhenExtensionNotInList = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, unmatchedExtensionsOfNovaResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, unmatchedExtensionsOfNovaResponse);
assertEquals(clientWhenExtensionNotInList.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1")); assertEquals(clientWhenExtensionNotInList.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
@ -78,7 +78,7 @@ public class FloatingIPAsyncClientExpectTest extends BaseNovaAsyncClientExpectTe
HttpResponse listFloatingIPsResponse = HttpResponse.builder().statusCode(200) HttpResponse listFloatingIPsResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/floatingip_list.json")).build(); .payload(payloadFromResource("/floatingip_list.json")).build();
NovaAsyncClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaAsyncClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listFloatingIPs, listFloatingIPsResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listFloatingIPs, listFloatingIPsResponse);
assertEquals(clientWhenFloatingIPsExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1")); assertEquals(clientWhenFloatingIPsExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
@ -98,7 +98,7 @@ public class FloatingIPAsyncClientExpectTest extends BaseNovaAsyncClientExpectTe
HttpResponse listFloatingIPsResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse listFloatingIPsResponse = HttpResponse.builder().statusCode(404).build();
NovaAsyncClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaAsyncClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listFloatingIPs, listFloatingIPsResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listFloatingIPs, listFloatingIPsResponse);
assertTrue(clientWhenNoServersExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().listFloatingIPs().get() assertTrue(clientWhenNoServersExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().listFloatingIPs().get()
@ -117,7 +117,7 @@ public class FloatingIPAsyncClientExpectTest extends BaseNovaAsyncClientExpectTe
HttpResponse getFloatingIPResponse = HttpResponse.builder().statusCode(200) HttpResponse getFloatingIPResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/floatingip_details.json")).build(); .payload(payloadFromResource("/floatingip_details.json")).build();
NovaAsyncClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaAsyncClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getFloatingIP, getFloatingIPResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getFloatingIP, getFloatingIPResponse);
assertEquals(clientWhenFloatingIPsExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().getFloatingIP("1").get() assertEquals(clientWhenFloatingIPsExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().getFloatingIP("1").get()
@ -135,7 +135,7 @@ public class FloatingIPAsyncClientExpectTest extends BaseNovaAsyncClientExpectTe
HttpResponse getFloatingIPResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse getFloatingIPResponse = HttpResponse.builder().statusCode(404).build();
NovaAsyncClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaAsyncClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getFloatingIP, getFloatingIPResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getFloatingIP, getFloatingIPResponse);
assertNull(clientWhenNoServersExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().getFloatingIP("1").get()); assertNull(clientWhenNoServersExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().getFloatingIP("1").get());
@ -154,7 +154,7 @@ public class FloatingIPAsyncClientExpectTest extends BaseNovaAsyncClientExpectTe
HttpResponse allocateFloatingIPResponse = HttpResponse.builder().statusCode(200) HttpResponse allocateFloatingIPResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/floatingip_details.json")).build(); .payload(payloadFromResource("/floatingip_details.json")).build();
NovaAsyncClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaAsyncClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, allocateFloatingIP, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, allocateFloatingIP,
allocateFloatingIPResponse); allocateFloatingIPResponse);
@ -175,7 +175,7 @@ public class FloatingIPAsyncClientExpectTest extends BaseNovaAsyncClientExpectTe
HttpResponse allocateFloatingIPResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse allocateFloatingIPResponse = HttpResponse.builder().statusCode(404).build();
NovaAsyncClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaAsyncClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, allocateFloatingIP, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, allocateFloatingIP,
allocateFloatingIPResponse); allocateFloatingIPResponse);

View File

@ -45,7 +45,7 @@ import com.google.common.collect.ImmutableSet;
public class FloatingIPClientExpectTest extends BaseNovaClientExpectTest { public class FloatingIPClientExpectTest extends BaseNovaClientExpectTest {
public void testWhenNamespaceInExtensionsListFloatingIpPresent() throws Exception { public void testWhenNamespaceInExtensionsListFloatingIpPresent() throws Exception {
NovaClient clientWhenExtensionNotInList = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenExtensionNotInList = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse);
assertEquals(clientWhenExtensionNotInList.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1")); assertEquals(clientWhenExtensionNotInList.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
@ -56,7 +56,7 @@ public class FloatingIPClientExpectTest extends BaseNovaClientExpectTest {
public void testWhenNamespaceNotInExtensionsListFloatingIpNotPresent() throws Exception { public void testWhenNamespaceNotInExtensionsListFloatingIpNotPresent() throws Exception {
NovaClient clientWhenExtensionNotInList = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenExtensionNotInList = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, unmatchedExtensionsOfNovaResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, unmatchedExtensionsOfNovaResponse);
assertEquals(clientWhenExtensionNotInList.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1")); assertEquals(clientWhenExtensionNotInList.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
@ -77,7 +77,7 @@ public class FloatingIPClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listFloatingIPsResponse = HttpResponse.builder().statusCode(200) HttpResponse listFloatingIPsResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/floatingip_list.json")).build(); .payload(payloadFromResource("/floatingip_list.json")).build();
NovaClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listFloatingIPs, listFloatingIPsResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listFloatingIPs, listFloatingIPsResponse);
assertEquals(clientWhenFloatingIPsExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1")); assertEquals(clientWhenFloatingIPsExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
@ -97,7 +97,7 @@ public class FloatingIPClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listFloatingIPsResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse listFloatingIPsResponse = HttpResponse.builder().statusCode(404).build();
NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listFloatingIPs, listFloatingIPsResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listFloatingIPs, listFloatingIPsResponse);
assertTrue(clientWhenNoServersExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().listFloatingIPs().isEmpty()); assertTrue(clientWhenNoServersExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().listFloatingIPs().isEmpty());
@ -115,7 +115,7 @@ public class FloatingIPClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse getFloatingIPResponse = HttpResponse.builder().statusCode(200) HttpResponse getFloatingIPResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/floatingip_details.json")).build(); .payload(payloadFromResource("/floatingip_details.json")).build();
NovaClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getFloatingIP, getFloatingIPResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getFloatingIP, getFloatingIPResponse);
assertEquals(clientWhenFloatingIPsExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().getFloatingIP("1") assertEquals(clientWhenFloatingIPsExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().getFloatingIP("1")
@ -133,7 +133,7 @@ public class FloatingIPClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse getFloatingIPResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse getFloatingIPResponse = HttpResponse.builder().statusCode(404).build();
NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getFloatingIP, getFloatingIPResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getFloatingIP, getFloatingIPResponse);
assertNull(clientWhenNoServersExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().getFloatingIP("1")); assertNull(clientWhenNoServersExist.getFloatingIPExtensionForZone("az-1.region-a.geo-1").get().getFloatingIP("1"));
@ -152,7 +152,7 @@ public class FloatingIPClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse allocateFloatingIPResponse = HttpResponse.builder().statusCode(200) HttpResponse allocateFloatingIPResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/floatingip_details.json")).build(); .payload(payloadFromResource("/floatingip_details.json")).build();
NovaClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenFloatingIPsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, allocateFloatingIP, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, allocateFloatingIP,
allocateFloatingIPResponse); allocateFloatingIPResponse);
@ -173,7 +173,7 @@ public class FloatingIPClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse allocateFloatingIPResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse allocateFloatingIPResponse = HttpResponse.builder().statusCode(404).build();
NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, allocateFloatingIP, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, allocateFloatingIP,
allocateFloatingIPResponse); allocateFloatingIPResponse);

View File

@ -54,7 +54,7 @@ public class KeyPairClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listKeyPairsResponse = HttpResponse.builder().statusCode(200) HttpResponse listKeyPairsResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/keypair_list.json")).build(); .payload(payloadFromResource("/keypair_list.json")).build();
NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listKeyPairs, listKeyPairsResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listKeyPairs, listKeyPairsResponse);
assertEquals(clientWhenServersExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1")); assertEquals(clientWhenServersExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
@ -74,7 +74,7 @@ public class KeyPairClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listKeyPairsResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse listKeyPairsResponse = HttpResponse.builder().statusCode(404).build();
NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listKeyPairs, listKeyPairsResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listKeyPairs, listKeyPairsResponse);
assertTrue(clientWhenNoServersExist.getKeyPairExtensionForZone("az-1.region-a.geo-1").get().listKeyPairs().isEmpty()); assertTrue(clientWhenNoServersExist.getKeyPairExtensionForZone("az-1.region-a.geo-1").get().listKeyPairs().isEmpty());
@ -95,7 +95,7 @@ public class KeyPairClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse createKeyPairResponse = HttpResponse.builder().statusCode(200) HttpResponse createKeyPairResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/keypair_created.json")).build(); .payload(payloadFromResource("/keypair_created.json")).build();
NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createKeyPair, createKeyPairResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createKeyPair, createKeyPairResponse);
assertEquals(clientWhenServersExist.getKeyPairExtensionForZone("az-1.region-a.geo-1").get().createKeyPair("testkeypair") assertEquals(clientWhenServersExist.getKeyPairExtensionForZone("az-1.region-a.geo-1").get().createKeyPair("testkeypair")
@ -119,7 +119,7 @@ public class KeyPairClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse createKeyPairResponse = HttpResponse.builder().statusCode(200) HttpResponse createKeyPairResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/keypair_created.json")).build(); .payload(payloadFromResource("/keypair_created.json")).build();
NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createKeyPair, createKeyPairResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createKeyPair, createKeyPairResponse);
assertEquals( assertEquals(
@ -143,7 +143,7 @@ public class KeyPairClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse deleteKeyPairResponse = HttpResponse.builder().statusCode(202).build(); HttpResponse deleteKeyPairResponse = HttpResponse.builder().statusCode(202).build();
NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, deleteKeyPair, deleteKeyPairResponse); responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, deleteKeyPair, deleteKeyPairResponse);
assertTrue(clientWhenServersExist.getKeyPairExtensionForZone("az-1.region-a.geo-1").get().deleteKeyPair("testkeypair")); assertTrue(clientWhenServersExist.getKeyPairExtensionForZone("az-1.region-a.geo-1").get().deleteKeyPair("testkeypair"));

View File

@ -55,7 +55,7 @@ public class SecurityGroupClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listSecurityGroupsResponse = HttpResponse.builder().statusCode(200).payload( HttpResponse listSecurityGroupsResponse = HttpResponse.builder().statusCode(200).payload(
payloadFromResource("/securitygroup_list.json")).build(); payloadFromResource("/securitygroup_list.json")).build();
NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listSecurityGroups, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listSecurityGroups,
listSecurityGroupsResponse); listSecurityGroupsResponse);
@ -73,7 +73,7 @@ public class SecurityGroupClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listListSecurityGroupsResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse listListSecurityGroupsResponse = HttpResponse.builder().statusCode(404).build();
NovaClient clientWhenNoSecurityGroupsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listListSecurityGroups, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listListSecurityGroups,
listListSecurityGroupsResponse); listListSecurityGroupsResponse);
@ -91,7 +91,7 @@ public class SecurityGroupClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse getSecurityGroupResponse = HttpResponse.builder().statusCode(200).payload( HttpResponse getSecurityGroupResponse = HttpResponse.builder().statusCode(200).payload(
payloadFromResource("/securitygroup_details.json")).build(); payloadFromResource("/securitygroup_details.json")).build();
NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getSecurityGroup, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getSecurityGroup,
getSecurityGroupResponse); getSecurityGroupResponse);
@ -107,7 +107,7 @@ public class SecurityGroupClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse getSecurityGroupResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse getSecurityGroupResponse = HttpResponse.builder().statusCode(404).build();
NovaClient clientWhenNoSecurityGroupsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getSecurityGroup, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getSecurityGroup,
getSecurityGroupResponse); getSecurityGroupResponse);
@ -129,7 +129,7 @@ public class SecurityGroupClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse createSecurityGroupResponse = HttpResponse.builder().statusCode(200).payload( HttpResponse createSecurityGroupResponse = HttpResponse.builder().statusCode(200).payload(
payloadFromResource("/securitygroup_created.json")).build(); payloadFromResource("/securitygroup_created.json")).build();
NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createSecurityGroup, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createSecurityGroup,
createSecurityGroupResponse); createSecurityGroupResponse);
@ -147,7 +147,7 @@ public class SecurityGroupClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse deleteSecurityGroupResponse = HttpResponse.builder().statusCode(202).build(); HttpResponse deleteSecurityGroupResponse = HttpResponse.builder().statusCode(202).build();
NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, deleteSecurityGroup, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, deleteSecurityGroup,
deleteSecurityGroupResponse); deleteSecurityGroupResponse);
@ -172,7 +172,7 @@ public class SecurityGroupClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse createSecurityGroupRuleResponse = HttpResponse.builder().statusCode(200).payload( HttpResponse createSecurityGroupRuleResponse = HttpResponse.builder().statusCode(200).payload(
payloadFromResource("/securitygrouprule_created.json")).build(); payloadFromResource("/securitygrouprule_created.json")).build();
NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createSecurityGroupRule, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createSecurityGroupRule,
createSecurityGroupRuleResponse); createSecurityGroupRuleResponse);
@ -198,7 +198,7 @@ public class SecurityGroupClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse createSecurityGroupRuleResponse = HttpResponse.builder().statusCode(200).payload( HttpResponse createSecurityGroupRuleResponse = HttpResponse.builder().statusCode(200).payload(
payloadFromResource("/securitygrouprule_created.json")).build(); payloadFromResource("/securitygrouprule_created.json")).build();
NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createSecurityGroupRule, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createSecurityGroupRule,
createSecurityGroupRuleResponse); createSecurityGroupRuleResponse);
@ -217,7 +217,7 @@ public class SecurityGroupClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse deleteSecurityGroupRuleResponse = HttpResponse.builder().statusCode(202).build(); HttpResponse deleteSecurityGroupRuleResponse = HttpResponse.builder().statusCode(202).build();
NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, deleteSecurityGroupRule, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, deleteSecurityGroupRule,
deleteSecurityGroupRuleResponse); deleteSecurityGroupRuleResponse);

View File

@ -55,7 +55,7 @@ public class ExtensionClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listExtensionsResponse = HttpResponse.builder().statusCode(200) HttpResponse listExtensionsResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/extension_list.json")).build(); .payload(payloadFromResource("/extension_list.json")).build();
NovaClient clientWhenExtensionsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenExtensionsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, listExtensions, listExtensionsResponse); responseWithKeystoneAccess, listExtensions, listExtensionsResponse);
assertEquals(clientWhenExtensionsExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1")); assertEquals(clientWhenExtensionsExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
@ -75,7 +75,7 @@ public class ExtensionClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listExtensionsResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse listExtensionsResponse = HttpResponse.builder().statusCode(404).build();
NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, listExtensions, listExtensionsResponse); responseWithKeystoneAccess, listExtensions, listExtensionsResponse);
assertTrue(clientWhenNoServersExist.getExtensionClientForZone("az-1.region-a.geo-1").listExtensions().isEmpty()); assertTrue(clientWhenNoServersExist.getExtensionClientForZone("az-1.region-a.geo-1").listExtensions().isEmpty());
@ -95,7 +95,7 @@ public class ExtensionClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse getExtensionResponse = HttpResponse.builder().statusCode(200) HttpResponse getExtensionResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/extension_details.json")).build(); .payload(payloadFromResource("/extension_details.json")).build();
NovaClient clientWhenExtensionsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenExtensionsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, getExtension, getExtensionResponse); responseWithKeystoneAccess, getExtension, getExtensionResponse);
assertEquals(clientWhenExtensionsExist.getExtensionClientForZone("az-1.region-a.geo-1").getExtensionByAlias("RS-PIE") assertEquals(clientWhenExtensionsExist.getExtensionClientForZone("az-1.region-a.geo-1").getExtensionByAlias("RS-PIE")
@ -114,7 +114,7 @@ public class ExtensionClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse getExtensionResponse = HttpResponse.builder().statusCode(404) HttpResponse getExtensionResponse = HttpResponse.builder().statusCode(404)
.payload(payloadFromResource("/extension_details.json")).build(); .payload(payloadFromResource("/extension_details.json")).build();
NovaClient clientWhenNoExtensionsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoExtensionsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, getExtension, getExtensionResponse); responseWithKeystoneAccess, getExtension, getExtensionResponse);
assertNull(clientWhenNoExtensionsExist.getExtensionClientForZone("az-1.region-a.geo-1").getExtensionByAlias("RS-PIE")); assertNull(clientWhenNoExtensionsExist.getExtensionClientForZone("az-1.region-a.geo-1").getExtensionByAlias("RS-PIE"));

View File

@ -55,7 +55,7 @@ public class FlavorClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listFlavorsResponse = HttpResponse.builder().statusCode(200) HttpResponse listFlavorsResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/flavor_list.json")).build(); .payload(payloadFromResource("/flavor_list.json")).build();
NovaClient clientWhenFlavorsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenFlavorsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, listFlavors, listFlavorsResponse); responseWithKeystoneAccess, listFlavors, listFlavorsResponse);
assertEquals(clientWhenFlavorsExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1")); assertEquals(clientWhenFlavorsExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
@ -75,7 +75,7 @@ public class FlavorClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listFlavorsResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse listFlavorsResponse = HttpResponse.builder().statusCode(404).build();
NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, listFlavors, listFlavorsResponse); responseWithKeystoneAccess, listFlavors, listFlavorsResponse);
assertTrue(clientWhenNoServersExist.getFlavorClientForZone("az-1.region-a.geo-1").listFlavors().isEmpty()); assertTrue(clientWhenNoServersExist.getFlavorClientForZone("az-1.region-a.geo-1").listFlavors().isEmpty());
@ -95,7 +95,7 @@ public class FlavorClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse getFlavorResponse = HttpResponse.builder().statusCode(200) HttpResponse getFlavorResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/flavor_details.json")).build(); .payload(payloadFromResource("/flavor_details.json")).build();
NovaClient clientWhenFlavorsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenFlavorsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, getFlavor, getFlavorResponse); responseWithKeystoneAccess, getFlavor, getFlavorResponse);
assertEquals( assertEquals(
@ -115,7 +115,7 @@ public class FlavorClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse getFlavorResponse = HttpResponse.builder().statusCode(404) HttpResponse getFlavorResponse = HttpResponse.builder().statusCode(404)
.payload(payloadFromResource("/flavor_details.json")).build(); .payload(payloadFromResource("/flavor_details.json")).build();
NovaClient clientWhenNoFlavorsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoFlavorsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, getFlavor, getFlavorResponse); responseWithKeystoneAccess, getFlavor, getFlavorResponse);
assertNull(clientWhenNoFlavorsExist.getFlavorClientForZone("az-1.region-a.geo-1").getFlavor("123")); assertNull(clientWhenNoFlavorsExist.getFlavorClientForZone("az-1.region-a.geo-1").getFlavor("123"));

View File

@ -54,7 +54,7 @@ public class ImageClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listImagesResponse = HttpResponse.builder().statusCode(200) HttpResponse listImagesResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/image_list.json")).build(); .payload(payloadFromResource("/image_list.json")).build();
NovaClient clientWhenImagesExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenImagesExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, listImages, listImagesResponse); responseWithKeystoneAccess, listImages, listImagesResponse);
assertEquals(clientWhenImagesExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1")); assertEquals(clientWhenImagesExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
@ -74,7 +74,7 @@ public class ImageClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listImagesResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse listImagesResponse = HttpResponse.builder().statusCode(404).build();
NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, listImages, listImagesResponse); responseWithKeystoneAccess, listImages, listImagesResponse);
assertTrue(clientWhenNoServersExist.getImageClientForZone("az-1.region-a.geo-1").listImages().isEmpty()); assertTrue(clientWhenNoServersExist.getImageClientForZone("az-1.region-a.geo-1").listImages().isEmpty());
@ -93,7 +93,7 @@ public class ImageClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse getImageResponse = HttpResponse.builder().statusCode(200) HttpResponse getImageResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/image_details.json")).build(); .payload(payloadFromResource("/image_details.json")).build();
NovaClient clientWhenImagesExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenImagesExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, getImage, getImageResponse); responseWithKeystoneAccess, getImage, getImageResponse);
assertEquals( assertEquals(
@ -112,7 +112,7 @@ public class ImageClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse getImageResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse getImageResponse = HttpResponse.builder().statusCode(404).build();
NovaClient clientWhenNoImagesExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoImagesExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, getImage, getImageResponse); responseWithKeystoneAccess, getImage, getImageResponse);
assertNull(clientWhenNoImagesExist.getImageClientForZone("az-1.region-a.geo-1").getImage( assertNull(clientWhenNoImagesExist.getImageClientForZone("az-1.region-a.geo-1").getImage(

View File

@ -55,7 +55,7 @@ public class ServerClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listServersResponse = HttpResponse.builder().statusCode(200) HttpResponse listServersResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/server_list.json")).build(); .payload(payloadFromResource("/server_list.json")).build();
NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, listServers, listServersResponse); responseWithKeystoneAccess, listServers, listServersResponse);
assertEquals(clientWhenServersExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1")); assertEquals(clientWhenServersExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
@ -75,7 +75,7 @@ public class ServerClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse listServersResponse = HttpResponse.builder().statusCode(404).build(); HttpResponse listServersResponse = HttpResponse.builder().statusCode(404).build();
NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, listServers, listServersResponse); responseWithKeystoneAccess, listServers, listServersResponse);
assertTrue(clientWhenNoServersExist.getServerClientForZone("az-1.region-a.geo-1").listServers().isEmpty()); assertTrue(clientWhenNoServersExist.getServerClientForZone("az-1.region-a.geo-1").listServers().isEmpty());
@ -97,7 +97,7 @@ public class ServerClientExpectTest extends BaseNovaClientExpectTest {
HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted") HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
.payload(payloadFromResourceWithContentType("/new_server.json","application/json; charset=UTF-8")).build(); .payload(payloadFromResourceWithContentType("/new_server.json","application/json; charset=UTF-8")).build();
NovaClient clientWithNewServer = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWithNewServer = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, createServer, createServerResponse); responseWithKeystoneAccess, createServer, createServerResponse);
assertEquals(clientWithNewServer.getServerClientForZone("az-1.region-a.geo-1").createServer("test-e92", "1241", "100").toString(), assertEquals(clientWithNewServer.getServerClientForZone("az-1.region-a.geo-1").createServer("test-e92", "1241", "100").toString(),
@ -122,7 +122,7 @@ public class ServerClientExpectTest extends BaseNovaClientExpectTest {
.payload(payloadFromResourceWithContentType("/new_server.json","application/json; charset=UTF-8")).build(); .payload(payloadFromResourceWithContentType("/new_server.json","application/json; charset=UTF-8")).build();
NovaClient clientWithNewServer = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWithNewServer = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, createServer, createServerResponse); responseWithKeystoneAccess, createServer, createServerResponse);
assertEquals(clientWithNewServer.getServerClientForZone("az-1.region-a.geo-1").createServer("test-e92", "1241", assertEquals(clientWithNewServer.getServerClientForZone("az-1.region-a.geo-1").createServer("test-e92", "1241",

View File

@ -57,7 +57,7 @@ public class CreateSecurityGroupIfNeededTest extends BaseNovaClientExpectTest {
Builder<HttpRequest, HttpResponse> builder = ImmutableMap.<HttpRequest, HttpResponse>builder(); Builder<HttpRequest, HttpResponse> builder = ImmutableMap.<HttpRequest, HttpResponse>builder();
builder.put(keystoneAuthWithAccessKeyAndSecretKey, responseWithKeystoneAccess); builder.put(keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess);
builder.put(extensionsOfNovaRequest, extensionsOfNovaResponse); builder.put(extensionsOfNovaRequest, extensionsOfNovaResponse);
int groupId = 2769; int groupId = 2769;
@ -135,7 +135,7 @@ public class CreateSecurityGroupIfNeededTest extends BaseNovaClientExpectTest {
Builder<HttpRequest, HttpResponse> builder = ImmutableMap.<HttpRequest, HttpResponse>builder(); Builder<HttpRequest, HttpResponse> builder = ImmutableMap.<HttpRequest, HttpResponse>builder();
builder.put(keystoneAuthWithAccessKeyAndSecretKey, responseWithKeystoneAccess); builder.put(keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess);
builder.put(extensionsOfNovaRequest, extensionsOfNovaResponse); builder.put(extensionsOfNovaRequest, extensionsOfNovaResponse);
HttpResponse createSecurityGroupResponse = HttpResponse.builder().statusCode(400) HttpResponse createSecurityGroupResponse = HttpResponse.builder().statusCode(400)

View File

@ -54,7 +54,7 @@ public class FindSecurityGroupWithNameAndReturnTrueExpectTest extends BaseNovaCl
HttpResponse listSecurityGroupsResponse = HttpResponse.builder().statusCode(200).payload( HttpResponse listSecurityGroupsResponse = HttpResponse.builder().statusCode(200).payload(
payloadFromResource("/securitygroup_list.json")).build(); payloadFromResource("/securitygroup_list.json")).build();
NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listSecurityGroups, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listSecurityGroups,
listSecurityGroupsResponse); listSecurityGroupsResponse);
@ -82,7 +82,7 @@ public class FindSecurityGroupWithNameAndReturnTrueExpectTest extends BaseNovaCl
HttpResponse listSecurityGroupsResponse = HttpResponse.builder().statusCode(200).payload( HttpResponse listSecurityGroupsResponse = HttpResponse.builder().statusCode(200).payload(
payloadFromResource("/securitygroup_list.json")).build(); payloadFromResource("/securitygroup_list.json")).build();
NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey, NovaClient clientWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listSecurityGroups, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listSecurityGroups,
listSecurityGroupsResponse); listSecurityGroupsResponse);

View File

@ -47,6 +47,7 @@ public class BaseNovaExpectTest<T> extends BaseRestClientExpectTest<T> {
credential); credential);
keystoneAuthWithAccessKeyAndSecretKey = KeystoneFixture.INSTANCE.initialAuthWithAccessKeyAndSecretKey(identity, keystoneAuthWithAccessKeyAndSecretKey = KeystoneFixture.INSTANCE.initialAuthWithAccessKeyAndSecretKey(identity,
credential); credential);
authToken = KeystoneFixture.INSTANCE.getAuthToken(); authToken = KeystoneFixture.INSTANCE.getAuthToken();
responseWithKeystoneAccess = KeystoneFixture.INSTANCE.responseWithAccess(); responseWithKeystoneAccess = KeystoneFixture.INSTANCE.responseWithAccess();
// now, createContext arg will need tenant prefix // now, createContext arg will need tenant prefix

View File

@ -161,7 +161,7 @@ public class KeystoneAuthenticationModule extends AbstractModule {
*/ */
@Inject(optional = true) @Inject(optional = true)
@Named(KeystoneProperties.CREDENTIAL_TYPE) @Named(KeystoneProperties.CREDENTIAL_TYPE)
String credentialType = CredentialType.API_ACCESS_KEY_CREDENTIALS.toString(); String credentialType = CredentialType.PASSWORD_CREDENTIALS.toString();
@Override @Override
public CredentialType get() { public CredentialType get() {

View File

@ -21,6 +21,7 @@ package org.jclouds.hpcloud.compute;
import static org.jclouds.Constants.PROPERTY_ENDPOINT; import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES; import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
import static org.jclouds.compute.reference.ComputeServiceConstants.PROPERTY_TIMEOUT_NODE_TERMINATED; import static org.jclouds.compute.reference.ComputeServiceConstants.PROPERTY_TIMEOUT_NODE_TERMINATED;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
import static org.jclouds.openstack.nova.v1_1.config.NovaProperties.AUTO_ALLOCATE_FLOATING_IPS; import static org.jclouds.openstack.nova.v1_1.config.NovaProperties.AUTO_ALLOCATE_FLOATING_IPS;
import static org.jclouds.openstack.nova.v1_1.config.NovaProperties.AUTO_GENERATE_KEYPAIRS; import static org.jclouds.openstack.nova.v1_1.config.NovaProperties.AUTO_GENERATE_KEYPAIRS;
@ -42,7 +43,8 @@ public class HPCloudComputePropertiesBuilder extends NovaPropertiesBuilder {
// deallocating ip addresses can take a while // deallocating ip addresses can take a while
properties.setProperty(PROPERTY_TIMEOUT_NODE_TERMINATED, 60 * 1000 + ""); properties.setProperty(PROPERTY_TIMEOUT_NODE_TERMINATED, 60 * 1000 + "");
properties.setProperty(CREDENTIAL_TYPE, "apiAccessKeyCredentials");
properties.setProperty(AUTO_ALLOCATE_FLOATING_IPS, "true"); properties.setProperty(AUTO_ALLOCATE_FLOATING_IPS, "true");
properties.setProperty(AUTO_GENERATE_KEYPAIRS, "true"); properties.setProperty(AUTO_GENERATE_KEYPAIRS, "true");
return properties; return properties;

View File

@ -21,6 +21,8 @@ package org.jclouds.hpcloud.objectstorage;
import static org.jclouds.Constants.PROPERTY_API_VERSION; import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT; import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES; import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE;
import java.util.Properties; import java.util.Properties;
@ -40,12 +42,15 @@ public class HPCloudObjectStoragePropertiesBuilder extends SwiftPropertiesBuilde
@Override @Override
protected Properties defaultProperties() { protected Properties defaultProperties() {
Properties properties = super.defaultProperties(); Properties properties = super.defaultProperties();
properties.setProperty(KeystoneProperties.SERVICE_TYPE, ServiceType.OBJECT_STORE);
// TODO: this doesn't actually do anything yet.
properties.setProperty(KeystoneProperties.VERSION, "2.0");
properties.setProperty(PROPERTY_ISO3166_CODES, "US-NV"); properties.setProperty(PROPERTY_ISO3166_CODES, "US-NV");
properties.setProperty(PROPERTY_ENDPOINT, "https://region-a.geo-1.identity.hpcloudsvc.com:35357"); properties.setProperty(PROPERTY_ENDPOINT, "https://region-a.geo-1.identity.hpcloudsvc.com:35357");
properties.setProperty(PROPERTY_API_VERSION, "1.0"); properties.setProperty(PROPERTY_API_VERSION, "1.0");
properties.setProperty(SERVICE_TYPE, ServiceType.OBJECT_STORE);
// TODO: this doesn't actually do anything yet.
properties.setProperty(KeystoneProperties.VERSION, "2.0");
properties.setProperty(CREDENTIAL_TYPE, "apiAccessKeyCredentials");
return properties; return properties;
} }