[457373] Fix tests when compiled with WITH_TLS=no.
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=457373pull/211/merge
parent
9332a731bf
commit
4c72b2dd45
@ -0,0 +1,3 @@
|
||||
port 1888
|
||||
password_file 01-connect-uname-password-success-no-tls.pwfile
|
||||
allow_anonymous false
|
@ -0,0 +1 @@
|
||||
user:password
|
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# 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],"..")))
|
||||
if cmd_subfolder not in sys.path:
|
||||
sys.path.insert(0, cmd_subfolder)
|
||||
|
||||
import mosq_test
|
||||
|
||||
rc = 1
|
||||
keepalive = 10
|
||||
connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password")
|
||||
connack_packet = mosq_test.gen_connack(rc=0)
|
||||
|
||||
broker = mosq_test.start_broker(filename=os.path.basename(__file__))
|
||||
|
||||
try:
|
||||
sock = mosq_test.do_client_connect(connect_packet, connack_packet)
|
||||
sock.close()
|
||||
rc = 0
|
||||
|
||||
finally:
|
||||
broker.terminate()
|
||||
broker.wait()
|
||||
if rc:
|
||||
(stdo, stde) = broker.communicate()
|
||||
print(stde)
|
||||
|
||||
exit(rc)
|
||||
|
Loading…
Reference in New Issue