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
+	})
+}
