test fixes WIP

This commit is contained in:
Matthew Hooker 2018-01-22 16:03:49 -08:00
parent 5d48d658b4
commit 8cd403425e
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
62 changed files with 242 additions and 181 deletions

View File

@ -1,6 +1,7 @@
package arm
import (
"context"
"fmt"
"testing"
@ -26,7 +27,7 @@ func TestStepCaptureImageShouldFailIfCaptureFails(t *testing.T) {
stateBag := createTestStateBagStepCaptureImage()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -51,7 +52,7 @@ func TestStepCaptureImageShouldPassIfCapturePasses(t *testing.T) {
stateBag := createTestStateBagStepCaptureImage()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -91,7 +92,7 @@ func TestStepCaptureImageShouldTakeStepArgumentsFromStateBag(t *testing.T) {
}
stateBag := createTestStateBagStepCaptureImage()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)

View File

@ -1,6 +1,7 @@
package arm
import (
"context"
"errors"
"fmt"
"testing"
@ -26,7 +27,7 @@ func TestStepCreateResourceGroupShouldFailIfBothGroupNames(t *testing.T) {
error: func(e error) {},
exists: func(string) (bool, error) { return false, nil },
}
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -46,7 +47,7 @@ func TestStepCreateResourceGroupShouldFailIfCreateFails(t *testing.T) {
stateBag := createTestStateBagStepCreateResourceGroup()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -66,7 +67,7 @@ func TestStepCreateResourceGroupShouldFailIfExistsFails(t *testing.T) {
stateBag := createTestStateBagStepCreateResourceGroup()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -86,7 +87,7 @@ func TestStepCreateResourceGroupShouldPassIfCreatePasses(t *testing.T) {
stateBag := createTestStateBagStepCreateResourceGroup()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -114,7 +115,7 @@ func TestStepCreateResourceGroupShouldTakeStepArgumentsFromStateBag(t *testing.T
}
stateBag := createTestStateBagStepCreateResourceGroup()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
@ -152,7 +153,7 @@ func TestStepCreateResourceGroupMarkShouldFailIfTryingExistingButDoesntExist(t *
stateBag := createTestExistingStateBagStepCreateResourceGroup()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -172,7 +173,7 @@ func TestStepCreateResourceGroupMarkShouldFailIfTryingTempButExist(t *testing.T)
stateBag := createTestStateBagStepCreateResourceGroup()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}

View File

@ -1,6 +1,7 @@
package arm
import (
"context"
"errors"
"fmt"
"testing"
@ -19,7 +20,7 @@ func TestStepDeleteOSDiskShouldFailIfGetFails(t *testing.T) {
stateBag := DeleteTestStateBagStepDeleteOSDisk("http://storage.blob.core.windows.net/images/pkrvm_os.vhd")
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -38,7 +39,7 @@ func TestStepDeleteOSDiskShouldPassIfGetPasses(t *testing.T) {
stateBag := DeleteTestStateBagStepDeleteOSDisk("http://storage.blob.core.windows.net/images/pkrvm_os.vhd")
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -63,7 +64,7 @@ func TestStepDeleteOSDiskShouldTakeStepArgumentsFromStateBag(t *testing.T) {
}
stateBag := DeleteTestStateBagStepDeleteOSDisk("http://storage.blob.core.windows.net/images/pkrvm_os.vhd")
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
@ -93,7 +94,7 @@ func TestStepDeleteOSDiskShouldHandleComplexStorageContainerNames(t *testing.T)
}
stateBag := DeleteTestStateBagStepDeleteOSDisk("http://storage.blob.core.windows.net/abc/def/pkrvm_os.vhd")
testSubject.Run(stateBag)
testSubject.Run(context.Background(), stateBag)
if actualStorageContainerName != "abc" {
t.Fatalf("Expected the storage container name to be 'abc/def', but found '%s'.", actualStorageContainerName)
@ -115,7 +116,7 @@ func TestStepDeleteOSDiskShouldFailIfVHDNameCannotBeURLParsed(t *testing.T) {
// Invalid URL per https://golang.org/src/net/url/url_test.go
stateBag := DeleteTestStateBagStepDeleteOSDisk("http://[fe80::1%en0]/")
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%v'.", result)
}
@ -134,7 +135,7 @@ func TestStepDeleteOSDiskShouldFailIfVHDNameIsTooShort(t *testing.T) {
stateBag := DeleteTestStateBagStepDeleteOSDisk("storage.blob.core.windows.net/abc")
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -157,7 +158,7 @@ func TestStepDeleteOSDiskShouldPassIfManagedDiskInTempResourceGroup(t *testing.T
stateBag.Put(constants.ArmIsExistingResourceGroup, false)
stateBag.Put(constants.ArmResourceGroupName, "testgroup")
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -181,7 +182,7 @@ func TestStepDeleteOSDiskShouldFailIfManagedDiskInExistingResourceGroupFailsToDe
stateBag.Put(constants.ArmIsExistingResourceGroup, true)
stateBag.Put(constants.ArmResourceGroupName, "testgroup")
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -205,7 +206,7 @@ func TestStepDeleteOSDiskShouldFailIfManagedDiskInExistingResourceGroupIsDeleted
stateBag.Put(constants.ArmIsExistingResourceGroup, true)
stateBag.Put(constants.ArmResourceGroupName, "testgroup")
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}

View File

@ -1,6 +1,7 @@
package arm
import (
"context"
"fmt"
"testing"
@ -17,7 +18,7 @@ func TestStepDeleteResourceGroupShouldFailIfDeleteFails(t *testing.T) {
stateBag := DeleteTestStateBagStepDeleteResourceGroup()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -36,7 +37,7 @@ func TestStepDeleteResourceGroupShouldPassIfDeletePasses(t *testing.T) {
stateBag := DeleteTestStateBagStepDeleteResourceGroup()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -56,7 +57,7 @@ func TestStepDeleteResourceGroupShouldDeleteStateBagArmResourceGroupCreated(t *t
}
stateBag := DeleteTestStateBagStepDeleteResourceGroup()
testSubject.Run(stateBag)
testSubject.Run(context.Background(), stateBag)
value, ok := stateBag.GetOk(constants.ArmIsResourceGroupCreated)
if !ok {

View File

@ -1,6 +1,7 @@
package arm
import (
"context"
"fmt"
"testing"
@ -19,7 +20,7 @@ func TestStepDeployTemplateShouldFailIfDeployFails(t *testing.T) {
stateBag := createTestStateBagStepDeployTemplate()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -38,7 +39,7 @@ func TestStepDeployTemplateShouldPassIfDeployPasses(t *testing.T) {
stateBag := createTestStateBagStepDeployTemplate()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -65,7 +66,7 @@ func TestStepDeployTemplateShouldTakeStepArgumentsFromStateBag(t *testing.T) {
}
stateBag := createTestStateBagStepValidateTemplate()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)

View File

@ -1,6 +1,7 @@
package arm
import (
"context"
"fmt"
"testing"
@ -18,7 +19,7 @@ func TestStepGetCertificateShouldFailIfGetFails(t *testing.T) {
stateBag := createTestStateBagStepGetCertificate()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -38,7 +39,7 @@ func TestStepGetCertificateShouldPassIfGetPasses(t *testing.T) {
stateBag := createTestStateBagStepGetCertificate()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -65,7 +66,7 @@ func TestStepGetCertificateShouldTakeStepArgumentsFromStateBag(t *testing.T) {
}
stateBag := createTestStateBagStepGetCertificate()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)

View File

@ -1,6 +1,7 @@
package arm
import (
"context"
"fmt"
"testing"
@ -21,7 +22,7 @@ func TestStepGetIPAddressShouldFailIfGetFails(t *testing.T) {
stateBag := createTestStateBagStepGetIPAddress()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -45,7 +46,7 @@ func TestStepGetIPAddressShouldPassIfGetPasses(t *testing.T) {
stateBag := createTestStateBagStepGetIPAddress()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -77,7 +78,7 @@ func TestStepGetIPAddressShouldTakeStepArgumentsFromStateBag(t *testing.T) {
}
stateBag := createTestStateBagStepGetIPAddress()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)

View File

@ -1,6 +1,7 @@
package arm
import (
"context"
"fmt"
"testing"
@ -22,7 +23,7 @@ func TestStepGetOSDiskShouldFailIfGetFails(t *testing.T) {
stateBag := createTestStateBagStepGetOSDisk()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -43,7 +44,7 @@ func TestStepGetOSDiskShouldPassIfGetPasses(t *testing.T) {
stateBag := createTestStateBagStepGetOSDisk()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -69,7 +70,7 @@ func TestStepGetOSDiskShouldTakeValidateArgumentsFromStateBag(t *testing.T) {
}
stateBag := createTestStateBagStepGetOSDisk()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)

View File

@ -1,6 +1,7 @@
package arm
import (
"context"
"fmt"
"testing"
@ -17,7 +18,7 @@ func TestStepPowerOffComputeShouldFailIfPowerOffFails(t *testing.T) {
stateBag := createTestStateBagStepPowerOffCompute()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -36,7 +37,7 @@ func TestStepPowerOffComputeShouldPassIfPowerOffPasses(t *testing.T) {
stateBag := createTestStateBagStepPowerOffCompute()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -62,7 +63,7 @@ func TestStepPowerOffComputeShouldTakeStepArgumentsFromStateBag(t *testing.T) {
}
stateBag := createTestStateBagStepPowerOffCompute()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)

View File

@ -1,6 +1,7 @@
package arm
import (
"context"
"testing"
"github.com/hashicorp/packer/builder/azure/common/constants"
@ -16,7 +17,7 @@ func TestStepSetCertificateShouldPassIfGetPasses(t *testing.T) {
stateBag := createTestStateBagStepSetCertificate()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -35,7 +36,7 @@ func TestStepSetCertificateShouldTakeStepArgumentsFromStateBag(t *testing.T) {
}
stateBag := createTestStateBagStepSetCertificate()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)

View File

@ -1,6 +1,7 @@
package arm
import (
"context"
"fmt"
"testing"
@ -17,7 +18,7 @@ func TestStepValidateTemplateShouldFailIfValidateFails(t *testing.T) {
stateBag := createTestStateBagStepValidateTemplate()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionHalt {
t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result)
}
@ -36,7 +37,7 @@ func TestStepValidateTemplateShouldPassIfValidatePasses(t *testing.T) {
stateBag := createTestStateBagStepValidateTemplate()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)
}
@ -62,7 +63,7 @@ func TestStepValidateTemplateShouldTakeStepArgumentsFromStateBag(t *testing.T) {
}
stateBag := createTestStateBagStepValidateTemplate()
var result = testSubject.Run(stateBag)
var result = testSubject.Run(context.Background(), stateBag)
if result != multistep.ActionContinue {
t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)

View File

@ -1,6 +1,7 @@
package docker
import (
"context"
"errors"
"testing"
@ -26,7 +27,7 @@ func TestStepCommit(t *testing.T) {
driver.CommitImageId = "bar"
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -56,7 +57,7 @@ func TestStepCommit_error(t *testing.T) {
driver.CommitErr = errors.New("foo")
// run the step
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}

View File

@ -2,6 +2,7 @@ package docker
import (
"bytes"
"context"
"errors"
"io/ioutil"
"os"
@ -39,7 +40,7 @@ func TestStepExport(t *testing.T) {
driver.ExportReader = bytes.NewReader([]byte("data!"))
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -84,7 +85,7 @@ func TestStepExport_error(t *testing.T) {
driver.ExportError = errors.New("foo")
// run the step
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package docker
import (
"context"
"errors"
"testing"
@ -20,7 +21,7 @@ func TestStepPull(t *testing.T) {
driver := state.Get("driver").(*MockDriver)
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -42,7 +43,7 @@ func TestStepPull_error(t *testing.T) {
driver.PullError = errors.New("foo")
// run the step
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -63,7 +64,7 @@ func TestStepPull_login(t *testing.T) {
config.Login = true
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -92,7 +93,7 @@ func TestStepPull_noPull(t *testing.T) {
driver := state.Get("driver").(*MockDriver)
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}

View File

@ -18,7 +18,7 @@ func TestStepRun_impl(t *testing.T) {
var _ multistep.Step = new(StepRun)
}
func TestStepRun(_ context.Context, t *testing.T) {
func TestStepRun(t *testing.T) {
state := testStepRunState(t)
step := new(StepRun)
defer step.Cleanup(state)
@ -28,7 +28,7 @@ func TestStepRun(_ context.Context, t *testing.T) {
driver.StartID = "foo"
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -75,7 +75,7 @@ func TestStepRun_error(t *testing.T) {
driver.StartError = errors.New("foo")
// run the step
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package docker
import (
"context"
"os"
"path/filepath"
"testing"
@ -24,7 +25,7 @@ func testStepTempDir_impl(t *testing.T) string {
}
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package googlecompute
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -22,7 +23,7 @@ func TestStepCheckExistingImage(t *testing.T) {
driver.ImageExistsResult = true
// run the step
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package googlecompute
import (
"context"
"errors"
"testing"
@ -26,7 +27,7 @@ func TestStepCreateImage(t *testing.T) {
d.CreateImageResultSizeGb = 100
// run the step
action := step.Run(state)
action := step.Run(context.Background(), state)
assert.Equal(t, action, multistep.ActionContinue, "Step did not pass.")
uncastImage, ok := state.GetOk("image")
@ -61,7 +62,7 @@ func TestStepCreateImage_errorOnChannel(t *testing.T) {
driver.CreateImageErrCh = errCh
// run the step
action := step.Run(state)
action := step.Run(context.Background(), state)
assert.Equal(t, action, multistep.ActionHalt, "Step should not have passed.")
_, ok := state.GetOk("error")
assert.True(t, ok, "State should have an error.")

View File

@ -1,6 +1,7 @@
package googlecompute
import (
"context"
"errors"
"strings"
"testing"
@ -26,7 +27,7 @@ func TestStepCreateInstance(t *testing.T) {
d.GetImageResult = StubImage("test-image", "test-project", []string{}, 100)
// run the step
assert.Equal(t, step.Run(state), multistep.ActionContinue, "Step should have passed and continued.")
assert.Equal(t, step.Run(context.Background(), state), multistep.ActionContinue, "Step should have passed and continued.")
// Verify state
nameRaw, ok := state.GetOk("instance_name")
@ -67,7 +68,7 @@ func TestStepCreateInstance_fromFamily(t *testing.T) {
d.GetImageResult = StubImage("test-image", "test-project", []string{}, 100)
// run the step
assert.Equal(t, step.Run(state), multistep.ActionContinue, "Step should have passed and continued.")
assert.Equal(t, step.Run(context.Background(), state), multistep.ActionContinue, "Step should have passed and continued.")
// cleanup
step.Cleanup(state)
@ -93,7 +94,7 @@ func TestStepCreateInstance_windowsNeedsPassword(t *testing.T) {
d.GetImageResult = StubImage("test-image", "test-project", []string{"windows"}, 100)
c.Comm.Type = "winrm"
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -142,7 +143,7 @@ func TestStepCreateInstance_windowsPasswordSet(t *testing.T) {
config.Comm.WinRMPassword = "password"
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -188,7 +189,7 @@ func TestStepCreateInstance_error(t *testing.T) {
d.GetImageResult = StubImage("test-image", "test-project", []string{}, 100)
// run the step
assert.Equal(t, step.Run(state), multistep.ActionHalt, "Step should have failed and halted.")
assert.Equal(t, step.Run(context.Background(), state), multistep.ActionHalt, "Step should have failed and halted.")
// Verify state
_, ok := state.GetOk("error")
@ -212,7 +213,7 @@ func TestStepCreateInstance_errorOnChannel(t *testing.T) {
d.GetImageResult = StubImage("test-image", "test-project", []string{}, 100)
// run the step
assert.Equal(t, step.Run(state), multistep.ActionHalt, "Step should have failed and halted.")
assert.Equal(t, step.Run(context.Background(), state), multistep.ActionHalt, "Step should have failed and halted.")
// Verify state
_, ok := state.GetOk("error")
@ -238,7 +239,7 @@ func TestStepCreateInstance_errorTimeout(t *testing.T) {
d.GetImageResult = StubImage("test-image", "test-project", []string{}, 100)
// run the step
assert.Equal(t, step.Run(state), multistep.ActionHalt, "Step should have failed and halted.")
assert.Equal(t, step.Run(context.Background(), state), multistep.ActionHalt, "Step should have failed and halted.")
// Verify state
_, ok := state.GetOk("error")

View File

@ -1,6 +1,8 @@
package googlecompute
import (
"context"
"github.com/hashicorp/packer/helper/multistep"
"io/ioutil"
@ -19,7 +21,7 @@ func TestStepCreateSSHKey_privateKey(t *testing.T) {
defer step.Cleanup(state)
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -35,7 +37,7 @@ func TestStepCreateSSHKey(t *testing.T) {
defer step.Cleanup(state)
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -63,7 +65,7 @@ func TestStepCreateSSHKey_debug(t *testing.T) {
defer step.Cleanup(state)
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package googlecompute
import (
"context"
"errors"
"io/ioutil"
"os"
@ -21,7 +22,7 @@ func TestStepCreateOrResetWindowsPassword(t *testing.T) {
defer step.Cleanup(state)
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -44,7 +45,7 @@ func TestStepCreateOrResetWindowsPassword_passwordSet(t *testing.T) {
defer step.Cleanup(state)
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -63,7 +64,7 @@ func TestStepCreateOrResetWindowsPassword_dontNeedPassword(t *testing.T) {
defer step.Cleanup(state)
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -89,7 +90,7 @@ func TestStepCreateOrResetWindowsPassword_debug(t *testing.T) {
defer step.Cleanup(state)
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -116,7 +117,7 @@ func TestStepCreateOrResetWindowsPassword_error(t *testing.T) {
driver.CreateOrResetWindowsPasswordErr = errors.New("error")
// run the step
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -148,7 +149,7 @@ func TestStepCreateOrResetWindowsPassword_errorOnChannel(t *testing.T) {
driver.CreateOrResetWindowsPasswordErrCh = errCh
// run the step
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package googlecompute
import (
"context"
"errors"
"testing"
"time"
@ -24,7 +25,7 @@ func TestStepInstanceInfo(t *testing.T) {
driver.GetNatIPResult = "1.2.3.4"
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -64,7 +65,7 @@ func TestStepInstanceInfo_InternalIP(t *testing.T) {
driver.GetInternalIPResult = "5.6.7.8"
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -101,7 +102,7 @@ func TestStepInstanceInfo_getNatIPError(t *testing.T) {
driver.GetNatIPErr = errors.New("error")
// run the step
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -128,7 +129,7 @@ func TestStepInstanceInfo_waitError(t *testing.T) {
driver.WaitForInstanceErrCh = errCh
// run the step
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -161,7 +162,7 @@ func TestStepInstanceInfo_errorTimeout(t *testing.T) {
driver.WaitForInstanceErrCh = errCh
// run the step
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package googlecompute
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -19,7 +20,7 @@ func TestStepTeardownInstance(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package googlecompute
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -23,7 +24,7 @@ func TestStepWaitStartupScript(t *testing.T) {
d.GetInstanceMetadataResult = StartupScriptStatusDone
// Run the step.
assert.Equal(t, step.Run(state), multistep.ActionContinue, "Step should have passed and continued.")
assert.Equal(t, step.Run(context.Background(), state), multistep.ActionContinue, "Step should have passed and continued.")
// Check that GetInstanceMetadata was called properly.
assert.Equal(t, d.GetInstanceMetadataZone, testZone, "Incorrect zone passed to GetInstanceMetadata.")

View File

@ -1,6 +1,7 @@
package iso
import (
"context"
"fmt"
"reflect"
"strconv"
@ -513,7 +514,7 @@ func TestUserVariablesInBootCommand(t *testing.T) {
Ctx: b.config.ctx,
}
ret := step.Run(state)
ret := step.Run(context.Background(), state)
if ret != multistep.ActionContinue {
t.Fatalf("should not have error: %#v", ret)
}

View File

@ -1,6 +1,7 @@
package vmcx
import (
"context"
"fmt"
"reflect"
"testing"
@ -534,7 +535,7 @@ func TestUserVariablesInBootCommand(t *testing.T) {
Ctx: b.config.ctx,
}
ret := step.Run(state)
ret := step.Run(context.Background(), state)
if ret != multistep.ActionContinue {
t.Fatalf("should not have error: %#v", ret)
}

View File

@ -1,6 +1,7 @@
package oci
import (
"context"
"errors"
"testing"
@ -16,7 +17,7 @@ func TestStepCreateInstance(t *testing.T) {
driver := state.Get("driver").(*driverMock)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -44,7 +45,7 @@ func TestStepCreateInstance_CreateInstanceErr(t *testing.T) {
driver := state.Get("driver").(*driverMock)
driver.CreateInstanceErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -73,7 +74,7 @@ func TestStepCreateInstance_WaitForInstanceStateErr(t *testing.T) {
driver := state.Get("driver").(*driverMock)
driver.WaitForInstanceStateErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -91,7 +92,7 @@ func TestStepCreateInstance_TerminateInstanceErr(t *testing.T) {
driver := state.Get("driver").(*driverMock)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -117,7 +118,7 @@ func TestStepCreateInstanceCleanup_WaitForInstanceStateErr(t *testing.T) {
driver := state.Get("driver").(*driverMock)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package oci
import (
"context"
"errors"
"testing"
@ -14,7 +15,7 @@ func TestStepImage(t *testing.T) {
step := new(stepImage)
defer step.Cleanup(state)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -33,7 +34,7 @@ func TestStepImage_CreateImageErr(t *testing.T) {
driver := state.Get("driver").(*driverMock)
driver.CreateImageErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -56,7 +57,7 @@ func TestStepImage_WaitForImageCreationErr(t *testing.T) {
driver := state.Get("driver").(*driverMock)
driver.WaitForImageCreationErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package oci
import (
"context"
"errors"
"testing"
@ -14,7 +15,7 @@ func TestInstanceInfo(t *testing.T) {
step := new(stepInstanceInfo)
defer step.Cleanup(state)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -38,7 +39,7 @@ func TestInstanceInfo_GetInstanceIPErr(t *testing.T) {
driver := state.Get("driver").(*driverMock)
driver.GetInstanceIPErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"io/ioutil"
"os"
"testing"
@ -30,7 +31,7 @@ func TestStepAttachFloppy(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -72,7 +73,7 @@ func TestStepAttachFloppy_noFloppy(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"io/ioutil"
"os"
"testing"
@ -31,7 +32,7 @@ func TestStepCompactDisk(t *testing.T) {
driver.DiskPathResult = tf.Name()
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -59,7 +60,7 @@ func TestStepCompactDisk_skip(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"io/ioutil"
"os"
"testing"
@ -29,7 +30,7 @@ func TestStepOutputDir(t *testing.T) {
step := testStepOutputDir(t)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -51,7 +52,7 @@ func TestStepOutputDir_cancelled(t *testing.T) {
step := testStepOutputDir(t)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -76,7 +77,7 @@ func TestStepOutputDir_halted(t *testing.T) {
step := testStepOutputDir(t)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"io/ioutil"
"os"
"testing"
@ -32,7 +33,7 @@ func TestStepPrepareParallelsTools(t *testing.T) {
driver.ToolsISOPathResult = tf.Name()
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -67,7 +68,7 @@ func TestStepPrepareParallelsTools_disabled(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -93,7 +94,7 @@ func TestStepPrepareParallelsTools_nonExist(t *testing.T) {
driver.ToolsISOPathResult = "foo"
// Test the run
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); !ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"testing"
"time"
@ -23,7 +24,7 @@ func TestStepShutdown_noShutdownCommand(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -60,7 +61,7 @@ func TestStepShutdown_shutdownCommand(t *testing.T) {
}()
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -97,7 +98,7 @@ func TestStepShutdown_shutdownTimeout(t *testing.T) {
}()
// Test the run
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); !ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"strings"
"testing"
@ -38,7 +39,7 @@ func TestStepTypeBootCommand(t *testing.T) {
state.Put("http_port", uint(0))
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -23,7 +24,7 @@ func TestStepUploadParallelsTools(t *testing.T) {
state.Put("communicator", comm)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -48,7 +49,7 @@ func TestStepUploadParallelsTools_interpolate(t *testing.T) {
state.Put("communicator", comm)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -73,7 +74,7 @@ func TestStepUploadParallelsTools_attach(t *testing.T) {
state.Put("communicator", comm)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -23,7 +24,7 @@ func TestStepUploadVersion(t *testing.T) {
driver.VersionResult = "foo"
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -48,7 +49,7 @@ func TestStepUploadVersion_noPath(t *testing.T) {
state.Put("communicator", comm)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package triton
import (
"context"
"errors"
"testing"
@ -14,7 +15,7 @@ func TestStepCreateImageFromMachine(t *testing.T) {
state.Put("machine", "test-machine-id")
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -36,7 +37,7 @@ func TestStepCreateImageFromMachine_CreateImageFromMachineError(t *testing.T) {
driver.CreateImageFromMachineErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -59,7 +60,7 @@ func TestStepCreateImageFromMachine_WaitForImageCreationError(t *testing.T) {
driver.WaitForImageCreationErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package triton
import (
"context"
"errors"
"testing"
@ -14,7 +15,7 @@ func TestStepCreateSourceMachine(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -39,7 +40,7 @@ func TestStepCreateSourceMachine_CreateMachineError(t *testing.T) {
driver.CreateMachineErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -61,7 +62,7 @@ func TestStepCreateSourceMachine_WaitForMachineStateError(t *testing.T) {
driver.WaitForMachineStateErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -81,7 +82,7 @@ func TestStepCreateSourceMachine_StopMachineError(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -109,7 +110,7 @@ func TestStepCreateSourceMachine_WaitForMachineStoppedError(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -137,7 +138,7 @@ func TestStepCreateSourceMachine_DeleteMachineError(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package triton
import (
"context"
"errors"
"testing"
@ -17,7 +18,7 @@ func TestStepDeleteMachine(t *testing.T) {
machineId := "test-machine-id"
state.Put("machine", machineId)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -40,7 +41,7 @@ func TestStepDeleteMachine_DeleteMachineError(t *testing.T) {
driver.DeleteMachineErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -65,7 +66,7 @@ func TestStepDeleteMachine_WaitForMachineDeletionError(t *testing.T) {
driver.WaitForMachineDeletionErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package triton
import (
"context"
"errors"
"testing"
@ -17,7 +18,7 @@ func TestStepStopMachine(t *testing.T) {
machineId := "test-machine-id"
state.Put("machine", machineId)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
@ -40,7 +41,7 @@ func TestStepStopMachine_StopMachineError(t *testing.T) {
driver.StopMachineErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
@ -61,7 +62,7 @@ func TestStepStopMachine_WaitForMachineStoppedError(t *testing.T) {
driver.WaitForMachineStateErr = errors.New("error")
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"io/ioutil"
"os"
"testing"
@ -30,7 +31,7 @@ func TestStepAttachFloppy(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -61,7 +62,7 @@ func TestStepAttachFloppy_noFloppy(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -19,7 +20,7 @@ func TestStepExport(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"io/ioutil"
"os"
"testing"
@ -29,7 +30,7 @@ func TestStepOutputDir(t *testing.T) {
step := testStepOutputDir(t)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -56,7 +57,7 @@ func TestStepOutputDir_exists(t *testing.T) {
}
// Test the run
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); !ok {
@ -75,7 +76,7 @@ func TestStepOutputDir_cancelled(t *testing.T) {
step := testStepOutputDir(t)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -100,7 +101,7 @@ func TestStepOutputDir_halted(t *testing.T) {
step := testStepOutputDir(t)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -19,7 +20,7 @@ func TestStepRemoveDevices(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -42,7 +43,7 @@ func TestStepRemoveDevices_attachedIso(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -69,7 +70,7 @@ func TestStepRemoveDevices_attachedIsoOnSata(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -95,7 +96,7 @@ func TestStepRemoveDevices_floppyPath(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"testing"
"time"
@ -23,7 +24,7 @@ func TestStepShutdown_noShutdownCommand(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -60,7 +61,7 @@ func TestStepShutdown_shutdownCommand(t *testing.T) {
}()
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -97,7 +98,7 @@ func TestStepShutdown_shutdownTimeout(t *testing.T) {
}()
// Test the run
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); !ok {
@ -129,7 +130,7 @@ func TestStepShutdown_shutdownDelay(t *testing.T) {
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
testDuration := time.Since(start).Seconds()
@ -154,7 +155,7 @@ func TestStepShutdown_shutdownDelay(t *testing.T) {
}()
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
testDuration = time.Since(start).Seconds()

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"errors"
"testing"
@ -18,7 +19,7 @@ func TestStepSuppressMessages(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -38,7 +39,7 @@ func TestStepSuppressMessages_error(t *testing.T) {
driver.SuppressMessagesErr = errors.New("foo")
// Test the run
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); !ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -23,7 +24,7 @@ func TestStepUploadVersion(t *testing.T) {
driver.VersionResult = "foo"
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -48,7 +49,7 @@ func TestStepUploadVersion_noPath(t *testing.T) {
state.Put("communicator", comm)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package ovf
import (
"context"
"testing"
vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common"
@ -23,7 +24,7 @@ func TestStepImport(t *testing.T) {
driver := state.Get("driver").(*vboxcommon.DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"io/ioutil"
"os"
"testing"
@ -21,7 +22,7 @@ func TestStepCleanVMX(t *testing.T) {
state.Put("vmx_path", vmxPath)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -42,7 +43,7 @@ func TestStepCleanVMX_floppyPath(t *testing.T) {
state.Put("vmx_path", vmxPath)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -91,7 +92,7 @@ func TestStepCleanVMX_isoPath(t *testing.T) {
state.Put("vmx_path", vmxPath)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -143,7 +144,7 @@ func TestStepCleanVMX_ethernet(t *testing.T) {
state.Put("vmx_path", vmxPath)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -19,7 +20,7 @@ func TestStepCompactDisk(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -45,7 +46,7 @@ func TestStepCompactDisk_skip(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"io/ioutil"
"os"
"testing"
@ -34,7 +35,7 @@ func TestStepConfigureVMX(t *testing.T) {
state.Put("vmx_path", vmxPath)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -87,7 +88,7 @@ func TestStepConfigureVMX_floppyPath(t *testing.T) {
state.Put("vmx_path", vmxPath)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -144,7 +145,7 @@ func TestStepConfigureVMX_generatedAddresses(t *testing.T) {
state.Put("vmx_path", vmxPath)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"io/ioutil"
"os"
"testing"
@ -32,7 +33,7 @@ func TestStepOutputDir(t *testing.T) {
state.Put("dir", dir)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -62,7 +63,7 @@ func TestStepOutputDir_existsNoForce(t *testing.T) {
}
// Test the run
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); !ok {
@ -90,7 +91,7 @@ func TestStepOutputDir_existsForce(t *testing.T) {
}
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -109,7 +110,7 @@ func TestStepOutputDir_cancel(t *testing.T) {
state.Put("dir", dir)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -135,7 +136,7 @@ func TestStepOutputDir_halt(t *testing.T) {
state.Put("dir", dir)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"io/ioutil"
"os"
"testing"
@ -32,7 +33,7 @@ func TestStepPrepareTools(t *testing.T) {
driver.ToolsIsoPathResult = tf.Name()
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -67,7 +68,7 @@ func TestStepPrepareTools_esx5(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -93,7 +94,7 @@ func TestStepPrepareTools_nonExist(t *testing.T) {
driver.ToolsIsoPathResult = "foo"
// Test the run
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); !ok {

View File

@ -11,7 +11,7 @@ func TestStepRun_impl(t *testing.T) {
var _ multistep.Step = new(StepRun)
}
func TestStepRun(_ context.Context, t *testing.T) {
func TestStepRun(t *testing.T) {
state := testState(t)
step := new(StepRun)
@ -20,7 +20,7 @@ func TestStepRun(_ context.Context, t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -54,7 +54,7 @@ func TestStepRun_cleanupRunning(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"io/ioutil"
"os"
"path/filepath"
@ -49,7 +50,7 @@ func TestStepShutdown_command(t *testing.T) {
resultCh := make(chan multistep.StepAction, 1)
go func() {
resultCh <- step.Run(state)
resultCh <- step.Run(context.Background(), state)
}()
select {
@ -94,7 +95,7 @@ func TestStepShutdown_noCommand(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -138,7 +139,7 @@ func TestStepShutdown_locks(t *testing.T) {
resultCh := make(chan multistep.StepAction, 1)
go func() {
resultCh <- step.Run(state)
resultCh <- step.Run(context.Background(), state)
}()
select {

View File

@ -1,6 +1,7 @@
package common
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -19,7 +20,7 @@ func TestStepSuppressMessages(t *testing.T) {
driver := state.Get("driver").(*DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package iso
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -18,7 +19,7 @@ func testStepExport_wrongtype_impl(t *testing.T, remoteType string) {
config.RemoteType = "foo"
state.Put("config", &config)
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package iso
import (
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -17,7 +18,7 @@ func TestStepRegister_regularDriver(t *testing.T) {
state.Put("vmx_path", "foo")
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -41,7 +42,7 @@ func TestStepRegister_remoteDriver(t *testing.T) {
state.Put("vmx_path", "foo")
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {
@ -81,7 +82,7 @@ func TestStepRegister_WithoutUnregister_remoteDriver(t *testing.T) {
state.Put("vmx_path", "foo")
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -1,6 +1,7 @@
package vmx
import (
"context"
"io/ioutil"
"os"
"path/filepath"
@ -43,7 +44,7 @@ func TestStepCloneVMX(t *testing.T) {
driver := state.Get("driver").(*vmwcommon.DriverMock)
// Test the run
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
if _, ok := state.GetOk("error"); ok {

View File

@ -2,6 +2,7 @@ package common
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"log"
@ -89,7 +90,7 @@ func TestStepCreateFloppy(t *testing.T) {
}
for _, step.Files = range lists {
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v for %v", action, step.Files)
}
@ -140,7 +141,7 @@ func xxxTestStepCreateFloppy_missing(t *testing.T) {
}
for _, step.Files = range lists {
if action := step.Run(state); action != multistep.ActionHalt {
if action := step.Run(context.Background(), state); action != multistep.ActionHalt {
t.Fatalf("bad action: %#v for %v", action, step.Files)
}
@ -190,7 +191,7 @@ func xxxTestStepCreateFloppy_notfound(t *testing.T) {
}
for _, step.Files = range lists {
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v for %v", action, step.Files)
}
@ -265,7 +266,7 @@ func TestStepCreateFloppyDirectories(t *testing.T) {
log.Println(fmt.Sprintf("Trying against floppy_dirs : %v", step.Directories))
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v for %v : %v", action, step.Directories, state.Get("error"))
}

View File

@ -2,6 +2,7 @@ package communicator
import (
"bytes"
"context"
"testing"
"github.com/hashicorp/packer/helper/multistep"
@ -23,7 +24,7 @@ func TestStepConnect_none(t *testing.T) {
defer step.Cleanup(state)
// run the step
if action := step.Run(state); action != multistep.ActionContinue {
if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
t.Fatalf("bad action: %#v", action)
}
}