From 56aa764b947fac3a0bb94fedcc049b5aaeeb2e73 Mon Sep 17 00:00:00 2001 From: Guillaume Giamarchi Date: Wed, 1 Apr 2015 11:27:56 +0200 Subject: [PATCH] Add floating IP association in aceptance tests --- .../resource_openstack_compute_floatingip_v2_test.go | 9 +++++++-- ...source_openstack_networking_floatingip_v2_test.go | 12 +++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/builtin/providers/openstack/resource_openstack_compute_floatingip_v2_test.go b/builtin/providers/openstack/resource_openstack_compute_floatingip_v2_test.go index c246d1a51..a298a87d1 100644 --- a/builtin/providers/openstack/resource_openstack_compute_floatingip_v2_test.go +++ b/builtin/providers/openstack/resource_openstack_compute_floatingip_v2_test.go @@ -81,6 +81,11 @@ func testAccCheckComputeV2FloatingIPExists(t *testing.T, n string, kp *floatingi } } -var testAccComputeV2FloatingIP_basic = fmt.Sprintf(` +var testAccComputeV2FloatingIP_basic = ` resource "openstack_compute_floatingip_v2" "foo" { - }`) + } + + resource "openstack_compute_instance_v2" "bar" { + name = "terraform-acc-floating-ip-test" + floating_ip = "${openstack_compute_floatingip_v2.foo.address}" + }` diff --git a/builtin/providers/openstack/resource_openstack_networking_floatingip_v2_test.go b/builtin/providers/openstack/resource_openstack_networking_floatingip_v2_test.go index cd08ea512..5c8ae38e3 100644 --- a/builtin/providers/openstack/resource_openstack_networking_floatingip_v2_test.go +++ b/builtin/providers/openstack/resource_openstack_networking_floatingip_v2_test.go @@ -81,9 +81,11 @@ func testAccCheckNetworkingV2FloatingIPExists(t *testing.T, n string, kp *floati } } -var testAccNetworkingV2FloatingIP_basic = fmt.Sprintf(` +var testAccNetworkingV2FloatingIP_basic = ` resource "openstack_networking_floatingip_v2" "foo" { - region = "%s" - pool = "%s" - }`, - OS_REGION_NAME, OS_POOL_NAME) + } + + resource "openstack_compute_instance_v2" "bar" { + name = "terraform-acc-floating-ip-test" + floating_ip = "${openstack_networking_floatingip_v2.foo.address}" + }`