command: Fix all of the "taint" command tests
Most of this is just updates to allow for the fact that we now always save the provider address as part of resource state, whereas before it was only saved conditionally. This also updates TestTaint_module for the intentional change that it now expects a child module to be specified using normal resource address syntax, rather than as a separate -module option.
This commit is contained in:
parent
8321c3614f
commit
1bc10180cb
|
@ -379,9 +379,8 @@ func TestTaint_module(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
args := []string{
|
args := []string{
|
||||||
"-module=child",
|
|
||||||
"-state", statePath,
|
"-state", statePath,
|
||||||
"test_instance.blah",
|
"module.child.test_instance.blah",
|
||||||
}
|
}
|
||||||
if code := c.Run(args); code != 0 {
|
if code := c.Run(args); code != 0 {
|
||||||
t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String())
|
t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String())
|
||||||
|
@ -393,18 +392,22 @@ func TestTaint_module(t *testing.T) {
|
||||||
const testTaintStr = `
|
const testTaintStr = `
|
||||||
test_instance.foo: (tainted)
|
test_instance.foo: (tainted)
|
||||||
ID = bar
|
ID = bar
|
||||||
|
provider = provider.test
|
||||||
`
|
`
|
||||||
|
|
||||||
const testTaintDefaultStr = `
|
const testTaintDefaultStr = `
|
||||||
test_instance.foo:
|
test_instance.foo:
|
||||||
ID = bar
|
ID = bar
|
||||||
|
provider = provider.test
|
||||||
`
|
`
|
||||||
|
|
||||||
const testTaintModuleStr = `
|
const testTaintModuleStr = `
|
||||||
test_instance.foo:
|
test_instance.foo:
|
||||||
ID = bar
|
ID = bar
|
||||||
|
provider = provider.test
|
||||||
|
|
||||||
module.child:
|
module.child:
|
||||||
test_instance.blah: (tainted)
|
test_instance.blah: (tainted)
|
||||||
ID = blah
|
ID = blah
|
||||||
|
provider = provider.test
|
||||||
`
|
`
|
||||||
|
|
Loading…
Reference in New Issue