Test we halt if a bad path is set in vmx_path

pull/6448/head
DanHam 8 years ago
parent 21117e5d38
commit a39c5887fb
No known key found for this signature in database
GPG Key ID: 58E79AEDD6AA987E

@ -252,3 +252,19 @@ func TestStepConfigureVMX_displayNameStore(t *testing.T) {
t.Fatalf("displayName should be stored in the statebag as 'display_name'")
}
}
func TestStepConfigureVMX_vmxPathBad(t *testing.T) {
state := testState(t)
step := new(StepConfigureVMX)
state.Put("vmx_path", "some_bad_path")
// Test the run
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v. Should halt when vmxPath is bad", action)
}
if _, ok := state.GetOk("error"); !ok {
t.Fatal("should store error in state when vmxPath is bad")
}
}

Loading…
Cancel
Save