Adding initial LBaaS acceptance tests
diff --git a/acceptance/openstack/networking/v2/extensions/lbaas/member_test.go b/acceptance/openstack/networking/v2/extensions/lbaas/member_test.go
new file mode 100644
index 0000000..03e7a52
--- /dev/null
+++ b/acceptance/openstack/networking/v2/extensions/lbaas/member_test.go
@@ -0,0 +1,93 @@
+// +build acceptance networking lbaasmember
+
+package lbaas
+
+import (
+ "testing"
+
+ base "github.com/rackspace/gophercloud/acceptance/openstack/networking/v2"
+ "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/members"
+ "github.com/rackspace/gophercloud/pagination"
+ th "github.com/rackspace/gophercloud/testhelper"
+)
+
+func TestAll(t *testing.T) {
+ base.Setup(t)
+ defer base.Teardown()
+
+ // setup
+ networkID, subnetID := SetupTopology(t)
+ poolID := CreatePool(t, subnetID)
+
+ // create member
+ memberID := createMember(t, poolID)
+
+ // list members
+ listMembers(t)
+
+ // update member
+ updateMember(t, memberID)
+
+ // get member
+ getMember(t, memberID)
+
+ // delete member
+ deleteMember(t, memberID)
+
+ // teardown
+ DeletePool(t, poolID)
+ DeleteTopology(t, networkID)
+}
+
+func createMember(t *testing.T, poolID string) string {
+ m, err := members.Create(base.Client, members.CreateOpts{
+ Address: "192.168.199.1",
+ ProtocolPort: 8080,
+ PoolID: poolID,
+ }).Extract()
+
+ th.AssertNoErr(t, err)
+
+ t.Logf("Created member: ID [%s] Status [%s] Weight [%d] Address [%s] Port [%d]",
+ m.ID, m.Status, m.Weight, m.Address, m.ProtocolPort)
+
+ return m.ID
+}
+
+func listMembers(t *testing.T) {
+ members.List(base.Client, members.ListOpts{}).EachPage(func(page pagination.Page) (bool, error) {
+ memberList, err := members.ExtractMembers(page)
+ if err != nil {
+ t.Errorf("Failed to extract members: %v", err)
+ return false, err
+ }
+
+ for _, m := range memberList {
+ t.Logf("Listing member: ID [%s] Status [%s]", m.ID, m.Status)
+ }
+
+ return true, nil
+ })
+}
+
+func updateMember(t *testing.T, memberID string) {
+ m, err := members.Update(base.Client, memberID, members.UpdateOpts{AdminStateUp: true}).Extract()
+
+ th.AssertNoErr(t, err)
+
+ t.Logf("Updated member ID [%s]", m.ID)
+}
+
+func getMember(t *testing.T, memberID string) {
+ m, err := members.Get(base.Client, memberID).Extract()
+
+ th.AssertNoErr(t, err)
+
+ t.Logf("Getting member ID [%s]", m.ID)
+}
+
+func deleteMember(t *testing.T, memberID string) {
+ res := members.Delete(base.Client, memberID)
+ th.AssertNoErr(t, res.Err)
+ t.Logf("Deleted member %s", memberID)
+}
diff --git a/acceptance/openstack/networking/v2/extensions/lbaas/monitor_test.go b/acceptance/openstack/networking/v2/extensions/lbaas/monitor_test.go
new file mode 100644
index 0000000..f5a7df7
--- /dev/null
+++ b/acceptance/openstack/networking/v2/extensions/lbaas/monitor_test.go
@@ -0,0 +1 @@
+package lbaas
diff --git a/acceptance/openstack/networking/v2/extensions/lbaas/pkg.go b/acceptance/openstack/networking/v2/extensions/lbaas/pkg.go
new file mode 100644
index 0000000..f5a7df7
--- /dev/null
+++ b/acceptance/openstack/networking/v2/extensions/lbaas/pkg.go
@@ -0,0 +1 @@
+package lbaas
diff --git a/acceptance/openstack/networking/v2/extensions/lbaas/pool_test.go b/acceptance/openstack/networking/v2/extensions/lbaas/pool_test.go
new file mode 100644
index 0000000..891b2d2
--- /dev/null
+++ b/acceptance/openstack/networking/v2/extensions/lbaas/pool_test.go
@@ -0,0 +1,59 @@
+package lbaas
+
+import (
+ "testing"
+
+ base "github.com/rackspace/gophercloud/acceptance/openstack/networking/v2"
+ "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/pools"
+ "github.com/rackspace/gophercloud/openstack/networking/v2/networks"
+ "github.com/rackspace/gophercloud/openstack/networking/v2/subnets"
+ th "github.com/rackspace/gophercloud/testhelper"
+)
+
+func SetupTopology(t *testing.T) (string, string) {
+ // create network
+ n, err := networks.Create(base.Client, networks.CreateOpts{Name: "tmp_network"}).Extract()
+ th.AssertNoErr(t, err)
+
+ t.Logf("Created network %s", n.ID)
+
+ // create subnet
+ s, err := subnets.Create(base.Client, subnets.CreateOpts{
+ NetworkID: n.ID,
+ CIDR: "192.168.199.0/24",
+ IPVersion: subnets.IPv4,
+ Name: "tmp_subnet",
+ }).Extract()
+ th.AssertNoErr(t, err)
+
+ t.Logf("Created subnet %s", s.ID)
+
+ return n.ID, s.ID
+}
+
+func DeleteTopology(t *testing.T, networkID string) {
+ res := networks.Delete(base.Client, networkID)
+ th.AssertNoErr(t, res.Err)
+ t.Logf("Deleted network %s", networkID)
+}
+
+func CreatePool(t *testing.T, subnetID string) string {
+ p, err := pools.Create(base.Client, pools.CreateOpts{
+ LBMethod: pools.LBMethodRoundRobin,
+ Protocol: "HTTP",
+ Name: "tmp_pool",
+ SubnetID: subnetID,
+ }).Extract()
+
+ th.AssertNoErr(t, err)
+
+ t.Logf("Created pool %s", p.ID)
+
+ return p.ID
+}
+
+func DeletePool(t *testing.T, poolID string) {
+ res := pools.Delete(base.Client, poolID)
+ th.AssertNoErr(t, res.Err)
+ t.Logf("Deleted pool %s", poolID)
+}
diff --git a/acceptance/openstack/networking/v2/extensions/lbaas/vip_test.go b/acceptance/openstack/networking/v2/extensions/lbaas/vip_test.go
new file mode 100644
index 0000000..f5a7df7
--- /dev/null
+++ b/acceptance/openstack/networking/v2/extensions/lbaas/vip_test.go
@@ -0,0 +1 @@
+package lbaas