github.com/mohanarpit/terraform@v0.6.16-0.20160909104007-291f29853544/builtin/providers/docker/provider_test.go (about)

     1  package docker
     2  
     3  import (
     4  	"os/exec"
     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  		"docker": 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  	cmd := exec.Command("docker", "version")
    33  	if err := cmd.Run(); err != nil {
    34  		t.Fatalf("Docker must be available: %s", err)
    35  	}
    36  }