Modifying acceptance tests to support alternative network name
diff --git a/acceptance/openstack/compute/v2/compute_test.go b/acceptance/openstack/compute/v2/compute_test.go
index 33e49fe..c1bbf79 100644
--- a/acceptance/openstack/compute/v2/compute_test.go
+++ b/acceptance/openstack/compute/v2/compute_test.go
@@ -56,6 +56,9 @@
// FlavorIDResize contains the ID of a different flavor available on the same OpenStack installation, that is distinct
// from FlavorID.
FlavorIDResize string
+
+ // NetworkName is the name of a network to launch the instance on.
+ NetworkName string
}
// ComputeChoicesFromEnv populates a ComputeChoices struct from environment variables.
@@ -64,6 +67,7 @@
imageID := os.Getenv("OS_IMAGE_ID")
flavorID := os.Getenv("OS_FLAVOR_ID")
flavorIDResize := os.Getenv("OS_FLAVOR_ID_RESIZE")
+ networkName := os.Getenv("OS_NETWORK_NAME")
missing := make([]string, 0, 3)
if imageID == "" {
@@ -75,6 +79,9 @@
if flavorIDResize == "" {
missing = append(missing, "OS_FLAVOR_ID_RESIZE")
}
+ if networkName == "" {
+ networkName = "public"
+ }
notDistinct := ""
if flavorID == flavorIDResize {
@@ -93,5 +100,5 @@
return nil, fmt.Errorf(text)
}
- return &ComputeChoices{ImageID: imageID, FlavorID: flavorID, FlavorIDResize: flavorIDResize}, nil
+ return &ComputeChoices{ImageID: imageID, FlavorID: flavorID, FlavorIDResize: flavorIDResize, NetworkName: networkName}, nil
}