test for initialization failure when connection is closed.
This commit is contained in:
parent
465dc1108f
commit
80488fa7c8
@ -188,8 +188,36 @@ func (s *AgentServerTestSuite) Test_InitializationProtocolVersionMismatch() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *AgentServerTestSuite) Test_InitializationAgentConnectionClosed() {
|
||||||
|
s.agentConnection.Close()
|
||||||
|
s.checkInitializationFailure()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *AgentServerTestSuite) Test_InitializationServerConnectionClosed() {
|
||||||
|
s.serverConnection.Close()
|
||||||
|
s.checkInitializationFailure()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *AgentServerTestSuite) checkInitializationFailure() []any {
|
||||||
|
return testsupport.RunAndWait(
|
||||||
|
&s.Suite,
|
||||||
|
func() any {
|
||||||
|
serverInfo, err := AgentInitialization(s.agentConnection,
|
||||||
|
NewEnvironmentInfo("myshell"))
|
||||||
|
s.NotNil(err)
|
||||||
|
s.Equal(ServerInfo{}, serverInfo)
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
func() any {
|
||||||
|
serverInfo := ServerInfo{TestId: 1000}
|
||||||
|
environmentInfo, err := ServerInitialization(s.serverConnection, serverInfo)
|
||||||
|
s.NotNil(err)
|
||||||
|
s.Equal(EnvironmentInfo{}, environmentInfo)
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
// Test for protocolversion mismatch: verify error is returned. Use sentinel error
|
|
||||||
// Tests when connection is close from agent and from server: verify error is returned
|
// Tests when connection is close from agent and from server: verify error is returned
|
||||||
|
|
||||||
func (s *AgentServerTestSuite) Test_ListenForAgentEvents() {
|
func (s *AgentServerTestSuite) Test_ListenForAgentEvents() {
|
||||||
|
Loading…
Reference in New Issue
Block a user