diff --git a/test/broker/01-connect-uname-password-denied.py b/test/broker/01-connect-uname-password-denied.py index d824d6c1..4cb7a3a5 100755 --- a/test/broker/01-connect-uname-password-denied.py +++ b/test/broker/01-connect-uname-password-denied.py @@ -3,8 +3,6 @@ # Test whether a connection is denied if it provides a correct username but # incorrect password. -import subprocess - import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) diff --git a/test/broker/02-subpub-qos1.py b/test/broker/02-subpub-qos1.py index 02a73f26..f321151e 100755 --- a/test/broker/02-subpub-qos1.py +++ b/test/broker/02-subpub-qos1.py @@ -2,8 +2,6 @@ # Test whether a client subscribed to a topic receives its own message sent to that topic. -import socket - import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) diff --git a/test/broker/02-unsubscribe-qos1.py b/test/broker/02-unsubscribe-qos1.py index b5349515..2bbf31ab 100755 --- a/test/broker/02-unsubscribe-qos1.py +++ b/test/broker/02-unsubscribe-qos1.py @@ -2,8 +2,6 @@ # Test whether a SUBSCRIBE to a topic with QoS 1 results in the correct SUBACK packet. -import subprocess - import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) diff --git a/test/broker/02-unsubscribe-qos2.py b/test/broker/02-unsubscribe-qos2.py index 909e2de1..3333ed6a 100755 --- a/test/broker/02-unsubscribe-qos2.py +++ b/test/broker/02-unsubscribe-qos2.py @@ -2,8 +2,6 @@ # Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. -import subprocess - import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) diff --git a/test/broker/03-publish-qos2.py b/test/broker/03-publish-qos2.py index d142fd4d..b69e90e6 100755 --- a/test/broker/03-publish-qos2.py +++ b/test/broker/03-publish-qos2.py @@ -2,8 +2,6 @@ # Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. -import subprocess - import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) diff --git a/test/broker/04-retain-qos1-qos0.py b/test/broker/04-retain-qos1-qos0.py index 0ba588b8..59d4c9dd 100755 --- a/test/broker/04-retain-qos1-qos0.py +++ b/test/broker/04-retain-qos1-qos0.py @@ -4,8 +4,6 @@ # Subscription is made with QoS 0 so the retained message should also have QoS # 0. -import socket - import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) diff --git a/test/broker/06-bridge-b2br-disconnect-qos1.py b/test/broker/06-bridge-b2br-disconnect-qos1.py index b2147878..e48003e3 100755 --- a/test/broker/06-bridge-b2br-disconnect-qos1.py +++ b/test/broker/06-bridge-b2br-disconnect-qos1.py @@ -3,7 +3,6 @@ # Does a bridge resend a QoS=1 message correctly after a disconnect? import socket -import time import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder diff --git a/test/broker/07-will-null-topic.py b/test/broker/07-will-null-topic.py index c6d82f6e..bb1ca658 100755 --- a/test/broker/07-will-null-topic.py +++ b/test/broker/07-will-null-topic.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import struct -import subprocess import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder diff --git a/test/broker/08-ssl-connect-cert-auth-without.py b/test/broker/08-ssl-connect-cert-auth-without.py index 6e96d488..b82a6eb3 100755 --- a/test/broker/08-ssl-connect-cert-auth-without.py +++ b/test/broker/08-ssl-connect-cert-auth-without.py @@ -12,7 +12,7 @@ if sys.version < '2.7': print("WARNING: SSL not supported on Python 2.6") exit(0) -import inspect, os, sys +import inspect, os # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) if cmd_subfolder not in sys.path: diff --git a/test/broker/09-plugin-auth-unpwd-success.py b/test/broker/09-plugin-auth-unpwd-success.py index 3128cb99..422e8e79 100755 --- a/test/broker/09-plugin-auth-unpwd-success.py +++ b/test/broker/09-plugin-auth-unpwd-success.py @@ -3,8 +3,6 @@ # Test whether a connection is successful with correct username and password # when using a simple auth_plugin. -import time - import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) diff --git a/test/lib/02-subscribe-qos0.py b/test/lib/02-subscribe-qos0.py index 99c90376..7b0d5988 100755 --- a/test/lib/02-subscribe-qos0.py +++ b/test/lib/02-subscribe-qos0.py @@ -63,7 +63,7 @@ try: if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): rc = 0 - + conn.close() finally: client.terminate() diff --git a/test/lib/02-subscribe-qos1.py b/test/lib/02-subscribe-qos1.py index f576e5a8..fa5144bc 100755 --- a/test/lib/02-subscribe-qos1.py +++ b/test/lib/02-subscribe-qos1.py @@ -60,7 +60,7 @@ try: if mosq_test.expect_packet(conn, "subscribe", subscribe_packet): conn.send(suback_packet) - + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): rc = 0 diff --git a/test/lib/02-unsubscribe.py b/test/lib/02-unsubscribe.py index 2b147b65..ec9805ba 100755 --- a/test/lib/02-unsubscribe.py +++ b/test/lib/02-unsubscribe.py @@ -50,7 +50,7 @@ try: if mosq_test.expect_packet(conn, "unsubscribe", unsubscribe_packet): conn.send(unsuback_packet) - + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): rc = 0