From 029c357d8c52e86d6733b6d342da3c55d8fecbc6 Mon Sep 17 00:00:00 2001 From: Ali Rizvi-Santiago Date: Sat, 17 Jun 2017 15:35:58 -0500 Subject: [PATCH] Modified some tests to require the PACKER_ACC environment variable to be set before executing them. This turns them into acceptance tests as per CONTRIBUTING.md. --- builder/vmware/common/step_shutdown_test.go | 4 ++++ builder/vmware/iso/step_create_vmx_test.go | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/builder/vmware/common/step_shutdown_test.go b/builder/vmware/common/step_shutdown_test.go index ed0eae486..ff775f2f2 100644 --- a/builder/vmware/common/step_shutdown_test.go +++ b/builder/vmware/common/step_shutdown_test.go @@ -116,6 +116,10 @@ func TestStepShutdown_noCommand(t *testing.T) { } func TestStepShutdown_locks(t *testing.T) { + if os.Getenv("PACKER_ACC") == "" { + t.Skip("This test is only run with PACKER_ACC=1 due to the requirement of access to the VMware binaries.") + } + state := testStepShutdownState(t) step := new(StepShutdown) step.Testing = true diff --git a/builder/vmware/iso/step_create_vmx_test.go b/builder/vmware/iso/step_create_vmx_test.go index 31177957f..7553dff82 100644 --- a/builder/vmware/iso/step_create_vmx_test.go +++ b/builder/vmware/iso/step_create_vmx_test.go @@ -199,6 +199,10 @@ func setupVMwareBuild(t *testing.T, builderConfig map[string]string, provisioner } func TestStepCreateVmx_SerialFile(t *testing.T) { + if os.Getenv("PACKER_ACC") == "" { + t.Skip("This test is only run with PACKER_ACC=1 due to the requirement of access to the VMware binaries.") + } + tmpfile := tmpnam("SerialFileInput.") serialConfig := map[string]string{ @@ -223,6 +227,10 @@ func TestStepCreateVmx_SerialFile(t *testing.T) { } func TestStepCreateVmx_SerialPort(t *testing.T) { + if os.Getenv("PACKER_ACC") == "" { + t.Skip("This test is only run with PACKER_ACC=1 due to the requirement of access to the VMware binaries.") + } + var defaultSerial string if runtime.GOOS == "windows" { defaultSerial = "COM1" @@ -268,6 +276,10 @@ func TestStepCreateVmx_SerialPort(t *testing.T) { } func TestStepCreateVmx_ParallelPort(t *testing.T) { + if os.Getenv("PACKER_ACC") == "" { + t.Skip("This test is only run with PACKER_ACC=1 due to the requirement of access to the VMware binaries.") + } + var defaultParallel string if runtime.GOOS == "windows" { defaultParallel = "LPT1" @@ -313,6 +325,10 @@ func TestStepCreateVmx_ParallelPort(t *testing.T) { } func TestStepCreateVmx_Usb(t *testing.T) { + if os.Getenv("PACKER_ACC") == "" { + t.Skip("This test is only run with PACKER_ACC=1 due to the requirement of access to the VMware binaries.") + } + config := map[string]string{ "usb": `"TRUE"`, } @@ -351,6 +367,10 @@ func TestStepCreateVmx_Usb(t *testing.T) { } func TestStepCreateVmx_Sound(t *testing.T) { + if os.Getenv("PACKER_ACC") == "" { + t.Skip("This test is only run with PACKER_ACC=1 due to the requirement of access to the VMware binaries.") + } + config := map[string]string{ "sound": `"TRUE"`, }