break up acceptance tests
diff --git a/acceptance/openstack/blockstorage/v1/.volumes_test.go.swp b/acceptance/openstack/blockstorage/v1/.volumes_test.go.swp
new file mode 100644
index 0000000..1af1ed0
--- /dev/null
+++ b/acceptance/openstack/blockstorage/v1/.volumes_test.go.swp
Binary files differ
diff --git a/acceptance/openstack/blockstorage/v1/blockstorage_test.go.bak b/acceptance/openstack/blockstorage/v1/blockstorage_test.go.bak
new file mode 100644
index 0000000..aaabac1
--- /dev/null
+++ b/acceptance/openstack/blockstorage/v1/blockstorage_test.go.bak
@@ -0,0 +1,213 @@
+// +build acceptance
+
+package openstack
+
+import (
+ "fmt"
+ blockstorage "github.com/rackspace/gophercloud/openstack/blockstorage/v1"
+ "github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots"
+ "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes"
+ identity "github.com/rackspace/gophercloud/openstack/identity/v2"
+ "github.com/rackspace/gophercloud/openstack/utils"
+ "os"
+ "strconv"
+ "testing"
+ "time"
+)
+
+var numVols = 2
+
+func getClient() (*blockstorage.Client, error) {
+ ao, err := utils.AuthOptions()
+ if err != nil {
+ return nil, err
+ }
+
+ r, err := identity.Authenticate(ao)
+ if err != nil {
+ return nil, err
+ }
+
+ sc, err := identity.GetServiceCatalog(r)
+ if err != nil {
+ return nil, err
+ }
+
+ ces, err := sc.CatalogEntries()
+ if err != nil {
+ return nil, err
+ }
+
+ var eps []identity.Endpoint
+ for _, ce := range ces {
+ if ce.Type == "volume" {
+ eps = ce.Endpoints
+ }
+ }
+
+ region := os.Getenv("OS_REGION_NAME")
+ rep := ""
+ for _, ep := range eps {
+ if ep.Region == region {
+ rep = ep.PublicURL
+ }
+ }
+
+ client := blockstorage.NewClient(rep, r, ao)
+
+ return client, nil
+
+}
+
+func TestVolumes(t *testing.T) {
+ client, err := getClient()
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ var cv volumes.Volume
+ for i := 0; i < numVols; i++ {
+ cv, err := volumes.Create(client, volumes.CreateOpts{
+ "size": 1,
+ "display_name": "test-volume" + strconv.Itoa(i),
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ defer func() {
+ time.Sleep(10000 * time.Millisecond)
+ err = volumes.Delete(client, volumes.DeleteOpts{
+ "id": cv.Id,
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ }()
+ }
+
+ vols, err := volumes.List(client, volumes.ListOpts{
+ "full": true,
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ if len(vols) != numVols {
+ t.Errorf("Expected %d volumes, got %d", numVols, len(vols))
+ return
+ }
+
+ vols, err = volumes.List(client, volumes.ListOpts{
+ "full": false,
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ if len(vols) != numVols {
+ t.Errorf("Expected %d volumes, got %d", numVols, len(vols))
+ return
+ }
+
+ _, err = volumes.Get(client, volumes.GetOpts{
+ "id": cv.Id,
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+}
+
+func TestSnapshots(t *testing.T) {
+ client, err := getClient()
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ var css snapshots.Snapshot
+
+ cv, err := volumes.Create(client, volumes.CreateOpts{
+ "size": 1,
+ "display_name": "test-volume",
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ defer func() {
+ for i := 0; i < 60; i++ {
+ gss, _ := snapshots.Get(client, snapshots.GetOpts{
+ "id": css.Id,
+ })
+ if gss.Status == "" {
+ err = volumes.Delete(client, volumes.DeleteOpts{
+ "id": cv.Id,
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ break
+ }
+ time.Sleep(5000 * time.Millisecond)
+ }
+ }()
+
+ for i := 0; i < 60; i++ {
+ gv, err := volumes.Get(client, volumes.GetOpts{
+ "id": cv.Id,
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ if gv.Status == "available" {
+ break
+ }
+ time.Sleep(2000 * time.Millisecond)
+ }
+
+ css, err = snapshots.Create(client, snapshots.CreateOpts{
+ "volume_id": cv.Id,
+ "display_name": "test-snapshot",
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ defer func() {
+ for i := 0; i < 60; i++ {
+ gss, err := snapshots.Get(client, snapshots.GetOpts{
+ "id": css.Id,
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ if gss.Status == "available" {
+ err = snapshots.Delete(client, snapshots.DeleteOpts{
+ "id": css.Id,
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ break
+ }
+ time.Sleep(2000 * time.Millisecond)
+ }
+ }()
+
+ lss, err := snapshots.List(client, snapshots.ListOpts{
+ Full: true,
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+}
diff --git a/acceptance/openstack/blockstorage/v1/snapshots_test.go b/acceptance/openstack/blockstorage/v1/snapshots_test.go
new file mode 100644
index 0000000..b7b1f99
--- /dev/null
+++ b/acceptance/openstack/blockstorage/v1/snapshots_test.go
@@ -0,0 +1 @@
+package v1
diff --git a/acceptance/openstack/blockstorage/v1/volumes_test.go b/acceptance/openstack/blockstorage/v1/volumes_test.go
new file mode 100644
index 0000000..37d64d4
--- /dev/null
+++ b/acceptance/openstack/blockstorage/v1/volumes_test.go
@@ -0,0 +1,75 @@
+// +build acceptance blockstorage
+
+package v1
+
+import (
+ "os"
+ "strconv"
+ "testing"
+
+ "github.com/rackspace/gophercloud"
+ "github.com/rackspace/gophercloud/openstack"
+ "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes"
+ "github.com/rackspace/gophercloud/openstack/utils"
+ "github.com/rackspace/gophercloud/pagination"
+)
+
+var numVols = 1
+
+func newClient() (*gophercloud.ServiceClient, error) {
+ ao, err := utils.AuthOptions()
+ if err != nil {
+ return nil, err
+ }
+
+ client, err := openstack.AuthenticatedClient(ao)
+ if err != nil {
+ return nil, err
+ }
+
+ return openstack.NewBlockStorageV1(client, gophercloud.EndpointOpts{
+ Region: os.Getenv("OS_REGION_NAME"),
+ })
+}
+
+func TestVolumes(t *testing.T) {
+ client, err := newClient()
+ if err != nil {
+ t.Fatalf("Failed to create Block Storage v1 client: %v", err)
+ }
+
+ for i := 0; i < numVols; i++ {
+ _, err = volumes.Create(client, volumes.VolumeOpts{
+ Size: 1,
+ Name: "gophercloud-test-volume-" + strconv.Itoa(i),
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ } /*
+ defer func() {
+ time.Sleep(10000 * time.Millisecond)
+ err = volumes.Delete(client, volumes.DeleteOpts{
+ "id": cv.Id,
+ })
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ }()
+ */
+ }
+
+ pager := volumes.List(client, volumes.ListOpts{})
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ err = pager.EachPage(func(page pagination.Page) (bool, error) {
+ vols, err := volumes.ExtractVolumes(page)
+ if len(vols) != numVols {
+ t.Errorf("Expected %d volumes, got %d", numVols, len(vols))
+ }
+ return true, err
+ })
+}