github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/builtin/providers/vcd/provider_test.go (about) 1 package vcd 2 3 import ( 4 "os" 5 "testing" 6 7 "github.com/hashicorp/terraform/helper/schema" 8 "github.com/hashicorp/terraform/terraform" 9 ) 10 11 var testAccProviders map[string]terraform.ResourceProvider 12 var testAccProvider *schema.Provider 13 14 func init() { 15 testAccProvider = Provider().(*schema.Provider) 16 testAccProviders = map[string]terraform.ResourceProvider{ 17 "vcd": testAccProvider, 18 } 19 } 20 21 func TestProvider(t *testing.T) { 22 if err := Provider().(*schema.Provider).InternalValidate(); err != nil { 23 t.Fatalf("err: %s", err) 24 } 25 } 26 27 func TestProvider_impl(t *testing.T) { 28 var _ terraform.ResourceProvider = Provider() 29 } 30 31 func testAccPreCheck(t *testing.T) { 32 if v := os.Getenv("VCD_USER"); v == "" { 33 t.Fatal("VCD_USER must be set for acceptance tests") 34 } 35 if v := os.Getenv("VCD_PASSWORD"); v == "" { 36 t.Fatal("VCD_PASSWORD must be set for acceptance tests") 37 } 38 if v := os.Getenv("VCD_ORG"); v == "" { 39 t.Fatal("VCD_ORG must be set for acceptance tests") 40 } 41 if v := os.Getenv("VCD_URL"); v == "" { 42 t.Fatal("VCD_URL must be set for acceptance tests") 43 } 44 if v := os.Getenv("VCD_EDGE_GATEWAY"); v == "" { 45 t.Fatal("VCD_EDGE_GATEWAY must be set for acceptance tests") 46 } 47 if v := os.Getenv("VCD_VDC"); v == "" { 48 t.Fatal("VCD_VDC must be set for acceptance tests") 49 } 50 }