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 | |
Krzysztof Szukiełojć | 3f41d08 | 2017-05-07 14:43:06 +0200 | [diff] [blame^] | 9 | "gerrit.mcp.mirantis.net/debian/gophercloud.git" |
Krzysztof Szukiełojć | 24a29ce | 2017-05-07 14:24:02 +0200 | [diff] [blame] | 10 | "gerrit.mcp.mirantis.net/debian/gophercloud.git/openstack" |
| 11 | th "gerrit.mcp.mirantis.net/debian/gophercloud.git/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 | } |