Added knowledge of the "temporaryDevices" statebag to the StepCleanVMX tests for the VMware builders.

This commit is contained in:
Ali Rizvi-Santiago 2018-12-03 18:03:02 -06:00
parent fa4998e1ec
commit 96bdf17d2e
2 changed files with 13 additions and 0 deletions

View File

@ -40,8 +40,12 @@ func TestStepCleanVMX_floppyPath(t *testing.T) {
t.Fatalf("err: %s", err)
}
// Set the path to the temporary vmx
state.Put("vmx_path", vmxPath)
// Add the floppy device to the list of temporary build devices
state.Put("temporaryDevices", []string{"floppy0"})
// Test the run
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
@ -89,8 +93,12 @@ func TestStepCleanVMX_isoPath(t *testing.T) {
t.Fatalf("err: %s", err)
}
// Set the path to the temporary vmx
state.Put("vmx_path", vmxPath)
// Add the cdrom device to the list of temporary build devices
state.Put("temporaryDevices", []string{"ide0:0"})
// Test the run
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
@ -141,8 +149,12 @@ func TestStepCleanVMX_ethernet(t *testing.T) {
t.Fatalf("err: %s", err)
}
// Set the path to the temporary vmx
state.Put("vmx_path", vmxPath)
// TODO: Add the ethernet devices to the list of temporary build devices
// state.Put("temporaryDevices", []string{"ethernet0", "ethernet1"})
// Test the run
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)

View File

@ -15,5 +15,6 @@ func testState(t *testing.T) multistep.StateBag {
Reader: new(bytes.Buffer),
Writer: new(bytes.Buffer),
})
state.Put("temporaryDevices", []string{})
return state
}