@ -8,7 +8,7 @@ def write_config(filename, port):
with open(filename, 'w') as f:
f.write("listener %d\n" % (port))
f.write("allow_anonymous false\n")
f.write("plugin ../../plugins/dynamic-security/mosquitto_dynamic_security.so\n")
f.write(f"plugin {mosq_test.get_build_root()}/plugins/dynamic-security/mosquitto_dynamic_security.so\n")
f.write("plugin_opt_config_file %d/dynamic-security.json\n" % (port))
f.write("plugin_opt_password_init_file %d/init\n" % (port))
@ -1,6 +1,7 @@
import os
from pathlib import Path
import sqlite3
import mosq_test
dir_in = 0
dir_out = 1
@ -22,7 +23,7 @@ def write_config(filename, port):
f.write("allow_anonymous true\n")
f.write("plugin ../../plugins/persist-sqlite/mosquitto_persist_sqlite.so\n")
f.write(f"plugin {mosq_test.get_build_root()}/plugins/persist-sqlite/mosquitto_persist_sqlite.so\n")
f.write("plugin_opt_db_file %d/mosquitto.sqlite3\n" % (port))
@ -13,7 +13,7 @@ def do_test(args, stderr_expected, rc_expected):
'XDG_CONFIG_HOME':'/tmp/missing'
}
env = mosq_test.env_add_ld_library_path(env)
cmd = ['../../client/mosquitto_sub'] + args
cmd = [f'{mosq_test.get_build_root()}/client/mosquitto_sub'] + args
sub = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
if mosq_test.wait_for_subprocess(sub):
@ -20,7 +20,7 @@ def do_test(proto_ver):
cmd = ['../../client/mosquitto_sub',
cmd = [f'{mosq_test.get_build_root()}/client/mosquitto_sub',
'-p', str(port),
'-q', '0',
'-t', '02/sub/filter-out/#',
@ -21,7 +21,7 @@ def do_test(proto_ver):
'-q', '1',
'-F', '%j',
'-t', '02/sub/format/json/test',
'-t', '02/sub/format/json/retain/test',
@ -20,7 +20,7 @@ def do_test(format_str, expected_output, proto_ver=4, payload="message"):
'-t', '02/sub/format/test',
'-t', '02/sub/null/test',
@ -28,7 +28,7 @@ def do_test(proto_ver):
'-p', str(ports[0]),
'-t', '02/sub/qos1/test',
'-t', '02/sub/verbose/test',
cmd = ['../../client/mosquitto_pub'] + args
cmd = [f'{mosq_test.get_build_root()}/client/mosquitto_pub'] + args
pub = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
if mosq_test.wait_for_subprocess(pub):
@ -26,7 +26,7 @@ def do_test(proto_ver):
cmd = ['../../client/mosquitto_pub',
cmd = [f'{mosq_test.get_build_root()}/client/mosquitto_pub',
'-t', '03/pub/file/empty/test',
'-t', '03/pub/file/test',
@ -29,7 +29,7 @@ def do_test(proto_ver):
'-o', conf_file
]
'-t', '03/pub/qos0/test',
else:
V = 'mqttv31'
'-t', '03/pub/qos1/test/properties',
@ -31,7 +31,7 @@ def do_test(proto_ver):
payload = "abcdefghijklmnopqrstuvwxyz0123456789"*1821
'-t', '03/pub/qos1/test',
'-t', '03/pub/repeat/test',
@ -40,7 +40,7 @@ def do_test(proto_ver, host):
cmd = [
'../../client/mosquitto_pub',
f'{mosq_test.get_build_root()}/client/mosquitto_pub',
'-h', host,
'-p', str(port2),
'-t', '03/pub/stdin/file/test',
'-q', '2',
'-t', '03/pub/stdin/line/test',
'-L', f'mqtt://localhost:{port}/03/pub/url/test',
'-m', 'message',
'-V', V
@ -14,7 +14,7 @@ def do_test(args, stderr_expected, rc_expected):
cmd = ['../../client/mosquitto_rr'] + args
cmd = [f'{mosq_test.get_build_root()}/client/mosquitto_rr'] + args
sub.wait()
payload = "message"
cmd = ['../../client/mosquitto_rr',
cmd = [f'{mosq_test.get_build_root()}/client/mosquitto_rr',
'-t', '04/rr/qos1/test/request',
@ -40,5 +40,5 @@ def run_clients(max_clients):
env = mosq_test.env_add_ld_library_path()
#broker = subprocess.Popen(["../../src/mosquitto", "-c", "random.conf"], env=env)
#broker = subprocess.Popen([mosq_test.get_build_root()+"/src/mosquitto", "-c", "random.conf"], env=env)
run_clients(1000)