From 3e43eb54970a45e97f0cea2b74f8642874987cae Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Mon, 20 Oct 2014 12:02:37 -0700 Subject: [PATCH] provider/consul: Fixing test harness --- builtin/providers/consul/resource_consul_keys_test.go | 2 +- builtin/providers/consul/resource_provider_test.go | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/builtin/providers/consul/resource_consul_keys_test.go b/builtin/providers/consul/resource_consul_keys_test.go index 2f52be83b..592813310 100644 --- a/builtin/providers/consul/resource_consul_keys_test.go +++ b/builtin/providers/consul/resource_consul_keys_test.go @@ -78,7 +78,7 @@ func testAccCheckConsulKeysValue(n, attr, val string) resource.TestCheckFunc { const testAccConsulKeysConfig = ` resource "consul_keys" "app" { - datacenter = "nyc1" + datacenter = "nyc3" key { name = "time" path = "global/time" diff --git a/builtin/providers/consul/resource_provider_test.go b/builtin/providers/consul/resource_provider_test.go index 5e2746f98..ad2b29898 100644 --- a/builtin/providers/consul/resource_provider_test.go +++ b/builtin/providers/consul/resource_provider_test.go @@ -3,6 +3,7 @@ package consul import ( "testing" + "github.com/armon/consul-api" "github.com/hashicorp/terraform/config" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/terraform" @@ -16,6 +17,13 @@ func init() { testAccProviders = map[string]terraform.ResourceProvider{ "consul": testAccProvider, } + + // Use the demo address for the acceptance tests + testAccProvider.ConfigureFunc = func(d *schema.ResourceData) (interface{}, error) { + conf := consulapi.DefaultConfig() + conf.Address = "demo.consul.io:80" + return consulapi.NewClient(conf) + } } func TestResourceProvider(t *testing.T) { @@ -33,7 +41,7 @@ func TestResourceProvider_Configure(t *testing.T) { raw := map[string]interface{}{ "address": "demo.consul.io:80", - "datacenter": "nyc1", + "datacenter": "nyc3", } rawConfig, err := config.NewRawConfig(raw)