Layer3 acceptance tests dont use floating-network for subnets (#277)
diff --git a/acceptance/openstack/networking/v2/extensions/layer3/floatingips_test.go b/acceptance/openstack/networking/v2/extensions/layer3/floatingips_test.go
index 952213e..8c1562d 100644
--- a/acceptance/openstack/networking/v2/extensions/layer3/floatingips_test.go
+++ b/acceptance/openstack/networking/v2/extensions/layer3/floatingips_test.go
@@ -9,6 +9,7 @@
networking "github.com/gophercloud/gophercloud/acceptance/openstack/networking/v2"
"github.com/gophercloud/gophercloud/acceptance/tools"
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips"
+ "github.com/gophercloud/gophercloud/openstack/networking/v2/networks"
)
func TestLayer3FloatingIPsList(t *testing.T) {
@@ -44,7 +45,12 @@
t.Fatalf("Unable to get choices: %v", err)
}
- subnet, err := networking.CreateSubnet(t, client, choices.ExternalNetworkID)
+ netid, err := networks.IDFromName(client,chocices.NetworkName)
+ if err != nil {
+ t.Fatalf("Unable to find network id: %v", err)
+ }
+
+ subnet, err := networking.CreateSubnet(t, client, netid)
if err != nil {
t.Fatalf("Unable to create subnet: %v", err)
}
@@ -56,7 +62,7 @@
}
defer DeleteRouter(t, client, router.ID)
- port, err := networking.CreatePort(t, client, choices.ExternalNetworkID, subnet.ID)
+ port, err := networking.CreatePort(t, client, netid, subnet.ID)
if err != nil {
t.Fatalf("Unable to create port: %v", err)
}
diff --git a/acceptance/openstack/networking/v2/extensions/layer3/layer3.go b/acceptance/openstack/networking/v2/extensions/layer3/layer3.go
index 7bc0676..7d3a626 100644
--- a/acceptance/openstack/networking/v2/extensions/layer3/layer3.go
+++ b/acceptance/openstack/networking/v2/extensions/layer3/layer3.go
@@ -245,4 +245,4 @@
return false, nil
})
-}
+}
\ No newline at end of file
diff --git a/acceptance/openstack/networking/v2/extensions/layer3/routers_test.go b/acceptance/openstack/networking/v2/extensions/layer3/routers_test.go
index e0be169..3450ee0 100644
--- a/acceptance/openstack/networking/v2/extensions/layer3/routers_test.go
+++ b/acceptance/openstack/networking/v2/extensions/layer3/routers_test.go
@@ -76,7 +76,12 @@
t.Fatalf("Unable to get choices: %v", err)
}
- subnet, err := networking.CreateSubnet(t, client, choices.ExternalNetworkID)
+ netid, err := networks.IDFromName(client,chocices.NetworkName)
+ if err != nil {
+ t.Fatalf("Unable to find network id: %v", err)
+ }
+
+ subnet, err := networking.CreateSubnet(t, client, netid)
if err != nil {
t.Fatalf("Unable to create subnet: %v", err)
}