[
	{
		"group": "v3.1.1 PUBREC unsolicited",
		"ver":4,
		"tests": [
			{ "name": "50 [MQTT-3.1.0-1]", "connack":false, "msgs": [{"type":"send", "payload":"50 r2 m1"}]},
			{ "name": "50 remaining length 5 bytes", "msgs":[{"type":"send", "payload":"50 r268435456"}]},
			{ "name": "50", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 r2 m1"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 long", "msgs": [{"type":"send", "payload":"50 r3 m1 00"}]},
			{ "name": "50 mid 0", "msgs": [{"type":"send", "payload":"50 r2 m0"}]},
			{ "name": "50 short 0", "msgs": [{"type":"send", "payload":"50 r0"}]},
			{ "name": "50 short 1", "msgs": [{"type":"send", "payload":"50 r1 01"}]},
			{ "name": "51", "msgs": [{"type":"send", "payload":"51 r2 m1"}]},
			{ "name": "52", "msgs": [{"type":"send", "payload":"52 r2 m1"}]},
			{ "name": "54", "msgs": [{"type":"send", "payload":"54 r2 m1"}]},
			{ "name": "58", "msgs": [{"type":"send", "payload":"58 r2 m1"}]}
		]
	},
	{
		"group": "v3.1.1 PUBREC",
		"ver":4,
		"command":"publish-2",
		"group_msgs":[
			{"type":"recv", "payload":"34 r23 s12 'test/publish' m1 'message'"}
		],
		"tests": [
			{ "name": "50", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 r2 m1"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 remaining length 5 bytes", "msgs":[{"type":"send", "payload":"50 r268435456"}]},
			{ "name": "50 long", "msgs": [{"type":"send", "payload":"50 r3 m1 00"}]},
			{ "name": "50 mid 0", "msgs": [{"type":"send", "payload":"50 r2 m0"}]},
			{ "name": "50 short 0", "msgs": [{"type":"send", "payload":"50 r0"}]},
			{ "name": "50 short 1", "msgs": [{"type":"send", "payload":"50 r1 01"}]},
			{ "name": "51", "msgs": [{"type":"send", "payload":"51 r2 m1"}]},
			{ "name": "52", "msgs": [{"type":"send", "payload":"52 r2 m1"}]},
			{ "name": "54", "msgs": [{"type":"send", "payload":"54 r2 m1"}]},
			{ "name": "58", "msgs": [{"type":"send", "payload":"58 r2 m1"}]}
		]
	},
	{
		"group": "v5.0   PUBREC unsolicited",
		"ver":5,
		"tests": [
			{ "name": "50 [MQTT-3.1.0-1] (no reason code)", "connack":false, "msgs": [{"type":"send", "payload":"50 r2 m1"}]},
			{ "name": "50 [MQTT-3.1.0-1]", "connack":false, "msgs": [{"type":"send", "payload":"50 r3 m1 00"}]},
			{ "name": "50 long", "msgs": [{"type":"send", "payload":"50 r5 m1 00 00 00"}]},
			{ "name": "50 mid 0", "msgs": [{"type":"send", "payload":"50 r3 m0 00"}]},
			{ "name": "50 short 0", "msgs": [{"type":"send", "payload":"50 r0"}]},
			{ "name": "50 short 1", "msgs": [{"type":"send", "payload":"50 r1 01"}]},
			{ "name": "50 len=2", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 r2 m1"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 len=3", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 r3 m1 00"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 len=3 fail", "expect_disconnect":false, "msgs": [{"type":"send", "payload":"50 r3 m1 80"}]},
			{ "name": "50 len=4 ok", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 r4 m1 00 00"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 len=4 rc=fail", "expect_disconnect":false, "msgs": [{"type":"send", "payload":"50 r4 m1 80 00"}]},
			{ "name": "50 len=4 rc=unknown", "msgs": [{"type":"send", "payload":"50 r4 m1 FF 00"}]},
			{ "name": "50 len=4 short", "msgs": [{"type":"send", "payload":"50 r4 m1 00 01"}]},
			{ "name": "51", "msgs": [{"type":"send", "payload":"51 r3 m1 00"}]},
			{ "name": "52", "msgs": [{"type":"send", "payload":"52 r3 m1 00"}]},
			{ "name": "54", "msgs": [{"type":"send", "payload":"54 r3 m1 00"}]},
			{ "name": "58", "msgs": [{"type":"send", "payload":"58 r3 m1 00"}]}
		]
	},
	{
		"group": "v5.0   PUBREC valid",
		"ver":5,
		"expect_disconnect":false,
		"command":"publish-2",
		"group_msgs":[
			{"type":"recv", "payload":"34 r116 s12 'test/publish' m1 v92 01 i1 02 ffffffff 23 ffff 08 s14 'response/topic' 09 H36 '7deac5c5-8802-44ff-86ce-11479f337419' 03 s10 'text/plain' 26 s3 'key' s5 'value' 'message'"}
		],
		"tests": [
			{ "name": "50 len=2", "msgs": [
				{"type":"send", "payload":"50 r2 m1"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 len=3", "msgs": [
				{"type":"send", "payload":"50 r3 m1 00"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 len=3 fail", "msgs": [{"type":"send", "payload":"50 r3 m1 80"}]},
			{ "name": "50 len=4 ok", "msgs": [
				{"type":"send", "payload":"50 r4 m1 00 00"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 len=4 rc=fail", "msgs": [{"type":"send", "payload":"50 r4 m1 80 00"}]}
		]
	},
	{
		"group": "v5.0   PUBREC invalid",
		"ver":5,
		"command":"publish-2",
		"expect_disconnect":true,
		"group_msgs":[
			{"type":"recv", "payload":"34 r116 s12 'test/publish' m1 v92 01 i1 02 ffffffff 23 ffff 08 s14 'response/topic' 09 H36 '7deac5c5-8802-44ff-86ce-11479f337419' 03 s10 'text/plain' 26 s3 'key' s5 'value' 'message'"}
		],
		"tests": [
			{ "name": "50 long", "msgs": [{"type":"send", "payload":"50 r5 m1 00 00 00"}]},
			{ "name": "50 mid 0", "msgs": [{"type":"send", "payload":"50 r3 m0 00"}]},
			{ "name": "50 short 0", "msgs": [{"type":"send", "payload":"50 r0"}]},
			{ "name": "50 short 1", "msgs": [{"type":"send", "payload":"50 r1 01"}]},
			{ "name": "50 len=4 rc=unknown", "msgs": [{"type":"send", "payload":"50 r4 m1 FF 00"}]},
			{ "name": "50 len=4 short", "msgs": [{"type":"send", "payload":"50 r4 m1 00 01"}]},
			{ "name": "51 ", "msgs": [{"type":"send", "payload":"51 r3 m1 00"}]},
			{ "name": "52", "msgs": [{"type":"send", "payload":"52 r3 m1 00"}]},
			{ "name": "54", "msgs": [{"type":"send", "payload":"54 r3 m1 00"}]},
			{ "name": "58", "msgs": [{"type":"send", "payload":"58 r3 m1 00"}]}
		]
	},
	{
		"group": "v5.0   PUBREC ALLOWED PROPERTIES",
		"ver":5,
		"command":"publish-2",
		"group_msgs":[
			{"type":"recv", "payload":"34 r116 s12 'test/publish' m1 v92 01 i1 02 ffffffff 23 ffff 08 s14 'response/topic' 09 H36 '7deac5c5-8802-44ff-86ce-11479f337419' 03 s10 'text/plain' 26 s3 'key' s5 'value' 'message'"}
		],
		"tests": [
			{ "name": "50 with reason-string property", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 r8 m1 00 v4 1F s1 'p'"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 with 2*reason-string property", "msgs": [{"type":"send", "payload":"50 r12 m1 00 v8 1F s1 'p' 1F s1 'q'"}]},
			{ "name": "50 with reason-string property missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 1F"}]},
			{ "name": "50 with reason-string property empty", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 r7 m1 00 v3 1F s0"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 with user-property", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 r11 m1 00 v7 26 s1 'p' s1 'q'"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 with 2*user-property", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 12 m1 00 v14 26 s1 'p' s1 'q' 26 s1 'p' s1 'q'"},
				{"type":"recv", "payload":"62 02 m1"}
			]},
			{ "name": "50 with user-property missing value", "msgs": [{"type":"send", "payload":"50 r8 m1 00 v4 26 s1 'p'"}]},
			{ "name": "50 with user-property missing key,value", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 26"}]},
			{ "name": "50 with user-property empty key", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 r10 m1 00 v6 26 s0 s1 'p'"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 with user-property empty value", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 r10 m1 00 v6 26 s1 'p' s0"},
				{"type":"recv", "payload":"62 r2 m1"}
			]},
			{ "name": "50 with user-property empty key,value", "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 r9 m1 00 v5 26 s0 s0"},
				{"type":"recv", "payload":"62 r2 m1"}
			]}
		]
	},
	{
		"group": "v5.0   PUBREC DISALLOWED PROPERTIES",
		"ver":5,
		"tests": [
			{ "name": "50 with payload-format-indicator (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 01 i0"}]},
			{ "name": "50 with request-problem-information (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 17 i0"}]},
			{ "name": "50 with maximum-qos (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 24 i0"}]},
			{ "name": "50 with retain-available (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 25 i0"}]},
			{ "name": "50 with wildcard-subscription-available (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 28 i0"}]},
			{ "name": "50 with subscription-identifier-available (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 29 i0"}]},
			{ "name": "50 with shared-subscription-available (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 2A i0"}]},
			{ "name": "50 with payload-format-indicator (byte) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 01"}]},
			{ "name": "50 with request-problem-information (byte) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 17"}]},
			{ "name": "50 with maximum-qos (byte) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 24"}]},
			{ "name": "50 with retain-available (byte) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 25"}]},
			{ "name": "50 with wildcard-subscription-available (byte) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 28"}]},
			{ "name": "50 with subscription-identifier-available (byte) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 29"}]},
			{ "name": "50 with shared-subscription-available (byte) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 2A"}]},
			{ "name": "50 with message-expiry-interval (four byte integer)", "msgs": [{"type":"send", "payload":"50 r9 m1 00 05 02 L1"}]},
			{ "name": "50 with session-expiry-interval (four byte integer)", "msgs": [{"type":"send", "payload":"50 r9 m1 00 05 11 L1"}]},
			{ "name": "50 with will-delay-interval (four byte integer)", "msgs": [{"type":"send", "payload":"50 r9 m1 00 v5 18 L1"}]},
			{ "name": "50 with maximum-packet-size (four byte integer)", "msgs": [{"type":"send", "payload":"50 r9 m1 00 v5 27 L1"}]},
			{ "name": "50 with message-expiry-interval (four byte integer) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 02"}]},
			{ "name": "50 with session-expiry-interval (four byte integer) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 11"}]},
			{ "name": "50 with will-delay-interval (four byte integer) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 18"}]},
			{ "name": "50 with maximum-packet-size (four byte integer) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 27"}]},
			{ "name": "50 with content-type (UTF-8 string)", "msgs": [{"type":"send", "payload":"50 r8 m1 00 v4 03 s1 'p'"}]},
			{ "name": "50 with response-topic (UTF-8 string)", "msgs": [{"type":"send", "payload":"50 r8 m1 00 v4 08 s1 'p'"}]},
			{ "name": "50 with assigned-client-identifier (UTF-8 string)", "msgs": [{"type":"send", "payload":"50 r8 m1 00 v4 12 s1 'p'"}]},
			{ "name": "50 with authentication-method (UTF-8 string)", "msgs": [{"type":"send", "payload":"50 r8 m1 00 v4 15 s1 'p'"}]},
			{ "name": "50 with response-information (UTF-8 string)", "msgs": [{"type":"send", "payload":"50 r8 m1 00 v4 1A s1 'p'"}]},
			{ "name": "50 with server-reference (UTF-8 string)", "msgs": [{"type":"send", "payload":"50 r8 m1 00 v4 1C s1 'p'"}]},
			{ "name": "50 with content-type (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 03"}]},
			{ "name": "50 with response-topic (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 08"}]},
			{ "name": "50 with assigned-client-identifier (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 12"}]},
			{ "name": "50 with authentication-method (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 15"}]},
			{ "name": "50 with response-information (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 1A"}]},
			{ "name": "50 with server-reference (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 1C"}]},
			{ "name": "50 with correlation-data (binary data)", "msgs": [{"type":"send", "payload":"50 r8 m1 00 v4 09 s1 'p'"}]},
			{ "name": "50 with authentication-data (binary data)", "msgs": [{"type":"send", "payload":"50 r8 m1 00 v4 16 s1 'p'"}]},
			{ "name": "50 with correlation-data (binary data) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 09"}]},
			{ "name": "50 with authentication-data (binary data) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 16"}]},
			{ "name": "50 with subscription-identifier (variable byte integer)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 0B v1"}]},
			{ "name": "50 with subscription-identifier (variable byte integer) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 0B"}]},
			{ "name": "50 with server-keep-alive (two byte integer)", "msgs": [{"type":"send", "payload":"50 r7 m1 00 v3 13 H5"}]},
			{ "name": "50 with receive-maximum (two byte integer)", "msgs": [{"type":"send", "payload":"50 r7 m1 00 v3 21 H5"}]},
			{ "name": "50 with topic-alias-maximum (two byte integer)", "msgs": [{"type":"send", "payload":"50 r7 m1 00 v3 22 H5"}]},
			{ "name": "50 with topic-alias (two byte integer)", "msgs": [{"type":"send", "payload":"50 r7 m1 00 v3 23 H5"}]},
			{ "name": "50 with server-keep-alive (two byte integer) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 13"}]},
			{ "name": "50 with receive-maximum (two byte integer) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 21"}]},
			{ "name": "50 with topic-alias-maximum (two byte integer) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 22"}]},
			{ "name": "50 with topic-alias (two byte integer) missing", "msgs": [{"type":"send", "payload":"50 r5 m1 00 v1 23"}]},
			{ "name": "50 with invalid-property 0x00 (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 00 i1"}]},
			{ "name": "50 with unknown-property 0x04 (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 04 i1"}]},
			{ "name": "50 with unknown-property 0x05 (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 05 i1"}]},
			{ "name": "50 with unknown-property 0x06 (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 06 i1"}]},
			{ "name": "50 with unknown-property 0x07 (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 07 i1"}]},
			{ "name": "50 with unknown-property 0x0A (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 0A i1"}]},
			{ "name": "50 with unknown-property 0x0C (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 0C i1"}]},
			{ "name": "50 with unknown-property 0x0D (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 0D i1"}]},
			{ "name": "50 with unknown-property 0x0E (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 0E i1"}]},
			{ "name": "50 with unknown-property 0x0F (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 0F i1"}]},
			{ "name": "50 with unknown-property 0x10 (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 10 i1"}]},
			{ "name": "50 with unknown-property 0x14 (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 14 i1"}]},
			{ "name": "50 with unknown-property 0x1B (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 1B i1"}]},
			{ "name": "50 with unknown-property 0x1D (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 1D i1"}]},
			{ "name": "50 with unknown-property 0x1E (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 1E i1"}]},
			{ "name": "50 with unknown-property 0x20 (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 20 i1"}]},
			{ "name": "50 with unknown-property 0x7F (byte)", "msgs": [{"type":"send", "payload":"50 r6 m1 00 v2 7F i1"}]},
			{ "name": "50 with invalid-property 0x8000 (byte)", "msgs": [{"type":"send", "payload":"50 r7 m1 00 v3 8000 i1"}]},
			{ "name": "50 with unknown-property 0x8001 (byte)", "msgs": [{"type":"send", "payload":"50 r7 m1 00 v3 8001 i1"}]},
			{ "name": "50 with unknown-property 0xFF7F (byte)", "msgs": [{"type":"send", "payload":"50 r7 m1 00 v3 FF7F i1"}]},
			{ "name": "50 with unknown-property 0x808001 (byte)", "msgs": [{"type":"send", "payload":"50 r8 m1 00 v4 808001 i1"}]},
			{ "name": "50 with unknown-property 0xFFFF7F (byte)", "msgs": [{"type":"send", "payload":"50 r8 m1 00 v4 FFFF7F i1"}]},
			{ "name": "50 with unknown-property 0x80808001 (byte)", "msgs": [{"type":"send", "payload":"50 r9 m1 00 v5 80808001 i1"}]},
			{ "name": "50 with unknown-property 0xFFFFFF7F (byte)", "msgs": [{"type":"send", "payload":"50 r9 m1 00 v5 FFFFFF7F i1"}]}
		]
	}
]
