update ConnInfo test to work with new schema

We can't handle dynamic attributes in the tests any longer
This commit is contained in:
James Bardin 2018-05-29 15:03:04 -04:00 committed by Martin Atkins
parent 903852b8e2
commit 36aca84572
3 changed files with 5 additions and 15 deletions

View File

@ -5811,18 +5811,6 @@ func TestContext2Apply_Provisioner_ConnInfo(t *testing.T) {
p := testProvider("aws")
pr := testProvisioner()
p.GetSchemaReturn = &ProviderSchema{
ResourceTypes: map[string]*configschema.Block{
"aws_instance": {
Attributes: map[string]*configschema.Attribute{
"num": {Type: cty.String, Optional: true},
"compute": {Type: cty.String, Optional: true},
"compute_value": {Type: cty.String, Optional: true},
"dynamical": {Type: cty.String, Computed: true},
},
},
},
}
p.ApplyFn = func(info *InstanceInfo, s *InstanceState, d *InstanceDiff) (*InstanceState, error) {
if s.Ephemeral.ConnInfo == nil {
t.Fatalf("ConnInfo not initialized")

View File

@ -602,9 +602,10 @@ aws_instance.bar:
aws_instance.foo:
ID = foo
provider = provider.aws
dynamical = computed_dynamical
compute = value
num = 2
type = aws_instance
value = computed_value
`
const testTerraformApplyProvisionerModuleStr = `

View File

@ -6,7 +6,7 @@ variable "value" {
resource "aws_instance" "foo" {
num = "2"
compute = "dynamical"
compute = "value"
compute_value = "${var.value}"
}
@ -16,8 +16,9 @@ resource "aws_instance" "bar" {
}
provisioner "shell" {
foo = "${aws_instance.foo.dynamical}"
foo = "${aws_instance.foo.value}"
connection {
type = "telnet"
user = "superuser"
port = 2222
password = "${var.pass}"