github.com/askholme/packer@v0.7.2-0.20140924152349-70d9566a6852/packer/plugin/provisioner_test.go (about) 1 package plugin 2 3 import ( 4 "os/exec" 5 "testing" 6 ) 7 8 func TestProvisioner_NoExist(t *testing.T) { 9 c := NewClient(&ClientConfig{Cmd: exec.Command("i-should-not-exist")}) 10 defer c.Kill() 11 12 _, err := c.Provisioner() 13 if err == nil { 14 t.Fatal("should have error") 15 } 16 } 17 18 func TestProvisioner_Good(t *testing.T) { 19 c := NewClient(&ClientConfig{Cmd: helperProcess("provisioner")}) 20 defer c.Kill() 21 22 _, err := c.Provisioner() 23 if err != nil { 24 t.Fatalf("should not have error: %s", err) 25 } 26 }