From 6b1b0bf7bcab2581ccfa4794740f6185a1ddafae Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 1 Sep 2022 10:59:43 +0100 Subject: [PATCH] Start of db_dump tests. --- apps/db_dump/Makefile | 73 +++----------- apps/db_dump/stubs.c | 110 ++------------------- src/persist_read.c | 10 +- test/Makefile | 2 + test/apps/01-db-dump-client-stats.py | 23 +++++ test/apps/01-db-dump-print-empty.py | 57 +++++++++++ test/apps/01-db-dump-print-v6-all.py | 61 ++++++++++++ test/apps/01-db-dump-stats.py | 40 ++++++++ test/apps/CMakeLists.txt | 19 ++++ test/apps/Makefile | 18 ++++ test/apps/db_dump/v3-empty.test-db | Bin 0 -> 39 bytes test/apps/db_dump/v4-empty.test-db | Bin 0 -> 39 bytes test/apps/db_dump/v4-single-client.test-db | Bin 0 -> 66 bytes test/apps/db_dump/v4-single-cmsg.test-db | Bin 0 -> 226 bytes test/apps/db_dump/v4-single-retain.test-db | Bin 0 -> 114 bytes test/apps/db_dump/v4-single-sub.test-db | Bin 0 -> 103 bytes test/apps/db_dump/v5-empty.test-db | Bin 0 -> 47 bytes test/apps/db_dump/v6-empty.test-db | Bin 0 -> 47 bytes test/apps/db_dump/v6-single-all.test-db | Bin 0 -> 267 bytes test/apps/db_dump/v6-single-client.test-db | Bin 0 -> 92 bytes test/apps/db_dump/v6-single-cmsg.test-db | Bin 0 -> 254 bytes test/apps/db_dump/v6-single-retain.test-db | Bin 0 -> 164 bytes test/apps/db_dump/v6-single-sub.test-db | Bin 0 -> 124 bytes test/apps/mosq_test_helper.py | 18 ++++ 24 files changed, 267 insertions(+), 164 deletions(-) create mode 100755 test/apps/01-db-dump-client-stats.py create mode 100755 test/apps/01-db-dump-print-empty.py create mode 100755 test/apps/01-db-dump-print-v6-all.py create mode 100755 test/apps/01-db-dump-stats.py create mode 100644 test/apps/CMakeLists.txt create mode 100644 test/apps/Makefile create mode 100644 test/apps/db_dump/v3-empty.test-db create mode 100644 test/apps/db_dump/v4-empty.test-db create mode 100644 test/apps/db_dump/v4-single-client.test-db create mode 100644 test/apps/db_dump/v4-single-cmsg.test-db create mode 100644 test/apps/db_dump/v4-single-retain.test-db create mode 100644 test/apps/db_dump/v4-single-sub.test-db create mode 100644 test/apps/db_dump/v5-empty.test-db create mode 100644 test/apps/db_dump/v6-empty.test-db create mode 100644 test/apps/db_dump/v6-single-all.test-db create mode 100644 test/apps/db_dump/v6-single-client.test-db create mode 100644 test/apps/db_dump/v6-single-cmsg.test-db create mode 100644 test/apps/db_dump/v6-single-retain.test-db create mode 100644 test/apps/db_dump/v6-single-sub.test-db create mode 100644 test/apps/mosq_test_helper.py diff --git a/apps/db_dump/Makefile b/apps/db_dump/Makefile index f799ca5d..4f60b865 100644 --- a/apps/db_dump/Makefile +++ b/apps/db_dump/Makefile @@ -6,26 +6,24 @@ CFLAGS_FINAL=${CFLAGS} ${APP_CFLAGS} -I${R}/include -I${R}/ -I${R}/lib -I${R}/sr OBJS = \ db_dump.o \ print.o \ - \ - memory_mosq.o \ - memory_public.o \ - packet_datatypes.o \ - packet_mosq.o \ - persist_read.o \ - persist_read_v234.o \ - persist_read_v5.o \ - property_mosq.o \ - send_disconnect.o \ - stubs.o \ - time_mosq.o \ - topic_tok.o \ - utf8_mosq.o + stubs.o + +BROKER_OBJS = \ + ${R}/src/memory_mosq.o \ + ${R}/src/memory_public.o \ + ${R}/src/packet_datatypes.o \ + ${R}/src/persist_read.o \ + ${R}/src/persist_read_v234.o \ + ${R}/src/persist_read_v5.o \ + ${R}/src/property_mosq.o \ + ${R}/src/topic_tok.o \ + ${R}/src/utf8_mosq.o .PHONY: all clean reallyclean all : mosquitto_db_dump -mosquitto_db_dump : ${OBJS} +mosquitto_db_dump : ${OBJS} ${BROKER_OBJS} ${CROSS_COMPILE}${CC} $^ -o $@ ${LDFLAGS} ${LIBS} ${APP_LDFLAGS} db_dump.o : db_dump.c db_dump.h ${R}/src/persist.h @@ -34,55 +32,16 @@ db_dump.o : db_dump.c db_dump.h ${R}/src/persist.h print.o : print.c db_dump.h ${R}/src/persist.h ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ -memory_mosq.o : ${R}/lib/memory_mosq.c ${R}/lib/memory_mosq.h - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -memory_public.o : ${R}/src/memory_public.c - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -net_mosq.o : ${R}/lib/net_mosq.c ${R}/lib/net_mosq.h - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -packet_datatypes.o : ${R}/lib/packet_datatypes.c ${R}/lib/packet_mosq.h - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -packet_mosq.o : ${R}/lib/packet_mosq.c ${R}/lib/packet_mosq.h - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -persist_read.o : ${R}/src/persist_read.c ${R}/src/persist.h ${R}/src/mosquitto_broker_internal.h - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -persist_read_v234.o : ${R}/src/persist_read_v234.c ${R}/src/persist.h ${R}/src/mosquitto_broker_internal.h - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -persist_read_v5.o : ${R}/src/persist_read_v5.c ${R}/src/persist.h ${R}/src/mosquitto_broker_internal.h - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -property_mosq.o : ${R}/lib/property_mosq.c ${R}/lib/property_mosq.h - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -read_handle.o : ${R}/src/read_handle.c - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ +${BROKER_OBJS} : + make -C ${R}/src stubs.o : stubs.c ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ -send_disconnect.o : ${R}/lib/send_disconnect.c - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -time_mosq.o : ${R}/common/time_mosq.c ${R}/common/time_mosq.h - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -topic_tok.o : ${R}/src/topic_tok.c - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - -utf8_mosq.o : ${R}/lib/utf8_mosq.c - ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ - reallyclean: clean clean : - -rm -f *.o mosquitto_db_dump + -rm -f *.o mosquitto_db_dump *.gcda *.gcno install: diff --git a/apps/db_dump/stubs.c b/apps/db_dump/stubs.c index e9e2d853..61fbfa97 100644 --- a/apps/db_dump/stubs.c +++ b/apps/db_dump/stubs.c @@ -22,11 +22,7 @@ void context__add_to_by_id(struct mosquitto *context) int db__message_store(const struct mosquitto *source, struct mosquitto_base_msg *base_msg, uint32_t message_expiry_interval, dbid_t store_id, enum mosquitto_msg_origin origin) { - UNUSED(source); - UNUSED(base_msg); - UNUSED(message_expiry_interval); - UNUSED(store_id); - UNUSED(origin); + UNUSED(source); UNUSED(base_msg); UNUSED(message_expiry_interval); UNUSED(store_id); UNUSED(origin); return 0; } @@ -35,132 +31,42 @@ void db__msg_store_ref_inc(struct mosquitto_base_msg *base_msg) UNUSED(base_msg); } -int handle__packet(struct mosquitto *context) -{ - UNUSED(context); - return 0; -} - int log__printf(struct mosquitto *mosq, unsigned int level, const char *fmt, ...) { - UNUSED(mosq); - UNUSED(level); - UNUSED(fmt); + UNUSED(mosq); UNUSED(level); UNUSED(fmt); return 0; } FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read) { - UNUSED(path); - UNUSED(mode); - UNUSED(restrict_read); + UNUSED(path); UNUSED(mode); UNUSED(restrict_read); return NULL; } -enum mosquitto_client_state mosquitto__get_state(struct mosquitto *mosq) -{ - UNUSED(mosq); - return mosq_cs_new; -} - -int mux__add_out(struct mosquitto *mosq) -{ - UNUSED(mosq); - return 0; -} - -int mux__remove_out(struct mosquitto *mosq) -{ - UNUSED(mosq); - return 0; -} - -bool net__is_connected(struct mosquitto *mosq) -{ - UNUSED(mosq); - return false; -} - -ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count) -{ - UNUSED(mosq); - UNUSED(buf); - UNUSED(count); - return 0; -} - -ssize_t net__read_ws(struct mosquitto *mosq, void *buf, size_t count) -{ - UNUSED(mosq); - UNUSED(buf); - UNUSED(count); - return 0; -} - -ssize_t net__write(struct mosquitto *mosq, const void *buf, size_t count) -{ - UNUSED(mosq); - UNUSED(buf); - UNUSED(count); - return 0; -} - int retain__store(const char *topic, struct mosquitto_base_msg *base_msg, char **split_topics, bool persist) { - UNUSED(topic); - UNUSED(base_msg); - UNUSED(split_topics); - UNUSED(persist); + UNUSED(topic); UNUSED(base_msg); UNUSED(split_topics); UNUSED(persist); return 0; } int sub__add(struct mosquitto *context, const char *sub, uint8_t qos, uint32_t identifier, int options) { - UNUSED(context); - UNUSED(sub); - UNUSED(qos); - UNUSED(identifier); - UNUSED(options); - return 0; -} - -int sub__messages_queue(const char *source_id, const char *topic, uint8_t qos, int retain, struct mosquitto_base_msg **base_msg) -{ - UNUSED(source_id); - UNUSED(topic); - UNUSED(qos); - UNUSED(retain); - UNUSED(base_msg); - return 0; -} - -int keepalive__update(struct mosquitto *context) -{ - UNUSED(context); + UNUSED(context); UNUSED(sub); UNUSED(qos); UNUSED(identifier); UNUSED(options); UNUSED(root); return 0; } void db__msg_add_to_inflight_stats(struct mosquitto_msg_data *msg_data, struct mosquitto_client_msg *msg) { - UNUSED(msg_data); - UNUSED(msg); + UNUSED(msg_data); UNUSED(msg); } void db__msg_add_to_queued_stats(struct mosquitto_msg_data *msg_data, struct mosquitto_client_msg *msg) { - UNUSED(msg_data); - UNUSED(msg); + UNUSED(msg_data); UNUSED(msg); } int session_expiry__add_from_persistence(struct mosquitto *context, time_t expiry_time) { - UNUSED(context); - UNUSED(expiry_time); + UNUSED(context); UNUSED(expiry_time); return 0; } - -void mosquitto_log_printf(int level, const char *fmt, ...) -{ - UNUSED(level); - UNUSED(fmt); -} diff --git a/src/persist_read.c b/src/persist_read.c index ecbe72f3..0f7745f0 100644 --- a/src/persist_read.c +++ b/src/persist_read.c @@ -524,11 +524,11 @@ int persist__restore(void) fclose(fptr); - mosquitto_log_printf(MOSQ_LOG_INFO, "Restored %ld base messages", base_msg_count); - mosquitto_log_printf(MOSQ_LOG_INFO, "Restored %ld retained messages", retained_count); - mosquitto_log_printf(MOSQ_LOG_INFO, "Restored %ld clients", client_count); - mosquitto_log_printf(MOSQ_LOG_INFO, "Restored %ld subscriptions", subscription_count); - mosquitto_log_printf(MOSQ_LOG_INFO, "Restored %ld client messages", client_msg_count); + log__printf(NULL, MOSQ_LOG_INFO, "Restored %ld base messages", base_msg_count); + log__printf(NULL, MOSQ_LOG_INFO, "Restored %ld retained messages", retained_count); + log__printf(NULL, MOSQ_LOG_INFO, "Restored %ld clients", client_count); + log__printf(NULL, MOSQ_LOG_INFO, "Restored %ld subscriptions", subscription_count); + log__printf(NULL, MOSQ_LOG_INFO, "Restored %ld client messages", client_msg_count); return rc; error: diff --git a/test/Makefile b/test/Makefile index 562fe30e..de12ecdd 100644 --- a/test/Makefile +++ b/test/Makefile @@ -14,11 +14,13 @@ test-compile: check : test test : utest + $(MAKE) -C apps test $(MAKE) -C broker test $(MAKE) -C lib test $(MAKE) -C client test ptest : utest + $(MAKE) -C apps ptest $(MAKE) -C broker ptest $(MAKE) -C lib ptest $(MAKE) -C client ptest diff --git a/test/apps/01-db-dump-client-stats.py b/test/apps/01-db-dump-client-stats.py new file mode 100755 index 00000000..e42a1dfa --- /dev/null +++ b/test/apps/01-db-dump-client-stats.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +def do_test(file, counts): + stdout = f"SC: {counts[0]} " + \ + f"SS: {counts[1]} " + \ + f"MC: {counts[2]} " + \ + f"MS: {counts[3]} " + \ + f" {counts[4]}\n" + + cmd = ['../../apps/db_dump/mosquitto_db_dump', + '--client-stats', + f'db_dump/{file}' + ] + + res = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=1, encoding='utf-8') + if res.stdout != stdout: + print(res.stdout) + print(stdout) + raise mosq_test.TestError + +do_test('v6-single-all.test-db', [1,27,1,111,'single-all']) diff --git a/test/apps/01-db-dump-print-empty.py b/test/apps/01-db-dump-print-empty.py new file mode 100755 index 00000000..388b706b --- /dev/null +++ b/test/apps/01-db-dump-print-empty.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +def do_test(file, stdout): + + cmd = ['../../apps/db_dump/mosquitto_db_dump', + f'db_dump/{file}' + ] + + res = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=1, encoding='utf-8') + if res.stdout != stdout: + raise mosq_test.TestError + +v3_empty = """Mosquitto DB dump +CRC: 0 +DB version: 3 +DB_CHUNK_CFG: + Length: 10 + Shutdown: 1 + DB ID size: 8 + Last DB ID: 51 +""" +do_test('v3-empty.test-db', v3_empty) + +v4_empty = """Mosquitto DB dump +CRC: 0 +DB version: 4 +DB_CHUNK_CFG: + Length: 10 + Shutdown: 1 + DB ID size: 8 + Last DB ID: 102 +""" +do_test('v4-empty.test-db', v4_empty) + +v5_empty = """Mosquitto DB dump +CRC: 0 +DB version: 5 +DB_CHUNK_CFG: + Length: 16 + Shutdown: 1 + DB ID size: 8 + Last DB ID: 52 +""" +do_test('v5-empty.test-db', v5_empty) + +v6_empty = """Mosquitto DB dump +CRC: 0 +DB version: 6 +DB_CHUNK_CFG: + Length: 16 + Shutdown: 1 + DB ID size: 8 + Last DB ID: 208485212291791 +""" +do_test('v6-empty.test-db', v6_empty) diff --git a/test/apps/01-db-dump-print-v6-all.py b/test/apps/01-db-dump-print-v6-all.py new file mode 100755 index 00000000..f938debd --- /dev/null +++ b/test/apps/01-db-dump-print-v6-all.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +def do_test(file, stdout): + + cmd = ['../../apps/db_dump/mosquitto_db_dump', + f'db_dump/{file}' + ] + + res = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=1, encoding='utf-8') + if res.stdout != stdout: + raise mosq_test.TestError + +stdout = """Mosquitto DB dump +CRC: 0 +DB version: 6 +DB_CHUNK_CFG: + Length: 16 + Shutdown: 1 + DB ID size: 8 + Last DB ID: 208508774941868 +DB_CHUNK_BASE_MSG: + Length: 85 + Store ID: 208508774941868 + Source Port: 1883 + Source MID: 1 + Topic: (null) + QoS: 1 + Retain: 1 + Payload Length: 7 + Expiry Time: 0 + Payload: message +DB_CHUNK_CLIENT: + Length: 34 + Client ID: single-all + Last MID: 1 + Session expiry time: 0 + Session expiry interval: 4294967295 +DB_CHUNK_CLIENT_MSG: + Length: 26 + Client ID: single-all + Store ID: 208508774941868 + MID: 1 + QoS: 1 + Retain: 0 + Direction: 1 + State: 11 + Dup: 0 +DB_CHUNK_SUB: + Length: 27 + Client ID: single-all + Topic: topic + QoS: 1 + Subscription ID: 0 + Options: 0x00 +DB_CHUNK_RETAIN: + Length: 8 + Store ID: 208508774941868 +""" +do_test('v6-single-all.test-db', stdout) diff --git a/test/apps/01-db-dump-stats.py b/test/apps/01-db-dump-stats.py new file mode 100755 index 00000000..18dd90b0 --- /dev/null +++ b/test/apps/01-db-dump-stats.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +def do_test(file, counts): + stdout = f"DB_CHUNK_CFG: {counts[0]}\n" + \ + f"DB_CHUNK_BASE_MSG: {counts[1]}\n" + \ + f"DB_CHUNK_CLIENT_MSG: {counts[2]}\n" + \ + f"DB_CHUNK_RETAIN: {counts[3]}\n" + \ + f"DB_CHUNK_SUB: {counts[4]}\n" + \ + f"DB_CHUNK_CLIENT: {counts[5]}\n" + + cmd = ['../../apps/db_dump/mosquitto_db_dump', + '--stats', + f'db_dump/{file}' + ] + + res = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=1, encoding='utf-8') + if res.stdout != stdout: + print(res.stdout) + raise mosq_test.TestError + +do_test('v3-empty.test-db', [1,0,0,0,0,0]) +do_test('v4-empty.test-db', [1,0,0,0,0,0]) +do_test('v5-empty.test-db', [1,0,0,0,0,0]) +do_test('v6-empty.test-db', [1,0,0,0,0,0]) + +do_test('v4-single-client.test-db', [1,0,0,0,0,1]) +do_test('v6-single-client.test-db', [1,0,0,0,0,1]) + +do_test('v4-single-retain.test-db', [1,1,0,1,0,0]) +do_test('v6-single-retain.test-db', [1,1,0,1,0,0]) + +do_test('v4-single-sub.test-db', [1,0,0,0,1,1]) +do_test('v6-single-sub.test-db', [1,0,0,0,1,1]) + +do_test('v4-single-cmsg.test-db', [1,1,1,0,1,1]) +do_test('v6-single-cmsg.test-db', [1,1,1,0,1,1]) + +do_test('v6-single-all.test-db', [1,1,1,1,1,1]) diff --git a/test/apps/CMakeLists.txt b/test/apps/CMakeLists.txt new file mode 100644 index 00000000..7aea0bd1 --- /dev/null +++ b/test/apps/CMakeLists.txt @@ -0,0 +1,19 @@ +file(GLOB PY_TEST_FILES [0-9][0-9]-*.py) + +set(EXCLUDE_LIST + # none +) + +foreach(PY_TEST_FILE ${PY_TEST_FILES}) + get_filename_component(PY_TEST_NAME ${PY_TEST_FILE} NAME_WE) + if(${PY_TEST_NAME} IN_LIST EXCLUDE_LIST) + continue() + endif() + add_test(NAME apps-${PY_TEST_NAME} + COMMAND ${PY_TEST_FILE} + ) + set_tests_properties(apps-${PY_TEST_NAME} + PROPERTIES + ENVIRONMENT "BUILD_ROOT=${CMAKE_BINARY_DIR}" + ) +endforeach() diff --git a/test/apps/Makefile b/test/apps/Makefile new file mode 100644 index 00000000..9973d587 --- /dev/null +++ b/test/apps/Makefile @@ -0,0 +1,18 @@ +R=../.. +include ${R}/config.mk + +.PHONY: all check test ptest clean + +all : + +check : test +ptest : test +test : 01 + +01 : + ./01-db-dump-client-stats.py + ./01-db-dump-print-empty.py + ./01-db-dump-print-v6-all.py + ./01-db-dump-stats.py + +clean: diff --git a/test/apps/db_dump/v3-empty.test-db b/test/apps/db_dump/v3-empty.test-db new file mode 100644 index 0000000000000000000000000000000000000000..1145e0a0400d7b065902e6dc6c35d91c47b473a2 GIT binary patch literal 39 jcmZSB%8;91Tv(b}Qj)KblEeT3%nXb`1{WiTF;oBmvq%No literal 0 HcmV?d00001 diff --git a/test/apps/db_dump/v4-empty.test-db b/test/apps/db_dump/v4-empty.test-db new file mode 100644 index 0000000000000000000000000000000000000000..25c784e4d62ecc1b4d5533ebb1f5b3265121379a GIT binary patch literal 39 jcmZSB%8;91Tv(b}Qj)KblEeT3EDVf51{Who8dLxPwDATH literal 0 HcmV?d00001 diff --git a/test/apps/db_dump/v4-single-client.test-db b/test/apps/db_dump/v4-single-client.test-db new file mode 100644 index 0000000000000000000000000000000000000000..1a6f651147de6fea9edc013adc94e88fa7305e89 GIT binary patch literal 66 zcmZSB%8;91Tv(b}Qj)KblEeT3EDVf51{WiT2~>cA4ag8>;7rcROwB9N%}iln@T|^F H2FU^dlY|Qn literal 0 HcmV?d00001 diff --git a/test/apps/db_dump/v4-single-cmsg.test-db b/test/apps/db_dump/v4-single-cmsg.test-db new file mode 100644 index 0000000000000000000000000000000000000000..9a6d8ede289d888c3bd592895aaac941863b32c4 GIT binary patch literal 226 zcmZSB%8;91Tv(b}Qj)KblEeT3EDVf51{WhoEL4Dj3CO5`^Hj`|EDa4zERA(d43aH% zO)OGPbuCjYQgscJjFXZKOq0?Kj7=CA*rUPb@E2$1rRSvT7MCWK7#Js1=O%;HFfaqLG_oAr1&oXgjNA+itUv{F$O;%RECT@T^)6um literal 0 HcmV?d00001 diff --git a/test/apps/db_dump/v4-single-retain.test-db b/test/apps/db_dump/v4-single-retain.test-db new file mode 100644 index 0000000000000000000000000000000000000000..54a45a1d2cb8d0eb70a210eb444cc25ad18ed1b5 GIT binary patch literal 114 zcmZSB%8;91Tv(b}Qj)KblEeT3EDVf51{WiT6I6hK3CM7O^Ei`pGE?(PbTd;J7}%r1 kYIut?^U`xt^@~zV5;OC_`q^_+i;EM}QyEx*D&R%|08#rA&j0`b literal 0 HcmV?d00001 diff --git a/test/apps/db_dump/v4-single-sub.test-db b/test/apps/db_dump/v4-single-sub.test-db new file mode 100644 index 0000000000000000000000000000000000000000..74a3d6cefa646d65408a119e1ab99311b09e5d73 GIT binary patch literal 103 zcmZSB%8;91Tv(b}Qj)KblEeT3EDVf51{Who98`dT4ag8<;403{OV3HwEiMJB?5)a8 V21~O7NjVfbeuTP`{DRD61_1Tt7D@mB literal 0 HcmV?d00001 diff --git a/test/apps/db_dump/v5-empty.test-db b/test/apps/db_dump/v5-empty.test-db new file mode 100644 index 0000000000000000000000000000000000000000..8b36ce3f21f51c164f039fcbdb7c8594b829f1f7 GIT binary patch literal 47 lcmZSB%8;91Tv(b}Qj)KblEeT3tU!tphy_fb0*o9G1_0t%1>^t# literal 0 HcmV?d00001 diff --git a/test/apps/db_dump/v6-empty.test-db b/test/apps/db_dump/v6-empty.test-db new file mode 100644 index 0000000000000000000000000000000000000000..99546ba23880ab97f34359a5e3d1823fdaaafd44 GIT binary patch literal 47 qcmZSB%8;91Tv(b}Qj)KblEeT3Y(R<;hy~6wvF@L{7s%m&NB{r@!U&)M literal 0 HcmV?d00001 diff --git a/test/apps/db_dump/v6-single-all.test-db b/test/apps/db_dump/v6-single-all.test-db new file mode 100644 index 0000000000000000000000000000000000000000..3d16c4aacd85edd2e0af981595e304a74c0174b9 GIT binary patch literal 267 zcmZSB%8;91Tv(b}Qj)KblEeT3Y(R<;hy~WPlvyv{3*>M>Wf&NkfUHoMI9!y0fgPwr z6Ub*}k7i^{EG@~`bu@P|aB+2U(sgyRG}m=?adXpkb1^g1H88PsGd6KEGB9v-E6Fd& zOwLU$E>28O1!@LatOPUkKM(*7<%02xGxO4OQgst^a)2VtKr97!22d3vHv=Pz3Ra*B YX|P@{23C-75VBxffg&tG%mFh50P6}hVE_OC literal 0 HcmV?d00001 diff --git a/test/apps/db_dump/v6-single-client.test-db b/test/apps/db_dump/v6-single-client.test-db new file mode 100644 index 0000000000000000000000000000000000000000..b6a8a1e17007734bbbb82d3d54af493f86c53173 GIT binary patch literal 92 zcmZSB%8;91Tv(b}Qj)KblEeT3Y(R<;hy^^=yFC`|1#&o`G7JnLIaL_%KM(-fyfA)o QW?p(us%~;lW@=su01-41wEzGB literal 0 HcmV?d00001 diff --git a/test/apps/db_dump/v6-single-cmsg.test-db b/test/apps/db_dump/v6-single-cmsg.test-db new file mode 100644 index 0000000000000000000000000000000000000000..9c9f93f6065be31f7f8121953dd540356b760052 GIT binary patch literal 254 zcmZSB%8;91Tv(b}Qj)KblEeT3Y(R<;hy|YBG+nr8FOb6lm0@6D0N%%wzx@?iMNl literal 0 HcmV?d00001 diff --git a/test/apps/mosq_test_helper.py b/test/apps/mosq_test_helper.py new file mode 100644 index 00000000..52c0ed51 --- /dev/null +++ b/test/apps/mosq_test_helper.py @@ -0,0 +1,18 @@ +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 +import mqtt5_opts +import mqtt5_props +import mqtt5_rc + +import socket +import ssl +import struct +import subprocess +import time +import errno