diff --git a/misc/currentcost/gnome-panel/CurrentCostMQTT.py b/misc/currentcost/gnome-panel/CurrentCostMQTT.py index dcc59958dc..1091f19499 100755 --- a/misc/currentcost/gnome-panel/CurrentCostMQTT.py +++ b/misc/currentcost/gnome-panel/CurrentCostMQTT.py @@ -1,12 +1,8 @@ #!/usr/bin/env python import gnomeapplet -import gobject import gtk import mosquitto -import os -import platform -import pygtk import sys class CurrentCostMQTT(gnomeapplet.Applet): @@ -30,7 +26,7 @@ def on_change_background(self, applet, type, color, pixmap): def show_menu(self, widget, event): print "menu" - + def __init__(self, applet, iid): self.applet = applet self.label = gtk.Label("0W") @@ -63,7 +59,7 @@ def CurrentCostMQTT_factory(applet, iid): main_window.show_all() gtk.main() sys.exit() - + if __name__ == '__main__': gnomeapplet.bonobo_factory("OAFIID:CurrentCostMQTT_Factory", gnomeapplet.Applet.__gtype__, "MQTT", "0", CurrentCostMQTT_factory) diff --git a/test/broker/01-connect-anon-denied.py b/test/broker/01-connect-anon-denied.py index 3b2820c739..b3d4036653 100755 --- a/test/broker/01-connect-anon-denied.py +++ b/test/broker/01-connect-anon-denied.py @@ -2,10 +2,6 @@ # Test whether an anonymous connection is correctly denied. -import subprocess -import socket -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/broker/01-connect-invalid-id-0-311.py b/test/broker/01-connect-invalid-id-0-311.py index 5b9f5136c2..f5deced4b0 100755 --- a/test/broker/01-connect-invalid-id-0-311.py +++ b/test/broker/01-connect-invalid-id-0-311.py @@ -2,10 +2,6 @@ # Test whether a CONNECT with a zero length client id results in the correct CONNACK packet. -import subprocess -import socket -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/broker/01-connect-invalid-id-0.py b/test/broker/01-connect-invalid-id-0.py index 32f38c86c8..34faf0f724 100755 --- a/test/broker/01-connect-invalid-id-0.py +++ b/test/broker/01-connect-invalid-id-0.py @@ -2,10 +2,6 @@ # Test whether a CONNECT with a zero length client id results in the correct CONNACK packet. -import subprocess -import socket -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/broker/01-connect-invalid-id-missing.py b/test/broker/01-connect-invalid-id-missing.py index 3066776c33..b42888fb8e 100755 --- a/test/broker/01-connect-invalid-id-missing.py +++ b/test/broker/01-connect-invalid-id-missing.py @@ -2,10 +2,6 @@ # Test whether a CONNECT with a zero length client id results in the correct CONNACK packet. -import subprocess -import socket -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/broker/01-connect-invalid-protonum.py b/test/broker/01-connect-invalid-protonum.py index ec9f826b25..61281641c5 100755 --- a/test/broker/01-connect-invalid-protonum.py +++ b/test/broker/01-connect-invalid-protonum.py @@ -2,10 +2,6 @@ # Test whether a CONNECT with an invalid protocol number results in the correct CONNACK packet. -import subprocess -import socket -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/broker/01-connect-success.py b/test/broker/01-connect-success.py index 45c26a8702..e2311885f0 100755 --- a/test/broker/01-connect-success.py +++ b/test/broker/01-connect-success.py @@ -3,11 +3,6 @@ # Test whether a valid CONNECT results in the correct CONNACK packet. import inspect, os, sys -import os -import subprocess -import socket -import sys -import time # 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/01-connect-uname-no-password-denied.py b/test/broker/01-connect-uname-no-password-denied.py index 85ff082198..3dbd570019 100755 --- a/test/broker/01-connect-uname-no-password-denied.py +++ b/test/broker/01-connect-uname-no-password-denied.py @@ -3,10 +3,6 @@ # Test whether a connection is denied if it provides just a username when it # needs a username and password. -import subprocess -import socket -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/broker/01-connect-uname-password-denied.py b/test/broker/01-connect-uname-password-denied.py index b3052a1dd0..d824d6c14a 100755 --- a/test/broker/01-connect-uname-password-denied.py +++ b/test/broker/01-connect-uname-password-denied.py @@ -4,8 +4,6 @@ # incorrect password. import subprocess -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/01-connect-uname-password-success-no-tls.py b/test/broker/01-connect-uname-password-success-no-tls.py index 19c509b5ff..5421f70071 100755 --- a/test/broker/01-connect-uname-password-success-no-tls.py +++ b/test/broker/01-connect-uname-password-success-no-tls.py @@ -3,10 +3,6 @@ # Test whether a connection is denied if it provides a correct username but # incorrect password. -import subprocess -import socket -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/broker/01-connect-uname-password-success.py b/test/broker/01-connect-uname-password-success.py index 19c509b5ff..5421f70071 100755 --- a/test/broker/01-connect-uname-password-success.py +++ b/test/broker/01-connect-uname-password-success.py @@ -3,10 +3,6 @@ # Test whether a connection is denied if it provides a correct username but # incorrect password. -import subprocess -import socket -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/broker/02-subpub-qos0.py b/test/broker/02-subpub-qos0.py index 0a65d774a2..295b01731b 100755 --- a/test/broker/02-subpub-qos0.py +++ b/test/broker/02-subpub-qos0.py @@ -2,10 +2,6 @@ # Test whether a client subscribed to a topic receives its own message sent to that topic. -import subprocess -import socket -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/broker/02-subpub-qos1.py b/test/broker/02-subpub-qos1.py index c6ff766897..02a73f26c2 100755 --- a/test/broker/02-subpub-qos1.py +++ b/test/broker/02-subpub-qos1.py @@ -2,9 +2,7 @@ # Test whether a client subscribed to a topic receives its own message sent to that topic. -import subprocess 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/02-subpub-qos2.py b/test/broker/02-subpub-qos2.py index df7d374920..6d32a8c4cf 100755 --- a/test/broker/02-subpub-qos2.py +++ b/test/broker/02-subpub-qos2.py @@ -2,10 +2,6 @@ # Test whether a client subscribed to a topic receives its own message sent to that topic. -import subprocess -import socket -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/broker/02-subscribe-qos0.py b/test/broker/02-subscribe-qos0.py index 370f67a59b..22f1904fb6 100755 --- a/test/broker/02-subscribe-qos0.py +++ b/test/broker/02-subscribe-qos0.py @@ -2,10 +2,7 @@ # Test whether a SUBSCRIBE to a topic with QoS 0 results in the correct SUBACK packet. -import subprocess -import socket 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/broker/02-subscribe-qos1.py b/test/broker/02-subscribe-qos1.py index bba2dec005..ca150d7321 100755 --- a/test/broker/02-subscribe-qos1.py +++ b/test/broker/02-subscribe-qos1.py @@ -2,10 +2,6 @@ # Test whether a SUBSCRIBE to a topic with QoS 1 results in the correct SUBACK packet. -import subprocess -import socket -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/broker/02-subscribe-qos2.py b/test/broker/02-subscribe-qos2.py index e56daac5e9..5f2ebdc3dd 100755 --- a/test/broker/02-subscribe-qos2.py +++ b/test/broker/02-subscribe-qos2.py @@ -2,10 +2,6 @@ # Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. -import subprocess -import socket -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/broker/02-unsubscribe-qos0.py b/test/broker/02-unsubscribe-qos0.py index b222129cb0..fbfec67105 100755 --- a/test/broker/02-unsubscribe-qos0.py +++ b/test/broker/02-unsubscribe-qos0.py @@ -3,10 +3,6 @@ # Test whether a UNSUBSCRIBE to a topic with QoS 0 results in the correct UNSUBACK packet. # This doesn't assume a subscription exists. -import subprocess -import socket -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/broker/02-unsubscribe-qos1.py b/test/broker/02-unsubscribe-qos1.py index db18cfda1a..b5349515ea 100755 --- a/test/broker/02-unsubscribe-qos1.py +++ b/test/broker/02-unsubscribe-qos1.py @@ -3,8 +3,6 @@ # Test whether a SUBSCRIBE to a topic with QoS 1 results in the correct SUBACK packet. import subprocess -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/02-unsubscribe-qos2.py b/test/broker/02-unsubscribe-qos2.py index c3b2fd853d..909e2de1f5 100755 --- a/test/broker/02-unsubscribe-qos2.py +++ b/test/broker/02-unsubscribe-qos2.py @@ -3,8 +3,6 @@ # Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. import subprocess -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/03-pattern-matching-helper.py b/test/broker/03-pattern-matching-helper.py index b247a34fdf..4db430a21b 100755 --- a/test/broker/03-pattern-matching-helper.py +++ b/test/broker/03-pattern-matching-helper.py @@ -1,9 +1,5 @@ #!/usr/bin/env python -import subprocess -import socket -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],".."))) @@ -23,6 +19,6 @@ sock.send(publish_packet) rc = 0 sock.close() - + exit(rc) diff --git a/test/broker/03-pattern-matching.py b/test/broker/03-pattern-matching.py index a5d38aba87..4e9a46774a 100755 --- a/test/broker/03-pattern-matching.py +++ b/test/broker/03-pattern-matching.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import subprocess -import socket import time import inspect, os, sys diff --git a/test/broker/03-publish-b2c-disconnect-qos1-helper.py b/test/broker/03-publish-b2c-disconnect-qos1-helper.py index 8c322297aa..3ad3ebaa0e 100755 --- a/test/broker/03-publish-b2c-disconnect-qos1-helper.py +++ b/test/broker/03-publish-b2c-disconnect-qos1-helper.py @@ -1,9 +1,5 @@ #!/usr/bin/env python -import subprocess -import socket -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/broker/03-publish-b2c-disconnect-qos1.py b/test/broker/03-publish-b2c-disconnect-qos1.py index 009dc70c5a..ea1ca09a70 100755 --- a/test/broker/03-publish-b2c-disconnect-qos1.py +++ b/test/broker/03-publish-b2c-disconnect-qos1.py @@ -2,8 +2,6 @@ import subprocess import socket -import time -from os import environ import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder diff --git a/test/broker/03-publish-b2c-disconnect-qos2-helper.py b/test/broker/03-publish-b2c-disconnect-qos2-helper.py index 23ca09131b..afc8cf8856 100755 --- a/test/broker/03-publish-b2c-disconnect-qos2-helper.py +++ b/test/broker/03-publish-b2c-disconnect-qos2-helper.py @@ -2,10 +2,6 @@ # Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. -import subprocess -import socket -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/broker/03-publish-b2c-disconnect-qos2.py b/test/broker/03-publish-b2c-disconnect-qos2.py index 8a66434f67..cc889c6e72 100755 --- a/test/broker/03-publish-b2c-disconnect-qos2.py +++ b/test/broker/03-publish-b2c-disconnect-qos2.py @@ -1,9 +1,6 @@ #!/usr/bin/env python import subprocess -import socket -import time -from os import environ import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder diff --git a/test/broker/03-publish-b2c-timeout-qos1-helper.py b/test/broker/03-publish-b2c-timeout-qos1-helper.py index 6d78356809..18c462635b 100755 --- a/test/broker/03-publish-b2c-timeout-qos1-helper.py +++ b/test/broker/03-publish-b2c-timeout-qos1-helper.py @@ -2,10 +2,6 @@ # Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. -import subprocess -import socket -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],".."))) @@ -30,6 +26,6 @@ rc = 0 sock.close() - + exit(rc) diff --git a/test/broker/03-publish-b2c-timeout-qos1.py b/test/broker/03-publish-b2c-timeout-qos1.py index cc319596d6..7fb87195be 100755 --- a/test/broker/03-publish-b2c-timeout-qos1.py +++ b/test/broker/03-publish-b2c-timeout-qos1.py @@ -3,9 +3,6 @@ # Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. import subprocess -import socket -import time -from os import environ import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder diff --git a/test/broker/03-publish-b2c-timeout-qos2-helper.py b/test/broker/03-publish-b2c-timeout-qos2-helper.py index 9ccd5e72c8..45a1e237d6 100755 --- a/test/broker/03-publish-b2c-timeout-qos2-helper.py +++ b/test/broker/03-publish-b2c-timeout-qos2-helper.py @@ -2,10 +2,6 @@ # Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. -import subprocess -import socket -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/broker/03-publish-b2c-timeout-qos2.py b/test/broker/03-publish-b2c-timeout-qos2.py index 092299af6a..81efafb0a2 100755 --- a/test/broker/03-publish-b2c-timeout-qos2.py +++ b/test/broker/03-publish-b2c-timeout-qos2.py @@ -3,9 +3,6 @@ # Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. import subprocess -import socket -import time -from os import environ import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder diff --git a/test/broker/03-publish-c2b-disconnect-qos2.py b/test/broker/03-publish-c2b-disconnect-qos2.py index 79c731944e..e082b6978e 100755 --- a/test/broker/03-publish-c2b-disconnect-qos2.py +++ b/test/broker/03-publish-c2b-disconnect-qos2.py @@ -1,10 +1,5 @@ #!/usr/bin/env python -import subprocess -import socket -import time -from os import environ - 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-c2b-timeout-qos2.py b/test/broker/03-publish-c2b-timeout-qos2.py index a6e5997d6c..e6fdecbb29 100755 --- a/test/broker/03-publish-c2b-timeout-qos2.py +++ b/test/broker/03-publish-c2b-timeout-qos2.py @@ -4,10 +4,6 @@ # flow. This test introduces delays into the flow in order to force the broker # to send duplicate PUBREC and PUBCOMP messages. -import subprocess -import socket -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/broker/03-publish-qos1.py b/test/broker/03-publish-qos1.py index 6d183550f8..ce594c0b46 100755 --- a/test/broker/03-publish-qos1.py +++ b/test/broker/03-publish-qos1.py @@ -2,10 +2,6 @@ # Test whether a PUBLISH to a topic with QoS 1 results in the correct PUBACK packet. -import subprocess -import socket -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/broker/03-publish-qos2.py b/test/broker/03-publish-qos2.py index 81b612d14f..d142fd4d11 100755 --- a/test/broker/03-publish-qos2.py +++ b/test/broker/03-publish-qos2.py @@ -3,8 +3,6 @@ # Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. import subprocess -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/04-retain-qos0-clear.py b/test/broker/04-retain-qos0-clear.py index 08d76ccf87..e2c41c0d78 100755 --- a/test/broker/04-retain-qos0-clear.py +++ b/test/broker/04-retain-qos0-clear.py @@ -3,9 +3,7 @@ # Test whether a retained PUBLISH is cleared when a zero length retained # message is published to a topic. -import subprocess 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/04-retain-qos0-fresh.py b/test/broker/04-retain-qos0-fresh.py index caee6d8063..39f58ae7af 100755 --- a/test/broker/04-retain-qos0-fresh.py +++ b/test/broker/04-retain-qos0-fresh.py @@ -3,10 +3,6 @@ # Test whether a retained PUBLISH to a topic with QoS 0 is sent with # retain=false to an already subscribed client. -import subprocess -import socket -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/broker/04-retain-qos0-repeated.py b/test/broker/04-retain-qos0-repeated.py index 63df81a43a..74644a6f43 100755 --- a/test/broker/04-retain-qos0-repeated.py +++ b/test/broker/04-retain-qos0-repeated.py @@ -3,10 +3,6 @@ # Test whether a retained PUBLISH to a topic with QoS 0 is actually retained # and delivered when multiple sub/unsub operations are carried out. -import subprocess -import socket -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/broker/04-retain-qos0.py b/test/broker/04-retain-qos0.py index c5d6c36a50..b0fa51bc53 100755 --- a/test/broker/04-retain-qos0.py +++ b/test/broker/04-retain-qos0.py @@ -2,10 +2,6 @@ # Test whether a retained PUBLISH to a topic with QoS 0 is actually retained. -import subprocess -import socket -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/broker/04-retain-qos1-qos0.py b/test/broker/04-retain-qos1-qos0.py index 725d3ed99a..0ba588b8e9 100755 --- a/test/broker/04-retain-qos1-qos0.py +++ b/test/broker/04-retain-qos1-qos0.py @@ -4,9 +4,7 @@ # Subscription is made with QoS 0 so the retained message should also have QoS # 0. -import subprocess 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/05-clean-session-qos1-helper.py b/test/broker/05-clean-session-qos1-helper.py index 620099c64b..c3b129dbf7 100755 --- a/test/broker/05-clean-session-qos1-helper.py +++ b/test/broker/05-clean-session-qos1-helper.py @@ -2,10 +2,6 @@ # Test whether a clean session client has a QoS 1 message queued for it. -import subprocess -import socket -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],".."))) @@ -30,6 +26,6 @@ rc = 0 sock.close() - + exit(rc) diff --git a/test/broker/05-clean-session-qos1.py b/test/broker/05-clean-session-qos1.py index 332dc738fb..5619773068 100755 --- a/test/broker/05-clean-session-qos1.py +++ b/test/broker/05-clean-session-qos1.py @@ -3,8 +3,6 @@ # Test whether a clean session client has a QoS 1 message queued for it. import subprocess -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/06-bridge-b2br-disconnect-qos1.py b/test/broker/06-bridge-b2br-disconnect-qos1.py index 011c8cf32d..b214787838 100755 --- a/test/broker/06-bridge-b2br-disconnect-qos1.py +++ b/test/broker/06-bridge-b2br-disconnect-qos1.py @@ -2,8 +2,6 @@ # Does a bridge resend a QoS=1 message correctly after a disconnect? -import os -import subprocess import socket import time diff --git a/test/broker/06-bridge-b2br-disconnect-qos2.py b/test/broker/06-bridge-b2br-disconnect-qos2.py index adaa5d044b..243eb61628 100755 --- a/test/broker/06-bridge-b2br-disconnect-qos2.py +++ b/test/broker/06-bridge-b2br-disconnect-qos2.py @@ -2,10 +2,7 @@ # Does a bridge resend a QoS=1 message correctly after a disconnect? -import os -import subprocess 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/06-bridge-br2b-disconnect-qos1-helper.py b/test/broker/06-bridge-br2b-disconnect-qos1-helper.py index 06c67450ba..afa93c320f 100755 --- a/test/broker/06-bridge-br2b-disconnect-qos1-helper.py +++ b/test/broker/06-bridge-br2b-disconnect-qos1-helper.py @@ -1,9 +1,5 @@ #!/usr/bin/env python -import subprocess -import socket -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/broker/06-bridge-br2b-disconnect-qos1.py b/test/broker/06-bridge-br2b-disconnect-qos1.py index 20546a23e3..9047d455af 100755 --- a/test/broker/06-bridge-br2b-disconnect-qos1.py +++ b/test/broker/06-bridge-br2b-disconnect-qos1.py @@ -2,10 +2,8 @@ # Does a bridge resend a QoS=1 message correctly after a disconnect? -import os import subprocess 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/06-bridge-br2b-disconnect-qos2-helper.py b/test/broker/06-bridge-br2b-disconnect-qos2-helper.py index 7515e5a2c8..d7f04b7105 100755 --- a/test/broker/06-bridge-br2b-disconnect-qos2-helper.py +++ b/test/broker/06-bridge-br2b-disconnect-qos2-helper.py @@ -1,9 +1,5 @@ #!/usr/bin/env python -import subprocess -import socket -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/broker/06-bridge-br2b-disconnect-qos2.py b/test/broker/06-bridge-br2b-disconnect-qos2.py index a0d6a9b23e..acb105af2c 100755 --- a/test/broker/06-bridge-br2b-disconnect-qos2.py +++ b/test/broker/06-bridge-br2b-disconnect-qos2.py @@ -2,10 +2,8 @@ # Does a bridge resend a QoS=1 message correctly after a disconnect? -import os import subprocess 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/06-bridge-reconnect-local-out-helper.py b/test/broker/06-bridge-reconnect-local-out-helper.py index 7222acd708..08a5636687 100755 --- a/test/broker/06-bridge-reconnect-local-out-helper.py +++ b/test/broker/06-bridge-reconnect-local-out-helper.py @@ -1,9 +1,5 @@ #!/usr/bin/env python -import subprocess -import socket -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],".."))) @@ -30,6 +26,6 @@ rc = 0 sock.close() - + exit(rc) diff --git a/test/broker/06-bridge-reconnect-local-out.py b/test/broker/06-bridge-reconnect-local-out.py index 6924475481..e846c69ad3 100755 --- a/test/broker/06-bridge-reconnect-local-out.py +++ b/test/broker/06-bridge-reconnect-local-out.py @@ -3,9 +3,7 @@ # Test whether a bridge topics work correctly after reconnection. # Important point here is that persistence is enabled. -import os import subprocess -import socket import time import inspect, os, sys diff --git a/test/broker/07-will-null-helper.py b/test/broker/07-will-null-helper.py index 458ef58969..8cfa0419cb 100755 --- a/test/broker/07-will-null-helper.py +++ b/test/broker/07-will-null-helper.py @@ -2,11 +2,6 @@ # Connect a client with a will, then disconnect without DISCONNECT. -import struct -import subprocess -import socket -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],".."))) @@ -23,6 +18,6 @@ sock = mosq_test.do_client_connect(connect_packet, connack_packet) rc = 0 sock.close() - + exit(rc) diff --git a/test/broker/07-will-null-topic.py b/test/broker/07-will-null-topic.py index 83247422d3..c6d82f6ec3 100755 --- a/test/broker/07-will-null-topic.py +++ b/test/broker/07-will-null-topic.py @@ -2,8 +2,6 @@ import struct import subprocess -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.py b/test/broker/07-will-null.py index e2e64a21c0..6d3bd7cfc3 100755 --- a/test/broker/07-will-null.py +++ b/test/broker/07-will-null.py @@ -2,11 +2,7 @@ # Test whether a client will is transmitted correctly with a null character in the middle. -import struct import subprocess -import socket -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/broker/07-will-qos0-helper.py b/test/broker/07-will-qos0-helper.py index a112f0a87b..8aec34eb68 100755 --- a/test/broker/07-will-qos0-helper.py +++ b/test/broker/07-will-qos0-helper.py @@ -2,10 +2,6 @@ # Connect a client with a will, then disconnect without DISCONNECT. -import subprocess -import socket -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],".."))) @@ -22,6 +18,6 @@ sock = mosq_test.do_client_connect(connect_packet, connack_packet) rc = 0 sock.close() - + exit(rc) diff --git a/test/broker/07-will-qos0.py b/test/broker/07-will-qos0.py index a6616c4bbb..6bc3b1ead8 100755 --- a/test/broker/07-will-qos0.py +++ b/test/broker/07-will-qos0.py @@ -3,8 +3,6 @@ # Test whether a client will is transmitted correctly. import subprocess -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/08-ssl-bridge-helper.py b/test/broker/08-ssl-bridge-helper.py index 9d68101f47..20dca406cb 100755 --- a/test/broker/08-ssl-bridge-helper.py +++ b/test/broker/08-ssl-bridge-helper.py @@ -1,9 +1,5 @@ #!/usr/bin/env python -import subprocess -import socket -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],".."))) @@ -25,5 +21,5 @@ sock.send(publish_packet) sock.send(disconnect_packet) sock.close() - + exit(0) diff --git a/test/broker/08-ssl-bridge.py b/test/broker/08-ssl-bridge.py index 22fe2ede77..3339e32755 100755 --- a/test/broker/08-ssl-bridge.py +++ b/test/broker/08-ssl-bridge.py @@ -1,10 +1,8 @@ #!/usr/bin/env python -import os import subprocess import socket import ssl -import time 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-crl.py b/test/broker/08-ssl-connect-cert-auth-crl.py index c783d784ea..e6343cca4a 100755 --- a/test/broker/08-ssl-connect-cert-auth-crl.py +++ b/test/broker/08-ssl-connect-cert-auth-crl.py @@ -1,16 +1,14 @@ #!/usr/bin/env python -import subprocess import socket import ssl import sys -import time 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/08-ssl-connect-cert-auth-expired.py b/test/broker/08-ssl-connect-cert-auth-expired.py index 6761d643ae..76c291e14b 100755 --- a/test/broker/08-ssl-connect-cert-auth-expired.py +++ b/test/broker/08-ssl-connect-cert-auth-expired.py @@ -3,7 +3,6 @@ # Test whether a valid CONNECT results in the correct CONNACK packet using an # SSL connection with client certificates required. -import subprocess import socket import ssl import sys @@ -13,7 +12,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/08-ssl-connect-cert-auth-revoked.py b/test/broker/08-ssl-connect-cert-auth-revoked.py index 0b2465509f..d04e672948 100755 --- a/test/broker/08-ssl-connect-cert-auth-revoked.py +++ b/test/broker/08-ssl-connect-cert-auth-revoked.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -import subprocess import socket import ssl import sys @@ -10,7 +9,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/08-ssl-connect-cert-auth-without.py b/test/broker/08-ssl-connect-cert-auth-without.py index a2fdebba4f..6e96d488c5 100755 --- a/test/broker/08-ssl-connect-cert-auth-without.py +++ b/test/broker/08-ssl-connect-cert-auth-without.py @@ -1,10 +1,8 @@ #!/usr/bin/env python # Test whether a client can connect without an SSL certificate if one is required. -# import errno -import subprocess import socket import ssl import sys diff --git a/test/broker/08-ssl-connect-cert-auth.py b/test/broker/08-ssl-connect-cert-auth.py index 42ba651091..6213306904 100755 --- a/test/broker/08-ssl-connect-cert-auth.py +++ b/test/broker/08-ssl-connect-cert-auth.py @@ -2,17 +2,15 @@ # Test whether a valid CONNECT results in the correct CONNACK packet using an SSL connection. -import subprocess import socket import ssl import sys -import time 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/08-ssl-connect-identity.py b/test/broker/08-ssl-connect-identity.py index 8119eb7f21..b8c781f752 100755 --- a/test/broker/08-ssl-connect-identity.py +++ b/test/broker/08-ssl-connect-identity.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # Client connects with a certificate to a server that has use_identity_as_username=true. Shouldn't be rejected. -import subprocess import socket import ssl import sys @@ -11,7 +10,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/08-ssl-connect-no-auth-wrong-ca.py b/test/broker/08-ssl-connect-no-auth-wrong-ca.py index dc6e782976..c911189af3 100755 --- a/test/broker/08-ssl-connect-no-auth-wrong-ca.py +++ b/test/broker/08-ssl-connect-no-auth-wrong-ca.py @@ -2,7 +2,6 @@ # Test whether a valid CONNECT results in the correct CONNACK packet using an SSL connection. -import subprocess import socket import ssl import sys @@ -12,7 +11,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: @@ -40,7 +39,7 @@ time.sleep(0.5) broker.terminate() -broker.wait +broker.wait() if rc: (stdo, stde) = broker.communicate() print(stde) diff --git a/test/broker/08-ssl-connect-no-auth.py b/test/broker/08-ssl-connect-no-auth.py index 27adf48a10..e534532eff 100755 --- a/test/broker/08-ssl-connect-no-auth.py +++ b/test/broker/08-ssl-connect-no-auth.py @@ -2,17 +2,15 @@ # Test whether a valid CONNECT results in the correct CONNACK packet using an SSL connection. -import subprocess import socket import ssl import sys -import time 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/08-ssl-connect-no-identity.py b/test/broker/08-ssl-connect-no-identity.py index 35b94cb6ca..1ce22f5b76 100755 --- a/test/broker/08-ssl-connect-no-identity.py +++ b/test/broker/08-ssl-connect-no-identity.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # Client connects without a certificate to a server that has use_identity_as_username=true. Should be rejected. -import subprocess import socket import ssl import sys @@ -11,7 +10,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/08-tls-psk-bridge.py b/test/broker/08-tls-psk-bridge.py index 5e2c18bf6d..97c27bb240 100755 --- a/test/broker/08-tls-psk-bridge.py +++ b/test/broker/08-tls-psk-bridge.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import subprocess -import socket import ssl import sys import time @@ -15,7 +14,7 @@ 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: @@ -56,7 +55,6 @@ pub = subprocess.Popen(['./c/08-tls-psk-bridge.test'], env=env, stdout=subprocess.PIPE) if pub.wait(): raise ValueError - exit(1) if mosq_test.expect_packet(sock, "publish", publish_packet): rc = 0 diff --git a/test/broker/08-tls-psk-pub.py b/test/broker/08-tls-psk-pub.py index c388e8304f..a552f5ade5 100755 --- a/test/broker/08-tls-psk-pub.py +++ b/test/broker/08-tls-psk-pub.py @@ -1,10 +1,8 @@ #!/usr/bin/env python import subprocess -import socket import ssl import sys -import time if sys.version < '2.7': print("WARNING: SSL not supported on Python 2.6") @@ -15,7 +13,7 @@ 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: @@ -53,7 +51,6 @@ pub = subprocess.Popen(['./c/08-tls-psk-pub.test'], env=env) if pub.wait(): raise ValueError - exit(1) if mosq_test.expect_packet(sock, "publish", publish_packet): rc = 0 diff --git a/test/broker/09-plugin-auth-unpwd-fail.py b/test/broker/09-plugin-auth-unpwd-fail.py index a9b9447a66..4d54cdbc11 100755 --- a/test/broker/09-plugin-auth-unpwd-fail.py +++ b/test/broker/09-plugin-auth-unpwd-fail.py @@ -3,10 +3,6 @@ # Test whether a connection is successful with correct username and password # when using a simple auth_plugin. -import subprocess -import socket -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/broker/09-plugin-auth-unpwd-success.py b/test/broker/09-plugin-auth-unpwd-success.py index 3277cea470..3128cb99aa 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 subprocess -import socket import time import inspect, os, sys diff --git a/test/broker/10-listener-mount-point-helper.py b/test/broker/10-listener-mount-point-helper.py index bacbc4edf0..fa73e9431e 100755 --- a/test/broker/10-listener-mount-point-helper.py +++ b/test/broker/10-listener-mount-point-helper.py @@ -1,9 +1,5 @@ #!/usr/bin/env python -import subprocess -import socket -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],".."))) @@ -23,6 +19,6 @@ sock.send(publish_packet) rc = 0 sock.close() - + exit(rc) diff --git a/test/broker/10-listener-mount-point.py b/test/broker/10-listener-mount-point.py index c482c04913..62d1545c70 100755 --- a/test/broker/10-listener-mount-point.py +++ b/test/broker/10-listener-mount-point.py @@ -1,9 +1,6 @@ #!/usr/bin/env python -import os import subprocess -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/lib/01-con-discon-success.py b/test/lib/01-con-discon-success.py index 1ebe6c976f..5eaf67cdf0 100755 --- a/test/lib/01-con-discon-success.py +++ b/test/lib/01-con-discon-success.py @@ -10,10 +10,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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/01-keepalive-pingreq.py b/test/lib/01-keepalive-pingreq.py index f0dbceaaff..e438964c2f 100755 --- a/test/lib/01-keepalive-pingreq.py +++ b/test/lib/01-keepalive-pingreq.py @@ -9,7 +9,6 @@ import inspect import os -import subprocess import socket import sys import time diff --git a/test/lib/01-no-clean-session.py b/test/lib/01-no-clean-session.py index 9ae2a7c826..15b3c9de41 100755 --- a/test/lib/01-no-clean-session.py +++ b/test/lib/01-no-clean-session.py @@ -7,10 +7,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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/01-unpwd-set.py b/test/lib/01-unpwd-set.py index 67cf4f7b24..b727f23bee 100755 --- a/test/lib/01-unpwd-set.py +++ b/test/lib/01-unpwd-set.py @@ -7,10 +7,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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/01-will-set.py b/test/lib/01-will-set.py index a54f849ac4..48aa4836d4 100755 --- a/test/lib/01-will-set.py +++ b/test/lib/01-will-set.py @@ -9,10 +9,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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/01-will-unpwd-set.py b/test/lib/01-will-unpwd-set.py index b27820da1b..9104f34749 100755 --- a/test/lib/01-will-unpwd-set.py +++ b/test/lib/01-will-unpwd-set.py @@ -9,10 +9,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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 42b9874ef8..99c9037629 100755 --- a/test/lib/02-subscribe-qos0.py +++ b/test/lib/02-subscribe-qos0.py @@ -14,10 +14,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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],".."))) @@ -62,7 +60,7 @@ 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-subscribe-qos1.py b/test/lib/02-subscribe-qos1.py index 6190431ae7..f576e5a880 100755 --- a/test/lib/02-subscribe-qos1.py +++ b/test/lib/02-subscribe-qos1.py @@ -14,10 +14,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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],".."))) @@ -65,7 +63,7 @@ if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): rc = 0 - + conn.close() finally: client.terminate() diff --git a/test/lib/02-subscribe-qos2.py b/test/lib/02-subscribe-qos2.py index 411de65be5..0fd1a72a96 100755 --- a/test/lib/02-subscribe-qos2.py +++ b/test/lib/02-subscribe-qos2.py @@ -14,10 +14,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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],".."))) @@ -62,10 +60,10 @@ if mosq_test.expect_packet(conn, "subscribe", subscribe_packet): conn.send(suback_packet) - + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): rc = 0 - + conn.close() finally: client.terminate() diff --git a/test/lib/02-unsubscribe.py b/test/lib/02-unsubscribe.py index 257f95a69c..2b147b6587 100755 --- a/test/lib/02-unsubscribe.py +++ b/test/lib/02-unsubscribe.py @@ -4,10 +4,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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],".."))) @@ -55,7 +53,7 @@ if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): rc = 0 - + conn.close() finally: client.terminate() diff --git a/test/lib/03-publish-b2c-qos1.py b/test/lib/03-publish-b2c-qos1.py index edfbb40f74..53f3db46f9 100755 --- a/test/lib/03-publish-b2c-qos1.py +++ b/test/lib/03-publish-b2c-qos1.py @@ -13,7 +13,6 @@ import inspect import os -import subprocess import socket import sys import time diff --git a/test/lib/03-publish-b2c-qos2.py b/test/lib/03-publish-b2c-qos2.py index 83545421aa..f2af9d7ba8 100755 --- a/test/lib/03-publish-b2c-qos2.py +++ b/test/lib/03-publish-b2c-qos2.py @@ -18,7 +18,6 @@ import inspect import os -import subprocess import socket import sys import time diff --git a/test/lib/03-publish-c2b-qos1-disconnect.py b/test/lib/03-publish-c2b-qos1-disconnect.py index 4131686293..bcddecceaa 100755 --- a/test/lib/03-publish-c2b-qos1-disconnect.py +++ b/test/lib/03-publish-c2b-qos1-disconnect.py @@ -4,10 +4,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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/03-publish-c2b-qos1-timeout.py b/test/lib/03-publish-c2b-qos1-timeout.py index 344ca9578a..3d0663ea90 100755 --- a/test/lib/03-publish-c2b-qos1-timeout.py +++ b/test/lib/03-publish-c2b-qos1-timeout.py @@ -18,10 +18,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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/03-publish-c2b-qos2-disconnect.py b/test/lib/03-publish-c2b-qos2-disconnect.py index 9b36d064b0..711958638a 100755 --- a/test/lib/03-publish-c2b-qos2-disconnect.py +++ b/test/lib/03-publish-c2b-qos2-disconnect.py @@ -4,10 +4,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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/03-publish-c2b-qos2-timeout.py b/test/lib/03-publish-c2b-qos2-timeout.py index 0705fc63b7..00543f0ed7 100755 --- a/test/lib/03-publish-c2b-qos2-timeout.py +++ b/test/lib/03-publish-c2b-qos2-timeout.py @@ -22,10 +22,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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],".."))) @@ -76,7 +74,7 @@ if mosq_test.expect_packet(conn, "dup publish", publish_dup_packet): conn.send(pubrec_packet) - + if mosq_test.expect_packet(conn, "pubrel", pubrel_packet): if mosq_test.expect_packet(conn, "dup pubrel", pubrel_packet): conn.send(pubcomp_packet) diff --git a/test/lib/03-publish-c2b-qos2.py b/test/lib/03-publish-c2b-qos2.py index 0954ed84eb..f8a604af4d 100755 --- a/test/lib/03-publish-c2b-qos2.py +++ b/test/lib/03-publish-c2b-qos2.py @@ -22,10 +22,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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],".."))) @@ -73,7 +71,7 @@ if mosq_test.expect_packet(conn, "publish", publish_packet): conn.send(pubrec_packet) - + if mosq_test.expect_packet(conn, "pubrel", pubrel_packet): conn.send(pubcomp_packet) diff --git a/test/lib/03-publish-qos0-no-payload.py b/test/lib/03-publish-qos0-no-payload.py index c74aa4d6d3..a858ad5c7f 100755 --- a/test/lib/03-publish-qos0-no-payload.py +++ b/test/lib/03-publish-qos0-no-payload.py @@ -12,10 +12,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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],".."))) @@ -59,7 +57,7 @@ if mosq_test.expect_packet(conn, "publish", publish_packet): if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): rc = 0 - + conn.close() finally: client.terminate() diff --git a/test/lib/03-publish-qos0.py b/test/lib/03-publish-qos0.py index d58f3f515f..c8d154da7a 100755 --- a/test/lib/03-publish-qos0.py +++ b/test/lib/03-publish-qos0.py @@ -12,10 +12,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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],".."))) @@ -59,7 +57,7 @@ if mosq_test.expect_packet(conn, "publish", publish_packet): if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): rc = 0 - + conn.close() finally: client.terminate() diff --git a/test/lib/04-retain-qos0.py b/test/lib/04-retain-qos0.py index 8860c03620..ef23451368 100755 --- a/test/lib/04-retain-qos0.py +++ b/test/lib/04-retain-qos0.py @@ -4,10 +4,8 @@ import inspect import os -import subprocess import socket import sys -import time # 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],".."))) @@ -49,7 +47,7 @@ if mosq_test.expect_packet(conn, "publish", publish_packet): rc = 0 - + conn.close() finally: client.terminate() diff --git a/test/lib/08-ssl-bad-cacert.py b/test/lib/08-ssl-bad-cacert.py index 8509ff9922..20dc6fede8 100755 --- a/test/lib/08-ssl-bad-cacert.py +++ b/test/lib/08-ssl-bad-cacert.py @@ -2,11 +2,7 @@ import inspect import os -import subprocess -import socket -import ssl import sys -import time # 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/08-ssl-connect-cert-auth-enc.py b/test/lib/08-ssl-connect-cert-auth-enc.py index a4f8113868..854fe1284a 100755 --- a/test/lib/08-ssl-connect-cert-auth-enc.py +++ b/test/lib/08-ssl-connect-cert-auth-enc.py @@ -12,11 +12,9 @@ import inspect import os -import subprocess import socket import ssl import sys -import time # 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/08-ssl-connect-cert-auth.py b/test/lib/08-ssl-connect-cert-auth.py index 71ebdeaf62..cd36e45d30 100755 --- a/test/lib/08-ssl-connect-cert-auth.py +++ b/test/lib/08-ssl-connect-cert-auth.py @@ -12,11 +12,9 @@ import inspect import os -import subprocess import socket import ssl import sys -import time # 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/08-ssl-connect-no-auth.py b/test/lib/08-ssl-connect-no-auth.py index d0c531b933..03d04a876e 100755 --- a/test/lib/08-ssl-connect-no-auth.py +++ b/test/lib/08-ssl-connect-no-auth.py @@ -11,11 +11,9 @@ import inspect import os -import subprocess import socket import ssl import sys -import time # 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/08-ssl-fake-cacert.py b/test/lib/08-ssl-fake-cacert.py index 0e6c29cd2f..1dbc026632 100755 --- a/test/lib/08-ssl-fake-cacert.py +++ b/test/lib/08-ssl-fake-cacert.py @@ -2,7 +2,6 @@ import inspect import os -import subprocess import socket import ssl import sys diff --git a/test/lib/09-util-topic-matching.py b/test/lib/09-util-topic-matching.py index ed54d2c1b9..3dc19e0b63 100755 --- a/test/lib/09-util-topic-matching.py +++ b/test/lib/09-util-topic-matching.py @@ -2,9 +2,7 @@ import inspect import os -import subprocess import sys -import time # 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/09-util-topic-tokenise.py b/test/lib/09-util-topic-tokenise.py index e464284277..6f8dc1228b 100755 --- a/test/lib/09-util-topic-tokenise.py +++ b/test/lib/09-util-topic-tokenise.py @@ -2,9 +2,7 @@ import inspect import os -import subprocess import sys -import time # 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/mosq_test.py b/test/mosq_test.py index 45ed750e06..1770ac2fdb 100644 --- a/test/mosq_test.py +++ b/test/mosq_test.py @@ -211,7 +211,7 @@ def to_string(packet): (mid, packet) = struct.unpack(pack_format, packet) pack_format = "!" + "B"*len(packet) granted_qos = struct.unpack(pack_format, packet) - + s = "SUBACK, rl="+str(rl)+", mid="+str(mid)+", granted_qos="+str(granted_qos[0]) for i in range(1, len(granted_qos)-1): s = s+", "+str(granted_qos[i])