diff --git a/builder/vmware/common/step_clean_vmx_test.go b/builder/vmware/common/step_clean_vmx_test.go index 0f4df3df2..3987fb2c4 100644 --- a/builder/vmware/common/step_clean_vmx_test.go +++ b/builder/vmware/common/step_clean_vmx_test.go @@ -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) diff --git a/builder/vmware/common/step_test.go b/builder/vmware/common/step_test.go index c8a12abb6..d1daffab5 100644 --- a/builder/vmware/common/step_test.go +++ b/builder/vmware/common/step_test.go @@ -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 }