update ConnInfo test to work with new schema
We can't handle dynamic attributes in the tests any longer
This commit is contained in:
parent
903852b8e2
commit
36aca84572
|
@ -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")
|
||||
|
|
|
@ -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 = `
|
||||
|
|
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue