github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/icinga2/provider_test.go (about) 1 package icinga2 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 "icinga2": 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 TestProviderImpl(t *testing.T) { 28 var _ terraform.ResourceProvider = Provider() 29 } 30 31 func testAccPreCheck(t *testing.T) { 32 33 v := os.Getenv("ICINGA2_API_URL") 34 if v == "" { 35 t.Fatal("ICINGA2_API_URL must be set for acceptance tests") 36 } 37 38 v = os.Getenv("ICINGA2_API_USER") 39 if v == "" { 40 t.Fatal("ICINGA2_API_USER must be set for acceptance tests") 41 } 42 43 v = os.Getenv("ICINGA2_API_PASSWORD") 44 if v == "" { 45 t.Fatal("ICINGA2_API_PASSWORD must be set for acceptance tests") 46 } 47 48 }