2016-02-10 21:30:32 +01:00
|
|
|
package triton
|
|
|
|
|
|
|
|
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{
|
|
|
|
"triton": testAccProvider,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
|
|
|
sdcURL := os.Getenv("SDC_URL")
|
|
|
|
account := os.Getenv("SDC_ACCOUNT")
|
|
|
|
keyID := os.Getenv("SDC_KEY_ID")
|
|
|
|
|
|
|
|
if sdcURL == "" {
|
|
|
|
sdcURL = "https://us-west-1.api.joyentcloud.com"
|
|
|
|
}
|
|
|
|
|
2017-03-31 00:25:27 +02:00
|
|
|
if sdcURL == "" || account == "" || keyID == "" {
|
|
|
|
t.Fatal("SDC_ACCOUNT and SDC_KEY_ID must be set for acceptance tests. To test with the SSH" +
|
|
|
|
" private key signer, SDC_KEY_MATERIAL must also be set.")
|
2016-02-10 21:30:32 +01:00
|
|
|
}
|
|
|
|
}
|