blob: 4e2f9b517ccd1d4a00fe4239ded139910832d5dc [file] [log] [blame]
Jon Perrittf050a4c2014-09-11 15:01:17 -05001// +build acceptance
2
3package v1
4
5import (
Jon Perritt2a7797d2014-10-21 15:08:43 -05006 "os"
7
Jon Perrittf050a4c2014-09-11 15:01:17 -05008 "github.com/rackspace/gophercloud"
9 "github.com/rackspace/gophercloud/openstack"
10 "github.com/rackspace/gophercloud/openstack/utils"
Jon Perritt2a7797d2014-10-21 15:08:43 -050011 th "github.com/rackspace/gophercloud/testhelper"
Jon Perrittf050a4c2014-09-11 15:01:17 -050012)
13
14var metadata = map[string]string{"gopher": "cloud"}
15
16func newClient() (*gophercloud.ServiceClient, error) {
17 ao, err := utils.AuthOptions()
Jon Perritt2a7797d2014-10-21 15:08:43 -050018 th.AssertNoErr(t, err)
Jon Perrittf050a4c2014-09-11 15:01:17 -050019
20 client, err := openstack.AuthenticatedClient(ao)
Jon Perritt2a7797d2014-10-21 15:08:43 -050021 th.AssertNoErr(t, err)
Jon Perrittf050a4c2014-09-11 15:01:17 -050022
Jon Perritt2a7797d2014-10-21 15:08:43 -050023 return openstack.NewObjectStorageV1(client, gophercloud.EndpointOpts{
Jon Perrittf050a4c2014-09-11 15:01:17 -050024 Region: os.Getenv("OS_REGION_NAME"),
Jon Perritt2a7797d2014-10-21 15:08:43 -050025 }), nil
Jon Perrittf050a4c2014-09-11 15:01:17 -050026}