You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/packer/communicator_test.go

27 lines
353 B

package packer
import (
"testing"
"time"
)
func TestRemoteCmd_Wait(t *testing.T) {
var cmd RemoteCmd
result := make(chan bool)
go func() {
cmd.Wait()
result <- true
}()
cmd.ExitStatus = 42
cmd.Exited = true
select {
case <-result:
// Success
case <-time.After(500 * time.Millisecond):
t.Fatal("never got exit notification")
}
}