blob: 96a3f09f827baf96e70af35a62f2d8e7c01e1d5c [file] [log] [blame]
Jamie Hannafordaf209d12014-10-22 12:37:48 +02001package v1
2
3import (
4 "testing"
5
6 "github.com/rackspace/gophercloud"
Jamie Hannafordaf209d12014-10-22 12:37:48 +02007 "github.com/rackspace/gophercloud/rackspace"
8 th "github.com/rackspace/gophercloud/testhelper"
9)
10
11func newClient() (*gophercloud.ServiceClient, error) {
Jamie Hannaford29149be2014-10-23 14:49:44 +020012 opts, err := rackspace.AuthOptionsFromEnv()
Jamie Hannafordaf209d12014-10-22 12:37:48 +020013 if err != nil {
14 return nil, err
15 }
16
17 provider, err := rackspace.AuthenticatedClient(opts)
18 if err != nil {
19 return nil, err
20 }
21
22 return rackspace.NewBlockStorageV1(provider, gophercloud.EndpointOpts{
23 Region: "IAD",
24 })
25}
26
27func setup(t *testing.T) *gophercloud.ServiceClient {
28 client, err := newClient()
29 th.AssertNoErr(t, err)
30
31 return client
32}