Question regarding send/exprect test

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Question regarding send/exprect test

S. Seide

currently i try to setup an generic tcp test for an mqtt server. The
protocol is simple but a binary one (1).

The following test send the correct CONNECT package to the server but i
did not manage to create a working expect string. Ist it possible or do
we need an nativ implementation of the protocol for a specific
connection test?

check process mosquitto with pidfile /var/run/
 if failed port 1883
  send "\0x10\0x16\0x00\0x04MQTT\0x04\0x02\0x00\0x02\0x00\0x05Monitoring"
  expect "\0x20\0x00\0x00\0x00"  # con ok
  send "\0xE0\0x00"              # disconnect
  then alert

other expected string may be connection refused/not authorized if auth
is required:
  expect "\0x20\0x00\0x00\0x05"

Thanks in advance,
S. Seide


To unsubscribe: