aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2018-05-04 11:32:10 +0200
committerStefan Majewsky <majewsky@gmx.net>2018-05-04 11:32:10 +0200
commitbc7e256d490a179c5636a5cbdfae12ec1e2b08dc (patch)
tree4ec3ce3659d1dd83c3bed3eee235d8b6520fdf71
parent98778b85e01c13d7ede8c76e35c8c954fb379ec1 (diff)
downloadgo-schwift-bc7e256d490a179c5636a5cbdfae12ec1e2b08dc.tar.gz
make tests work with Keystone auth
-rw-r--r--tests/shared_test.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/shared_test.go b/tests/shared_test.go
index df9092e..36404bd 100644
--- a/tests/shared_test.go
+++ b/tests/shared_test.go
@@ -29,6 +29,7 @@ import (
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack"
"github.com/gophercloud/gophercloud/openstack/objectstorage/v1/swauth"
+ "github.com/gophercloud/utils/openstack/clientconfig"
"github.com/majewsky/schwift"
"github.com/majewsky/schwift/gopherschwift"
)
@@ -41,15 +42,10 @@ func testWithAccount(t *testing.T, testCode func(a *schwift.Account)) {
if stAuth == "" && stUser == "" && stKey == "" {
//option 1: Keystone authentication
- authOptions, err := openstack.AuthOptionsFromEnv()
+ provider, err := clientconfig.AuthenticatedClient(nil)
if err != nil {
- t.Error("missing Swift credentials (need either ST_AUTH, ST_USER, ST_KEY or OS_* variables)")
- t.Error("openstack.AuthOptionsFromEnv returned: " + err.Error())
- return
- }
- provider, err := openstack.AuthenticatedClient(authOptions)
- if err != nil {
- t.Errorf("openstack.AuthenticatedClient returned: " + err.Error())
+ t.Errorf("clientconfig.AuthenticatedClient returned: " + err.Error())
+ t.Error("probably missing Swift credentials (need either ST_AUTH, ST_USER, ST_KEY or OS_* variables)")
return
}
client, err = openstack.NewObjectStorageV1(provider, gophercloud.EndpointOpts{})