Backpedal in the acceptance tests.
diff --git a/acceptance/rackspace/client_test.go b/acceptance/rackspace/client_test.go
index 825e3ac..2874531 100644
--- a/acceptance/rackspace/client_test.go
+++ b/acceptance/rackspace/client_test.go
@@ -6,16 +6,15 @@
"testing"
"github.com/rackspace/gophercloud/rackspace"
+ th "github.com/rackspace/gophercloud/testhelper"
)
func TestAuthenticatedClient(t *testing.T) {
// Obtain credentials from the environment.
ao, err := rackspace.AuthOptionsFromEnv()
- if err != nil {
- t.Fatalf("Unable to acquire credentials: %v", err)
- }
+ th.AssertNoErr(t, err)
- client, err := rackspace.AuthenticatedClient(ao)
+ client, err := rackspace.AuthenticatedClient(tools.OnlyRS(ao))
if err != nil {
t.Fatalf("Unable to authenticate: %v", err)
}
diff --git a/acceptance/rackspace/compute/v2/compute_test.go b/acceptance/rackspace/compute/v2/compute_test.go
index 3419c10..3d628f2 100644
--- a/acceptance/rackspace/compute/v2/compute_test.go
+++ b/acceptance/rackspace/compute/v2/compute_test.go
@@ -12,17 +12,18 @@
func newClient() (*gophercloud.ServiceClient, error) {
// Obtain credentials from the environment.
- options := gophercloud.AuthOptions{
- Username: os.Getenv("RS_USERNAME"),
- APIKey: os.Getenv("RS_APIKEY"),
+ options, err := rackspace.AuthOptionsFromEnv()
+ if err != nil {
+ return err
}
+ options = tools.OnlyRS(options)
region := os.Getenv("RS_REGION")
if options.Username == "" {
return nil, errors.New("Please provide a Rackspace username as RS_USERNAME.")
}
if options.APIKey == "" {
- return nil, errors.New("Please provide a Rackspace API key as RS_APIKEY.")
+ return nil, errors.New("Please provide a Rackspace API key as RS_API_KEY.")
}
if region == "" {
return nil, errors.New("Please provide a Rackspace region as RS_REGION.")
diff --git a/acceptance/rackspace/identity/v2/identity_test.go b/acceptance/rackspace/identity/v2/identity_test.go
index 019a9e6..576e40f 100644
--- a/acceptance/rackspace/identity/v2/identity_test.go
+++ b/acceptance/rackspace/identity/v2/identity_test.go
@@ -3,7 +3,6 @@
package v2
import (
- "os"
"testing"
"github.com/rackspace/gophercloud"
@@ -13,16 +12,15 @@
func rackspaceAuthOptions(t *testing.T) gophercloud.AuthOptions {
// Obtain credentials from the environment.
- options := gophercloud.AuthOptions{
- Username: os.Getenv("RS_USERNAME"),
- APIKey: os.Getenv("RS_APIKEY"),
- }
+ options, err := rackspace.AuthOptionsFromEnv()
+ th.AssertNoErr(t, err)
+ options = tools.OnlyRS(options)
if options.Username == "" {
t.Fatal("Please provide a Rackspace username as RS_USERNAME.")
}
if options.APIKey == "" {
- t.Fatal("Please provide a Rackspace API key as RS_APIKEY.")
+ t.Fatal("Please provide a Rackspace API key as RS_API_KEY.")
}
return options
diff --git a/acceptance/rackspace/objectstorage/v1/common.go b/acceptance/rackspace/objectstorage/v1/common.go
index 6422203..59457c1 100644
--- a/acceptance/rackspace/objectstorage/v1/common.go
+++ b/acceptance/rackspace/objectstorage/v1/common.go
@@ -13,16 +13,15 @@
func rackspaceAuthOptions(t *testing.T) gophercloud.AuthOptions {
// Obtain credentials from the environment.
- options := gophercloud.AuthOptions{
- Username: os.Getenv("RS_USERNAME"),
- APIKey: os.Getenv("RS_APIKEY"),
- }
+ options, err := rackspace.AuthOptionsFromEnv()
+ th.AssertNoErr(t, err)
+ options = tools.OnlyRS(options)
if options.Username == "" {
t.Fatal("Please provide a Rackspace username as RS_USERNAME.")
}
if options.APIKey == "" {
- t.Fatal("Please provide a Rackspace API key as RS_APIKEY.")
+ t.Fatal("Please provide a Rackspace API key as RS_API_KEY.")
}
return options