MCPcopy
hub / github.com/cloudfoundry/cli / BlockAcceptOnClose

Function BlockAcceptOnClose

util/clissh/ssh_test.go:37–51  ·  view source on GitHub ↗
(fake *fake_net.FakeListener)

Source from the content-addressed store, hash-verified

35)
36
37func BlockAcceptOnClose(fake *fake_net.FakeListener) {
38 waitUntilClosed := make(chan bool)
39 fake.AcceptStub = func() (net.Conn, error) {
40 <-waitUntilClosed
41 return nil, errors.New("banana")
42 }
43
44 var once sync.Once
45 fake.CloseStub = func() error {
46 once.Do(func() {
47 close(waitUntilClosed)
48 })
49 return nil
50 }
51}
52
53var _ = Describe("CLI SSH", Serial, FlakeAttempts(9), func() {
54 var (

Callers 1

ssh_test.goFile · 0.85

Calls 1

DoMethod · 0.65

Tested by

no test coverage detected