Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to test behavior with QoS 1 with connection drop-out mid-publish? #76

Open
philCryoport opened this issue Jun 9, 2022 · 2 comments
Labels

Comments

@philCryoport
Copy link

Hi there,

We are considering AWS IoT Core.

Our Quality department has asked for us to run a Operational Quality test between the MQTT client and AWS IoT MQTT broker so that we can document evidence of the following behavior:

  • IF
    • QoS 1 is enabled for publishing from a MQTT client to a MQTT broker's topic
  • AND
    • WHILE the MQTT client is publishing a message to that MQTT broker's topic
    • IF the connection drops mid-publish
  • THEN
    • The MQTT broker will not accept the partial message -- and thus the message won't be delivered to the topic
    • AND
    • The MQTT client will NOT receive a PUBACK

I looked through the code and the only thing I could find that was close to this was https://github.com/eclipse/paho.mqtt.testing/blob/252b6b9a486336221a5fd9d7cd0560f70e7922d7/interoperability/client_test.py#L322 ...but that only tests if there is no connection to begin with.

In contrast, what I'm seeking is a way to demonstrate behavior:

  • IF
    • The connection was there to begin with
  • AND THEN
    • Mid-publish, the connection drops

Help?

@icraggs
Copy link
Contributor

icraggs commented Jun 18, 2022

One way to do this, is to use a network proxy between the client and broker which will break the connection at the appropriate point. There is such a simple proxy in the testing repo and the C client repo (paho.mqtt.c) written in Python. It can be altered to cut the connection at the point you want.

@philCryoport
Copy link
Author

One way to do this, is to use a network proxy between the client and broker which will break the connection at the appropriate point. There is such a simple proxy in the testing repo and the C client repo (paho.mqtt.c) written in Python. It can be altered to cut the connection at the point you want.

Neat! I'll try it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants