Adding initial acceptance tests
diff --git a/acceptance/rackspace/blockstorage/v1/common.go b/acceptance/rackspace/blockstorage/v1/common.go
new file mode 100644
index 0000000..cf247d3
--- /dev/null
+++ b/acceptance/rackspace/blockstorage/v1/common.go
@@ -0,0 +1,33 @@
+package v1
+
+import (
+ "testing"
+
+ "github.com/rackspace/gophercloud"
+ "github.com/rackspace/gophercloud/openstack/utils"
+ "github.com/rackspace/gophercloud/rackspace"
+ th "github.com/rackspace/gophercloud/testhelper"
+)
+
+func newClient() (*gophercloud.ServiceClient, error) {
+ opts, err := utils.AuthOptions()
+ if err != nil {
+ return nil, err
+ }
+
+ provider, err := rackspace.AuthenticatedClient(opts)
+ if err != nil {
+ return nil, err
+ }
+
+ return rackspace.NewBlockStorageV1(provider, gophercloud.EndpointOpts{
+ Region: "IAD",
+ })
+}
+
+func setup(t *testing.T) *gophercloud.ServiceClient {
+ client, err := newClient()
+ th.AssertNoErr(t, err)
+
+ return client
+}
diff --git a/acceptance/rackspace/blockstorage/v1/snapshot_test.go b/acceptance/rackspace/blockstorage/v1/snapshot_test.go
new file mode 100644
index 0000000..b7b1f99
--- /dev/null
+++ b/acceptance/rackspace/blockstorage/v1/snapshot_test.go
@@ -0,0 +1 @@
+package v1
diff --git a/acceptance/rackspace/blockstorage/v1/volume_test.go b/acceptance/rackspace/blockstorage/v1/volume_test.go
new file mode 100644
index 0000000..b7b1f99
--- /dev/null
+++ b/acceptance/rackspace/blockstorage/v1/volume_test.go
@@ -0,0 +1 @@
+package v1
diff --git a/acceptance/rackspace/blockstorage/v1/volume_type_test.go b/acceptance/rackspace/blockstorage/v1/volume_type_test.go
new file mode 100644
index 0000000..9673e92
--- /dev/null
+++ b/acceptance/rackspace/blockstorage/v1/volume_type_test.go
@@ -0,0 +1,44 @@
+package v1
+
+import (
+ "testing"
+
+ "github.com/rackspace/gophercloud"
+ "github.com/rackspace/gophercloud/pagination"
+ "github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumetypes"
+ th "github.com/rackspace/gophercloud/testhelper"
+)
+
+func TestAll(t *testing.T) {
+ client := setup(t)
+
+ t.Logf("Listing volume types")
+ id := testList(t, client)
+
+ t.Logf("Getting volume type %s", id)
+ testGet(t, client, id)
+}
+
+func testList(t *testing.T, client *gophercloud.ServiceClient) string {
+ var lastID string
+
+ volumetypes.List(client).EachPage(func(page pagination.Page) (bool, error) {
+ typeList, err := volumetypes.ExtractVolumeTypes(page)
+ th.AssertNoErr(t, err)
+
+ for _, vt := range typeList {
+ t.Logf("Volume type: ID [%s] Name [%s]", vt.ID, vt.Name)
+ lastID = vt.ID
+ }
+
+ return true, nil
+ })
+
+ return lastID
+}
+
+func testGet(t *testing.T, client *gophercloud.ServiceClient, id string) {
+ vt, err := volumetypes.Get(client, id).Extract()
+ th.AssertNoErr(t, err)
+ t.Logf("Volume: ID [%s] Name [%s]", vt.ID, vt.Name)
+}