Finalizing most acceptance tests
diff --git a/acceptance/rackspace/db/v1/instance_test.go b/acceptance/rackspace/db/v1/instance_test.go
index eb745e2..4bc44ab 100644
--- a/acceptance/rackspace/db/v1/instance_test.go
+++ b/acceptance/rackspace/db/v1/instance_test.go
@@ -3,13 +3,15 @@
package v1
import (
+ "testing"
+
"github.com/rackspace/gophercloud/acceptance/tools"
"github.com/rackspace/gophercloud/pagination"
"github.com/rackspace/gophercloud/rackspace/db/v1/instances"
th "github.com/rackspace/gophercloud/testhelper"
)
-func TestRunner(t *testingT) {
+func TestRunner(t *testing.T) {
c := newContext(t)
// FLAVOR tests
@@ -49,7 +51,7 @@
c.deleteConfigGrp()
// DATABASE tests
- c.createDB()
+ c.createDBs()
c.listDBs()
// USER tests
@@ -65,7 +67,7 @@
// TEARDOWN
c.deleteUsers()
c.deleteDBs()
- c.deleteInstance(id)
+ c.deleteInstance()
}
func (c context) createInstance() {
@@ -78,9 +80,9 @@
instance, err := instances.Create(c.client, opts).Extract()
th.AssertNoErr(c.test, err)
- c.Logf("Restarting %s. Waiting...", id)
- c.WaitUntilActive(id)
- c.Logf("Created DB %#v", instance)
+ c.Logf("Restarting %s. Waiting...", instance.ID)
+ c.WaitUntilActive(instance.ID)
+ c.Logf("Created DB %#v", instance.ID)
c.instanceID = instance.ID
}
@@ -92,14 +94,14 @@
instanceList, err := instances.ExtractInstances(page)
c.AssertNoErr(err)
- for _, n := range networkList {
+ for _, instance := range instanceList {
c.Logf("Instance: %#v", instance)
}
return true, nil
})
- c.CheckNoErr(err)
+ c.AssertNoErr(err)
}
func (c context) getInstance() {
@@ -115,7 +117,7 @@
}
func (c context) enableRootUser() {
- err := instances.EnableRootUser(c.client, c.instanceID).ExtractErr()
+ _, err := instances.EnableRootUser(c.client, c.instanceID).Extract()
c.AssertNoErr(err)
c.Logf("Enabled root user on %s", c.instanceID)
}
@@ -128,7 +130,7 @@
func (c context) restartInstance() {
id := c.instanceID
- err := instances.Restart(c.client, id).ExtractErr()
+ err := instances.RestartService(c.client, id).ExtractErr()
c.AssertNoErr(err)
c.Logf("Restarting %s. Waiting...", id)
c.WaitUntilActive(id)
@@ -137,7 +139,7 @@
func (c context) resizeInstance() {
id := c.instanceID
- err := instances.Resize(c.client, id, "2").ExtractErr()
+ err := instances.ResizeInstance(c.client, id, "2").ExtractErr()
c.AssertNoErr(err)
c.Logf("Resizing %s. Waiting...", id)
c.WaitUntilActive(id)
@@ -146,7 +148,7 @@
func (c context) resizeVol() {
id := c.instanceID
- err := instances.ResizeVol(c.client, id, 2).ExtractErr()
+ err := instances.ResizeVolume(c.client, id, 2).ExtractErr()
c.AssertNoErr(err)
c.Logf("Resizing volume of %s. Waiting...", id)
c.WaitUntilActive(id)