rackconnect cloud networks acceptance tests
diff --git a/acceptance/rackspace/rackconnect/v3/cloudnetworks_test.go b/acceptance/rackspace/rackconnect/v3/cloudnetworks_test.go
new file mode 100644
index 0000000..f57d86a
--- /dev/null
+++ b/acceptance/rackspace/rackconnect/v3/cloudnetworks_test.go
@@ -0,0 +1,36 @@
+// +build acceptance
+
+package v3
+
+import (
+ "fmt"
+ "testing"
+
+ "github.com/rackspace/gophercloud"
+ "github.com/rackspace/gophercloud/rackspace/rackconnect/v3/cloudnetworks"
+ th "github.com/rackspace/gophercloud/testhelper"
+)
+
+func TestCloudNetworks(t *testing.T) {
+ c := newClient(t)
+ cnID := testList(t, c)
+ testGet(t, c, cnID)
+}
+
+func testList(t *testing.T, c *gophercloud.ServiceClient) string {
+ allPages, err := cloudnetworks.List(c).AllPages()
+ th.AssertNoErr(t, err)
+ allcn, err := cloudnetworks.ExtractCloudNetworks(allPages)
+ fmt.Printf("Listing all cloud networks: %+v\n", allcn)
+ var cnID string
+ if len(allcn) > 0 {
+ cnID = allcn[0].ID
+ }
+ return cnID
+}
+
+func testGet(t *testing.T, c *gophercloud.ServiceClient, id string) {
+ cn, err := cloudnetworks.Get(c, id).Extract()
+ th.AssertNoErr(t, err)
+ fmt.Printf("Retrieved cloud network: %+v\n", cn)
+}
diff --git a/acceptance/rackspace/rackconnect/v3/common.go b/acceptance/rackspace/rackconnect/v3/common.go
new file mode 100644
index 0000000..8c75314
--- /dev/null
+++ b/acceptance/rackspace/rackconnect/v3/common.go
@@ -0,0 +1,26 @@
+// +build acceptance
+
+package v3
+
+import (
+ "os"
+ "testing"
+
+ "github.com/rackspace/gophercloud"
+ "github.com/rackspace/gophercloud/rackspace"
+ th "github.com/rackspace/gophercloud/testhelper"
+)
+
+func newClient(t *testing.T) *gophercloud.ServiceClient {
+ ao, err := rackspace.AuthOptionsFromEnv()
+ th.AssertNoErr(t, err)
+
+ client, err := rackspace.AuthenticatedClient(ao)
+ th.AssertNoErr(t, err)
+
+ c, err := rackspace.NewRackConnectV3(client, gophercloud.EndpointOpts{
+ Region: os.Getenv("RS_REGION_NAME"),
+ })
+ th.AssertNoErr(t, err)
+ return c
+}