@ -100,6 +100,10 @@ func TestProvisionerProvision_Success(t *testing.T) {
waitForCommunicator = func ( p * Provisioner ) error {
waitForCommunicator = func ( p * Provisioner ) error {
return nil
return nil
}
}
waitForRestartOld := waitForRestart
waitForRestart = func ( p * Provisioner , comm packer . Communicator ) error {
return nil
}
err := p . Provision ( ui , comm )
err := p . Provision ( ui , comm )
if err != nil {
if err != nil {
t . Fatal ( "should not have error" )
t . Fatal ( "should not have error" )
@ -113,6 +117,7 @@ func TestProvisionerProvision_Success(t *testing.T) {
}
}
// Set this back!
// Set this back!
waitForCommunicator = waitForCommunicatorOld
waitForCommunicator = waitForCommunicatorOld
waitForRestart = waitForRestartOld
}
}
func TestProvisionerProvision_CustomCommand ( t * testing . T ) {
func TestProvisionerProvision_CustomCommand ( t * testing . T ) {
@ -131,6 +136,10 @@ func TestProvisionerProvision_CustomCommand(t *testing.T) {
waitForCommunicator = func ( p * Provisioner ) error {
waitForCommunicator = func ( p * Provisioner ) error {
return nil
return nil
}
}
waitForRestartOld := waitForRestart
waitForRestart = func ( p * Provisioner , comm packer . Communicator ) error {
return nil
}
err := p . Provision ( ui , comm )
err := p . Provision ( ui , comm )
if err != nil {
if err != nil {
t . Fatal ( "should not have error" )
t . Fatal ( "should not have error" )
@ -142,6 +151,7 @@ func TestProvisionerProvision_CustomCommand(t *testing.T) {
}
}
// Set this back!
// Set this back!
waitForCommunicator = waitForCommunicatorOld
waitForCommunicator = waitForCommunicatorOld
waitForRestart = waitForRestartOld
}
}
func TestProvisionerProvision_RestartCommandFail ( t * testing . T ) {
func TestProvisionerProvision_RestartCommandFail ( t * testing . T ) {