core: update provisioner test fixtures
They need to conform to the test schema
This commit is contained in:
parent
ec8df26a80
commit
2f6787c9b2
|
@ -4252,8 +4252,8 @@ func TestContext2Apply_Provisioner_compute(t *testing.T) {
|
||||||
p.ApplyFn = testApplyFn
|
p.ApplyFn = testApplyFn
|
||||||
p.DiffFn = testDiffFn
|
p.DiffFn = testDiffFn
|
||||||
pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error {
|
pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error {
|
||||||
val, ok := c.Config["foo"]
|
val, ok := c.Config["command"]
|
||||||
if !ok || val != "computed_dynamical" {
|
if !ok || val != "computed_value" {
|
||||||
t.Fatalf("bad value for foo: %v %#v", val, c)
|
t.Fatalf("bad value for foo: %v %#v", val, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4825,7 +4825,7 @@ func TestContext2Apply_provisionerDestroy(t *testing.T) {
|
||||||
p.ApplyFn = testApplyFn
|
p.ApplyFn = testApplyFn
|
||||||
p.DiffFn = testDiffFn
|
p.DiffFn = testDiffFn
|
||||||
pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error {
|
pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error {
|
||||||
val, ok := c.Config["foo"]
|
val, ok := c.Config["command"]
|
||||||
if !ok || val != "destroy" {
|
if !ok || val != "destroy" {
|
||||||
t.Fatalf("bad value for foo: %v %#v", val, c)
|
t.Fatalf("bad value for foo: %v %#v", val, c)
|
||||||
}
|
}
|
||||||
|
@ -4953,7 +4953,7 @@ func TestContext2Apply_provisionerDestroyFailContinue(t *testing.T) {
|
||||||
var l sync.Mutex
|
var l sync.Mutex
|
||||||
var calls []string
|
var calls []string
|
||||||
pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error {
|
pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error {
|
||||||
val, ok := c.Config["foo"]
|
val, ok := c.Config["command"]
|
||||||
if !ok {
|
if !ok {
|
||||||
t.Fatalf("bad value for foo: %v %#v", val, c)
|
t.Fatalf("bad value for foo: %v %#v", val, c)
|
||||||
}
|
}
|
||||||
|
@ -5029,7 +5029,7 @@ func TestContext2Apply_provisionerDestroyFailContinueFail(t *testing.T) {
|
||||||
var l sync.Mutex
|
var l sync.Mutex
|
||||||
var calls []string
|
var calls []string
|
||||||
pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error {
|
pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error {
|
||||||
val, ok := c.Config["foo"]
|
val, ok := c.Config["command"]
|
||||||
if !ok {
|
if !ok {
|
||||||
t.Fatalf("bad value for foo: %v %#v", val, c)
|
t.Fatalf("bad value for foo: %v %#v", val, c)
|
||||||
}
|
}
|
||||||
|
@ -5111,9 +5111,9 @@ func TestContext2Apply_provisionerDestroyTainted(t *testing.T) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
val, ok := c.Config["foo"]
|
val, ok := c.Config["command"]
|
||||||
if !ok || val != expected {
|
if !ok || val != expected {
|
||||||
t.Fatalf("bad value for foo: %v %#v", val, c)
|
t.Fatalf("bad value for command: %v %#v", val, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -350,7 +350,7 @@ aws_secret_key = ZZZZ
|
||||||
|
|
||||||
const testTerraformApplyDependsCreateBeforeStr = `
|
const testTerraformApplyDependsCreateBeforeStr = `
|
||||||
aws_instance.lb:
|
aws_instance.lb:
|
||||||
ID = foo
|
ID = baz
|
||||||
provider = provider.aws
|
provider = provider.aws
|
||||||
instance = foo
|
instance = foo
|
||||||
type = aws_instance
|
type = aws_instance
|
||||||
|
|
|
@ -2,12 +2,12 @@ variable "value" {}
|
||||||
|
|
||||||
resource "aws_instance" "foo" {
|
resource "aws_instance" "foo" {
|
||||||
num = "2"
|
num = "2"
|
||||||
compute = "dynamical"
|
compute = "value"
|
||||||
compute_value = "${var.value}"
|
compute_value = "${var.value}"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_instance" "bar" {
|
resource "aws_instance" "bar" {
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
foo = "${aws_instance.foo.dynamical}"
|
command = "${aws_instance.foo.value}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,13 @@ resource "aws_instance" "foo" {
|
||||||
foo = "bar"
|
foo = "bar"
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
foo = "one"
|
command = "one"
|
||||||
when = "destroy"
|
when = "destroy"
|
||||||
on_failure = "continue"
|
on_failure = "continue"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
foo = "two"
|
command = "two"
|
||||||
when = "destroy"
|
when = "destroy"
|
||||||
on_failure = "continue"
|
on_failure = "continue"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,13 @@ resource "aws_instance" "foo" {
|
||||||
foo = "bar"
|
foo = "bar"
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
foo = "one"
|
command = "one"
|
||||||
when = "destroy"
|
when = "destroy"
|
||||||
on_failure = "continue"
|
on_failure = "continue"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
foo = "two"
|
command = "two"
|
||||||
when = "destroy"
|
when = "destroy"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,11 +2,11 @@ resource "aws_instance" "foo" {
|
||||||
foo = "bar"
|
foo = "bar"
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
foo = "create"
|
command = "create"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
foo = "destroy"
|
command = "destroy"
|
||||||
when = "destroy"
|
when = "destroy"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue