terraform: acceptance test for validation error

Add an acceptance test where terraform plan should error due
to validation errors.
This commit is contained in:
Emil Hessman 2015-01-12 14:01:05 +01:00
parent 2bc612e6f8
commit 071d872dc2
2 changed files with 32 additions and 0 deletions

View File

@ -4148,6 +4148,22 @@ func TestContextPlan_varMultiCountOne(t *testing.T) {
}
}
func TestContextPlan_varListErr(t *testing.T) {
m := testModule(t, "plan-var-list-err")
p := testProvider("aws")
ctx := testContext(t, &ContextOpts{
Module: m,
Providers: map[string]ResourceProviderFactory{
"aws": testProviderFuncFixed(p),
},
})
_, err := ctx.Plan(nil)
if err == nil {
t.Fatal("should error")
}
}
func TestContextRefresh(t *testing.T) {
p := testProvider("aws")
m := testModule(t, "refresh-basic")

View File

@ -0,0 +1,16 @@
provider "aws" {
access_key = "a"
secret_key = "b"
region = "us-east-1"
}
resource "aws_instance" "foo" {
ami = "ami-foo"
instance_type = "t2.micro"
security_groups = "${aws_security_group.foo.name}"
}
resource "aws_security_group" "foo" {
name = "foobar"
description = "foobar"
}