feat: 补齐虚拟机验收并去掉 Docker 弱网占位
This commit is contained in:
@@ -45,6 +45,19 @@ func MQTTLogin(t *testing.T, httpBase, endpointID, password string) *MQTTSession
|
||||
return MQTTLoginWith(t, httpBase, endpointID, password, MQTTLoginOpts{})
|
||||
}
|
||||
|
||||
// MQTTLoginTCP 用裸 TCP 连上 listen 地址,完成订阅与 hello。
|
||||
func MQTTLoginTCP(t *testing.T, addr, endpointID, password string) *MQTTSession {
|
||||
t.Helper()
|
||||
mc, err := harness.DialMQTTTCP(addr, 15*time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("dial tcp mqtt: %v", err)
|
||||
}
|
||||
s := &MQTTSession{t: t, mc: mc, EndpointID: endpointID, pktID: 10, done: make(chan struct{})}
|
||||
s.connectSubscribeHello(password, MQTTLoginOpts{})
|
||||
go s.readLoop()
|
||||
return s
|
||||
}
|
||||
|
||||
// MQTTLoginWith 同 MQTTLogin,可声明接收上限等。
|
||||
func MQTTLoginWith(t *testing.T, httpBase, endpointID, password string, opts MQTTLoginOpts) *MQTTSession {
|
||||
t.Helper()
|
||||
|
||||
Reference in New Issue
Block a user