Check for authentication method on CONNECT, and reject.
parent
ac91144495
commit
2ea97a6cd9
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Test whether sending an Authentication Method produces the correct response
|
||||
# when no auth methods are defined.
|
||||
|
||||
from mosq_test_helper import *
|
||||
|
||||
rc = 1
|
||||
keepalive = 10
|
||||
props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "basic")
|
||||
connect_packet = mosq_test.gen_connect("connect-test", proto_ver=5, keepalive=keepalive, properties=props)
|
||||
connack_packet = mosq_test.gen_connack(rc=mqtt5_rc.MQTT_RC_BAD_AUTHENTICATION_METHOD, proto_ver=5)
|
||||
|
||||
port = mosq_test.get_port()
|
||||
broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)
|
||||
|
||||
try:
|
||||
sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)
|
||||
sock.close()
|
||||
rc = 0
|
||||
finally:
|
||||
broker.terminate()
|
||||
broker.wait()
|
||||
(stdo, stde) = broker.communicate()
|
||||
if rc:
|
||||
print(stde)
|
||||
|
||||
exit(rc)
|
||||
|
Loading…
Reference in New Issue