@@ -135,16 +135,16 @@ mod test {
135135 anyhow:: bail!( "kubectl is not installed" ) ;
136136 }
137137
138- // Port forward the emqx mqtt broker
139- let forward_port = port_forward_emqx ( mqtt_port) . await ?;
140-
141- // Publish a message to the emqx broker
142- let mut mqttoptions = rumqttc:: MqttOptions :: new ( "123" , "127.0.0.1" , forward_port) ;
138+ // Publish a message to the MQTT broker
139+ let mut mqttoptions = rumqttc:: MqttOptions :: new ( "123" , "test.mosquitto.org" , mqtt_port) ;
143140 mqttoptions. set_keep_alive ( std:: time:: Duration :: from_secs ( 1 ) ) ;
144141
145142 let ( client, mut eventloop) = rumqttc:: AsyncClient :: new ( mqttoptions, 10 ) ;
146143 client
147- . subscribe ( "hello" , rumqttc:: QoS :: AtMostOnce )
144+ . subscribe (
145+ "containerd-shim-spin/mqtt-test-17h24d" ,
146+ rumqttc:: QoS :: AtMostOnce ,
147+ )
148148 . await
149149 . unwrap ( ) ;
150150
@@ -153,7 +153,7 @@ mod test {
153153 for _i in 0 ..iterations {
154154 client
155155 . publish (
156- "hello " ,
156+ "containerd-shim-spin/mqtt-test-17h24d " ,
157157 rumqttc:: QoS :: AtLeastOnce ,
158158 false ,
159159 message. as_bytes ( ) ,
@@ -227,20 +227,6 @@ mod test {
227227 Ok ( port)
228228 }
229229
230- async fn port_forward_emqx ( emqx_port : u16 ) -> Result < u16 > {
231- let port = get_random_port ( ) ?;
232-
233- println ! ( " >>> kubectl portforward emqx {}:{} " , port, emqx_port) ;
234-
235- Command :: new ( "kubectl" )
236- . arg ( "port-forward" )
237- . arg ( "emqx" )
238- . arg ( format ! ( "{}:{}" , port, emqx_port) )
239- . spawn ( ) ?;
240- tokio:: time:: sleep ( tokio:: time:: Duration :: from_secs ( 2 ) ) . await ;
241- Ok ( port)
242- }
243-
244230 async fn get_logs_by_label ( label : & str ) -> Result < String > {
245231 let output = Command :: new ( "kubectl" )
246232 . arg ( "logs" )
0 commit comments