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