[
	{
		"comment": "FLOW TESTS ARE INCOMPLETE",
		"group": "v3.1.1 FLOW",
		"ver":4,
		"tests": [
			{ "name": "QoS 0 self receive ok", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r6 m1234 s1 'p' 01", "comment":"SUBSCRIBE, 'p' qos1"},
				{"type":"recv", "payload":"90 r3 m1234 01", "comment":"SUBACK"},
				{"type":"send", "payload":"30 r10 s1 'p' 'message'", "comment":"PUBLISH send"},
				{"type":"recv", "payload":"30 r10 s1 'p' 'message'", "comment":"PUBLISH receive"}
			]},
			{ "name": "QoS 1 receive ok", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r6 m1234 s1 'p' 01", "comment":"SUBSCRIBE, 'p' qos1"},
				{"type":"recv", "payload":"90 r3 m1234 01", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":1, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"32 r12 s1 'p' m1 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"40 r2 m1", "comment":"PUBACK"}
			]},
			{ "name": "QoS 1 PUBLISH-PUBREC", "msgs": [
				{"type":"send", "payload":"82 r6 m1234 s1 'p' 01", "comment":"SUBSCRIBE, 'p' qos1"},
				{"type":"recv", "payload":"90 r3 m1234 01", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":1, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"32 r12 s1 'p' m1 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"50 r2 m1", "comment":"PUBREC"}
			]},
			{ "name": "QoS 1 PUBLISH-PUBCOMP", "msgs": [
				{"type":"send", "payload":"82 r6 m1234 s1 'p' 01", "comment":"SUBSCRIBE, 'p' qos1"},
				{"type":"recv", "payload":"90 r3 m1234 01", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":1, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"32 r12 s1 'p' m1 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"70 r2 m1", "comment":"PUBCOMP"}
			]},
			{ "name": "QoS 2 receive ok", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r6 m1234 s1 'p' 02", "comment":"SUBSCRIBE, 'p' qos2"},
				{"type":"recv", "payload":"90 r3 m1234 02", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":2, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"34 r12 s1 'p' m1 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"50 r2 m1", "comment":"PUBREC"},
				{"type":"recv", "payload":"62 r2 m1", "comment":"PUBREL"},
				{"type":"send", "payload":"70 r2 m1", "comment":"PUBCOMP"}
			]},
			{ "name": "QoS 2 PUBLISH-PUBACK", "msgs": [
				{"type":"send", "payload":"82 r6 m1234 s1 'p' 02", "comment":"SUBSCRIBE, 'p' qos2"},
				{"type":"recv", "payload":"90 r3 m1234 02", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":2, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"34 r12 s1 'p' m1 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"40 r2 m1", "comment": "PUBACK (should be PUBREC)"}
			]},
			{ "name": "QoS 2 PUBLISH-PUBCOMP", "msgs": [
				{"type":"send", "payload":"82 r6 m1234 s1 'p' 02", "comment":"SUBSCRIBE, 'p' qos2"},
				{"type":"recv", "payload":"90 r3 m1234 02", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":2, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"34 r12 s1 'p' m1 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"70 r2 m1", "comment": "PUBCOMP (should be PUBREC)"}
			]},
			{ "name": "QoS 2 PUBLISH-PUBREC-PUBREL-PUBACK", "msgs": [
				{"type":"send", "payload":"82 r6 m1234 s1 'p' 02", "comment":"SUBSCRIBE, 'p' qos2"},
				{"type":"recv", "payload":"90 r3 m1234 02", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":2, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"34 r12 s1 'p' m1 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"50 r2 m1", "comment": "PUBREC)"},
				{"type":"recv", "payload":"62 r2 m1", "comment": "PUBREL)"},
				{"type":"send", "payload":"40 r2 m1", "comment": "PUBACK (should be PUBCOMP))"}
			]},
			{ "name": "QoS 2 PUBLISH-PUBREC-PUBREL-PUBREC", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r6 m1234 s1 'p' 02", "comment":"SUBSCRIBE, 'p' qos2"},
				{"type":"recv", "payload":"90 r3 m1234 02", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":2, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"34 r12 s1 'p' m1 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"50 r2 m1", "comment": "PUBREC)"},
				{"type":"recv", "payload":"62 r2 m1", "comment": "PUBREL)"},
				{"type":"send", "payload":"50 r2 m1", "comment": "PUBREC (should be PUBCOMP))"},
				{"type":"recv", "payload":"62 r2 m1", "comment": "PUBREL)"}
			]}
		]
	},
	{
		"group": "v5.0   FLOW",
		"ver":5,
		"tests": [
			{ "name": "QoS 0 self receive ok", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r7 m1234 00 s1 'p' 01", "comment":"SUBSCRIBE, 'p' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"send", "payload":"30 r11 s1 'p' 00 'message'", "comment":"PUBLISH send"},
				{"type":"recv", "payload":"30 r11 s1 'p' 00 'message'", "comment":"PUBLISH receive"}
			]},
			{ "name": "QoS 1 receive ok", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r7 m1234 00 s1 'p' 01", "comment":"SUBSCRIBE, 'p' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":1, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"32 r13 s1 'p' m1 00 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"40 r2 m1", "comment":"PUBACK"}
			]},
			{ "name": "QoS 1 PUBLISH-PUBREC", "msgs": [
				{"type":"send", "payload":"82 r7 m1234 00 s1 'p' 01", "comment":"SUBSCRIBE, 'p' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":1, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"32 r13 s1 'p' m1 00 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"50 r2 m1", "comment":"PUBREC"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "QoS 1 PUBLISH-PUBCOMP", "msgs": [
				{"type":"send", "payload":"82 r7 m1234 00 s1 'p' 01", "comment":"SUBSCRIBE, 'p' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":1, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"32 r13 s1 'p' m1 00 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"70 r2 m1", "comment":"PUBCOMP"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "QoS 2 receive ok", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r7 m1234 00 s1 'p' 02", "comment":"SUBSCRIBE, 'p' qos2"},
				{"type":"recv", "payload":"90 r4 m1234 00 02", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":2, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"34 r13 s1 'p' m1 00 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"50 r2 m1", "comment":"PUBREC"},
				{"type":"recv", "payload":"62 r2 m1", "comment":"PUBREL"},
				{"type":"send", "payload":"70 r2 m1", "comment":"PUBCOMP"}
			]},
			{ "name": "QoS 2 PUBLISH-PUBACK", "msgs": [
				{"type":"send", "payload":"82 r7 m1234 00 s1 'p' 02", "comment":"SUBSCRIBE, 'p' qos2"},
				{"type":"recv", "payload":"90 r4 m1234 00 02", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":2, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"34 r13 s1 'p' m1 00 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"40 r2 m1", "comment": "PUBACK (should be PUBREC)"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "QoS 2 PUBLISH-PUBCOMP", "msgs": [
				{"type":"send", "payload":"82 r7 m1234 00 s1 'p' 02", "comment":"SUBSCRIBE, 'p' qos2"},
				{"type":"recv", "payload":"90 r4 m1234 00 02", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":2, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"34 r13 s1 'p' m1 00 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"70 r2 m1", "comment": "PUBCOMP (should be PUBREC)"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "QoS 2 PUBLISH-PUBREC-PUBREL-PUBACK", "msgs": [
				{"type":"send", "payload":"82 r7 m1234 00 s1 'p' 02", "comment":"SUBSCRIBE, 'p' qos2"},
				{"type":"recv", "payload":"90 r4 m1234 00 02", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":2, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"34 r13 s1 'p' m1 00 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"50 r2 m1", "comment": "PUBREC)"},
				{"type":"recv", "payload":"62 r2 m1", "comment": "PUBREL)"},
				{"type":"send", "payload":"40 r2 m1", "comment": "PUBACK (should be PUBCOMP))"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "QoS 2 PUBLISH-PUBREC-PUBREL-PUBREC", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r7 m1234 00 s1 'p' 02", "comment":"SUBSCRIBE, 'p' qos2"},
				{"type":"recv", "payload":"90 r4 m1234 00 02", "comment":"SUBACK"},
				{"type":"publish", "topic":"p", "qos":2, "payload":"message", "comment":"helper"},
				{"type":"recv", "payload":"34 r13 s1 'p' m1 00 'message'", "comment":"PUBLISH receive"},
				{"type":"send", "payload":"50 r2 m1", "comment": "PUBREC)"},
				{"type":"recv", "payload":"62 r2 m1", "comment": "PUBREL)"},
				{"type":"send", "payload":"50 r2 m1", "comment": "PUBREC (should be PUBCOMP))"},
				{"type":"recv", "payload":"62 r2 m1", "comment": "PUBREL)"}
			]}
		]
	},
	{
		"group": "v5.0   FLOW WITH PROPERTIES",
		"ver":5,
		"tests": [
			{ "name": "payload-format-indicator=1 (byte)", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r11 m1234 00 s5 'topic' 01", "comment":"SUBSCRIBE, 'topic' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"send", "payload":"30 r17 s5 'topic' 02 0101 'payload'", "comment": "PUBLISH send"},
				{"type":"recv", "payload":"30 r17 s5 'topic' 02 0101 'payload'", "comment": "PUBLISH recv"}
			]},
			{ "name": "message-expiry-interval=1 (four byte integer)", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r11 m1234 00 s5 'topic' 01", "comment":"SUBSCRIBE, 'topic' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"send", "payload":"30 r20 s5 'topic' 05 02 L1 'payload'"},
				{"type":"recv", "payload":"30 r20 s5 'topic' 05 02 L1 'payload'"}
			]},
			{ "name": "topic-alias", "expect_disconnect":false, "comment":"broker doesn't initiate topic alias", "msgs": [
				{"type":"send", "payload":"82 r11 m1234 00 s5 'topic' 01", "comment":"SUBSCRIBE, 'topic' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"send", "payload":"30 r18 s5 'topic' 03 23 s1 'payload'", "comment":"PUBLISH with topic alias 1"},
				{"type":"recv", "payload":"30 r15 s5 'topic' 00 'payload'", "comment":"PUBLISH receive 1"},
				{"type":"send", "payload":"30 r13 s0 03 23 s1 'payload'", "comment":"PUBLISH with topic alias 1, no topic"},
				{"type":"recv", "payload":"30 r15 s5 'topic' 00 'payload'", "comment":"PUBLISH receive 2"}
			]},
			{ "name": "response-topic", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r11 m1234 00 s5 'topic' 01", "comment":"SUBSCRIBE, 'topic' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"send", "payload":"30 r19 s5 'topic' 04 08 s1 'p' 'payload'"},
				{"type":"recv", "payload":"30 r19 s5 'topic' 04 08 s1 'p' 'payload'"}
			]},
			{ "name": "correlation-data", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r11 m1234 00 s5 'topic' 01", "comment":"SUBSCRIBE, 'topic' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"send", "payload":"30 r19 s5 'topic' 04 09 s1 'p' 'payload'"},
				{"type":"recv", "payload":"30 r19 s5 'topic' 04 09 s1 'p' 'payload'"}
			]},
			{ "name": "user-property", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r11 m1234 00 s5 'topic' 01", "comment":"SUBSCRIBE, 'topic' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"send", "payload":"30 r22 s5 'topic' 07 26 s1 'p' s1 'q' 'payload'"},
				{"type":"recv", "payload":"30 r22 s5 'topic' 07 26 s1 'p' s1 'q' 'payload'"}
			]},
			{ "name": "subscription-identifier", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r13 m1234 02 0B01 s5 'topic' 01", "comment":"SUBSCRIBE, 'topic' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"send", "payload":"30 r15 s5 'topic' 00 'payload'"},
				{"type":"recv", "payload":"30 r17 s5 'topic' 02 0B01 'payload'"}
			]},
			{ "name": "content-type", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"82 r11 m1234 00 s5 'topic' 01", "comment":"SUBSCRIBE, 'topic' qos1"},
				{"type":"recv", "payload":"90 r4 m1234 00 01", "comment":"SUBACK"},
				{"type":"send", "payload":"30 r19 s5 'topic' 04 03 s1 'p' 'payload'"},
				{"type":"recv", "payload":"30 r19 s5 'topic' 04 03 s1 'p' 'payload'"}
			]}
		]
	}
]
