2015-10-23 19:50:14 -04:00
|
|
|
package iso
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2018-01-22 20:21:10 -05:00
|
|
|
|
2018-01-22 18:32:33 -05:00
|
|
|
"github.com/hashicorp/packer/helper/multistep"
|
2015-10-23 19:50:14 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestStepExport_impl(t *testing.T) {
|
|
|
|
var _ multistep.Step = new(StepExport)
|
|
|
|
}
|
|
|
|
|
|
|
|
func testStepExport_wrongtype_impl(t *testing.T, remoteType string) {
|
|
|
|
state := testState(t)
|
|
|
|
step := new(StepExport)
|
|
|
|
|
|
|
|
var config Config
|
|
|
|
config.RemoteType = "foo"
|
|
|
|
state.Put("config", &config)
|
|
|
|
|
|
|
|
if action := step.Run(state); action != multistep.ActionContinue {
|
|
|
|
t.Fatalf("bad action: %#v", action)
|
|
|
|
}
|
|
|
|
if _, ok := state.GetOk("error"); ok {
|
|
|
|
t.Fatal("should NOT have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cleanup
|
|
|
|
step.Cleanup(state)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestStepExport_wrongtype_impl(t *testing.T) {
|
|
|
|
testStepExport_wrongtype_impl(t, "foo")
|
|
|
|
testStepExport_wrongtype_impl(t, "")
|
|
|
|
}
|