Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 1 | // +build acceptance |
| 2 | |
| 3 | package v1 |
| 4 | |
| 5 | import ( |
Jon Perritt | 2a7797d | 2014-10-21 15:08:43 -0500 | [diff] [blame] | 6 | "os" |
Ash Wilson | 0036cbf | 2014-10-24 15:29:48 -0400 | [diff] [blame] | 7 | "testing" |
Jon Perritt | 2a7797d | 2014-10-21 15:08:43 -0500 | [diff] [blame] | 8 | |
Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame] | 9 | "github.com/gophercloud/gophercloud" |
| 10 | "github.com/gophercloud/gophercloud/openstack" |
| 11 | th "github.com/gophercloud/gophercloud/testhelper" |
Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 12 | ) |
| 13 | |
| 14 | var metadata = map[string]string{"gopher": "cloud"} |
| 15 | |
Ash Wilson | 0036cbf | 2014-10-24 15:29:48 -0400 | [diff] [blame] | 16 | func newClient(t *testing.T) *gophercloud.ServiceClient { |
Jamie Hannaford | 390555a | 2014-10-22 17:04:03 +0200 | [diff] [blame] | 17 | ao, err := openstack.AuthOptionsFromEnv() |
Jon Perritt | 2a7797d | 2014-10-21 15:08:43 -0500 | [diff] [blame] | 18 | th.AssertNoErr(t, err) |
Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 19 | |
| 20 | client, err := openstack.AuthenticatedClient(ao) |
Jon Perritt | 2a7797d | 2014-10-21 15:08:43 -0500 | [diff] [blame] | 21 | th.AssertNoErr(t, err) |
Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 22 | |
Jon Perritt | 2b36fa3 | 2014-10-24 15:44:23 -0500 | [diff] [blame] | 23 | c, err := openstack.NewObjectStorageV1(client, gophercloud.EndpointOpts{ |
Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 24 | Region: os.Getenv("OS_REGION_NAME"), |
Ash Wilson | 0036cbf | 2014-10-24 15:29:48 -0400 | [diff] [blame] | 25 | }) |
Jon Perritt | 2b36fa3 | 2014-10-24 15:44:23 -0500 | [diff] [blame] | 26 | th.AssertNoErr(t, err) |
| 27 | return c |
Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 28 | } |