mirror of https://github.com/hashicorp/packer
parent
fdda64f48e
commit
bbc5f305e2
@ -1 +1,26 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue