tests/provisioner/powershell: Add acceptance test to reproduce issue 4916
This commit is contained in:
parent
6ad67f6800
commit
13e0c1a097
|
@ -39,6 +39,15 @@ func TestAccPowershellProvisioner_Script(t *testing.T) {
|
||||||
acc.TestProvisionersAgainstBuilders(&testProvisioner, t)
|
acc.TestProvisionersAgainstBuilders(&testProvisioner, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestPowershellProvisioner_Invalid(t *testing.T) {
|
||||||
|
acc.TestProvisionersPreCheck(TestProvisionerName, t)
|
||||||
|
|
||||||
|
// This test should fail with a non-zero exit code. To assert the failure the fixture
|
||||||
|
// uses the valid_exit_codes option to confirm a non-zero exit code
|
||||||
|
testProvisioner := PowershellProvisionerAccTest{"powershell-provisioner-invalid.txt"}
|
||||||
|
acc.TestProvisionersAgainstBuilders(&testProvisioner, t)
|
||||||
|
}
|
||||||
|
|
||||||
type PowershellProvisionerAccTest struct {
|
type PowershellProvisionerAccTest struct {
|
||||||
ConfigName string
|
ConfigName string
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"inline": "this is not a valid powershell command",
|
||||||
|
"valid_exit_codes": ["1"]
|
||||||
|
}
|
Loading…
Reference in New Issue