github.com/recobe182/terraform@v0.8.5-0.20170117231232-49ab22a935b7/builtin/providers/cobbler/provider_test.go (about)

     1  package cobbler
     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 testAccCobblerProviders map[string]terraform.ResourceProvider
    12  var testAccCobblerProvider *schema.Provider
    13  
    14  func init() {
    15  	testAccCobblerProvider = Provider().(*schema.Provider)
    16  	testAccCobblerProviders = map[string]terraform.ResourceProvider{
    17  		"cobbler": testAccCobblerProvider,
    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 testAccCobblerPreCheck(t *testing.T) {
    32  	v := os.Getenv("COBBLER_USERNAME")
    33  	if v == "" {
    34  		t.Fatal("COBBLER_USERNAME must be set for acceptance tests.")
    35  	}
    36  
    37  	v = os.Getenv("COBBLER_PASSWORD")
    38  	if v == "" {
    39  		t.Fatal("COBBLER_PASSWORD must be set for acceptance tests.")
    40  	}
    41  
    42  	v = os.Getenv("COBBLER_URL")
    43  	if v == "" {
    44  		t.Fatal("COBBLER_URL must be set for acceptance tests.")
    45  	}
    46  }