tested connections through the session.
This commit is contained in:
parent
b65c824ca1
commit
1ca7209588
@ -97,6 +97,32 @@ func (s *AgentServerTestSuite) TestNewCommChannel() {
|
|||||||
log.Printf("%v %v", agentCommChannel, serverCommChannel)
|
log.Printf("%v %v", agentCommChannel, serverCommChannel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *AgentServerTestSuite) Test_ConnectThroughYamux() {
|
||||||
|
agentCommChannel, serverCommChannel := s.createCommChannel()
|
||||||
|
|
||||||
|
data := "hello"
|
||||||
|
testsupport.RunAndWait(
|
||||||
|
&s.Suite,
|
||||||
|
func() any {
|
||||||
|
conn, err := agentCommChannel.Session.OpenStream()
|
||||||
|
s.Nil(err)
|
||||||
|
n, err := conn.Write([]byte(data))
|
||||||
|
s.Nil(err)
|
||||||
|
s.Equal(len(data), n)
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
func() any {
|
||||||
|
conn, err := serverCommChannel.Session.Accept()
|
||||||
|
s.Nil(err)
|
||||||
|
buf := make([]byte, len(data))
|
||||||
|
n, err := conn.Read(buf)
|
||||||
|
s.Nil(err)
|
||||||
|
s.Equal(len(data), n)
|
||||||
|
s.Equal([]byte(data), buf[:n])
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func (s *AgentServerTestSuite) Test_ListenForAgentEvents() {
|
func (s *AgentServerTestSuite) Test_ListenForAgentEvents() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user