2015-12-08 23:30:12 +01:00
|
|
|
package azurerm
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/helper/schema"
|
|
|
|
"github.com/hashicorp/terraform/terraform"
|
|
|
|
)
|
|
|
|
|
|
|
|
var testAccProviders map[string]terraform.ResourceProvider
|
|
|
|
var testAccProvider *schema.Provider
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
testAccProvider = Provider().(*schema.Provider)
|
|
|
|
testAccProviders = map[string]terraform.ResourceProvider{
|
2015-12-09 00:50:48 +01:00
|
|
|
"azurerm": testAccProvider,
|
2015-12-08 23:30:12 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestProvider(t *testing.T) {
|
|
|
|
if err := Provider().(*schema.Provider).InternalValidate(); err != nil {
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestProvider_impl(t *testing.T) {
|
|
|
|
var _ terraform.ResourceProvider = Provider()
|
|
|
|
}
|
|
|
|
|
|
|
|
func testAccPreCheck(t *testing.T) {
|
2015-12-09 02:25:05 +01:00
|
|
|
subscriptionID := os.Getenv("ARM_SUBSCRIPTION_ID")
|
|
|
|
clientID := os.Getenv("ARM_CLIENT_ID")
|
|
|
|
clientSecret := os.Getenv("ARM_CLIENT_SECRET")
|
|
|
|
tenantID := os.Getenv("ARM_TENANT_ID")
|
2015-12-08 23:30:12 +01:00
|
|
|
|
2015-12-09 02:25:05 +01:00
|
|
|
if subscriptionID == "" || clientID == "" || clientSecret == "" || tenantID == "" {
|
|
|
|
t.Fatal("ARM_SUBSCRIPTION_ID, ARM_CLIENT_ID, ARM_CLIENT_SECRET and ARM_TENANT_ID must be set for acceptance tests")
|
2015-12-08 23:30:12 +01:00
|
|
|
}
|
|
|
|
}
|