[
	{
		"group": "v3.1.1 SUBACK",
		"ver":4,
		"tests": [
			{ "name": "90 [MQTT-3.1.0-1]", "connect":false, "msgs": [{"type":"send", "payload":"90 r3 m1 00"}]},
			{ "name": "90 remaining length 5 bytes", "msgs":[{"type":"send", "payload":"90 r268435456"}]},
			{ "name": "90 mid 0", "msgs": [{"type":"send", "payload":"90 r3 m0 00"}]},
			{ "name": "90", "msgs": [{"type":"send", "payload":"90 r3 m1 00"}]},
			{ "name": "90 short 0", "msgs": [{"type":"send", "payload":"90 r0"}]},
			{ "name": "90 short 1", "msgs": [{"type":"send", "payload":"90 r1 01"}]},
			{ "name": "90 short 2", "msgs": [{"type":"send", "payload":"90 r2 m1"}]},
			{ "name": "91", "msgs": [{"type":"send", "payload":"91 r3 m1 00"}]},
			{ "name": "92", "msgs": [{"type":"send", "payload":"92 r3 m1 00"}]},
			{ "name": "94", "msgs": [{"type":"send", "payload":"94 r3 m1 00"}]},
			{ "name": "98", "msgs": [{"type":"send", "payload":"98 r3 m1 00"}]}
		]
	},
	{
		"group": "v5.0   SUBACK",
		"ver":5,
		"tests": [
			{ "name": "90 [MQTT-3.1.0-1]", "connect":false, "msgs": [{"type":"send", "payload":"90 r3 m1 00"}]},
			{ "name": "90 remaining length 5 bytes", "msgs":[{"type":"send", "payload":"90 r268435456"}]},
			{ "name": "90 long", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 short 0", "msgs": [
				{"type":"send", "payload":"90 r0"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 short 1", "msgs": [
				{"type":"send", "payload":"90 r1 01"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 short 2", "msgs": [
				{"type":"send", "payload":"90 r2 m1"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 short 3", "msgs": [
				{"type":"send", "payload":"90 r3 m1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90", "msgs": [
				{"type":"send", "payload":"90 r3 m1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "91", "msgs": [
				{"type":"send", "payload":"91 r3 m1 00"},
				{"type":"recv", "payload":"E0 r1 81"}
			]},
			{ "name": "92", "msgs": [
				{"type":"send", "payload":"92 r3 m1 00"},
				{"type":"recv", "payload":"E0 r1 81"}
			]},
			{ "name": "94", "msgs": [
				{"type":"send", "payload":"94 r3 m1 00"},
				{"type":"recv", "payload":"E0 r1 81"}
			]},
			{ "name": "98", "msgs": [
				{"type":"send", "payload":"98 r3 m1 00"},
				{"type":"recv", "payload":"E0 r1 81"}
			]},
			{ "name": "90 with property", "msgs": [
				{"type":"send", "payload":"90 r8 m1 04 1F s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0x01 qos 1", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 01"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0x02 qos 2", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 02"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0x11 no sub", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 11"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0x80 unspecified error", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 80"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0x83 implementation specific error", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 83"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0x87 not authorised", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 87"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0x8F topic filter invalid", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 8F"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0x91 packet identifier in use", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 91"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0x97 quota exceeded", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 97"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0x9E shared subs not supported", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 9E"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0xA1 sub ids not supported", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 A1"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0xA2 wildcards not supported", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 A2"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 reason code 0xFF unknown", "msgs": [
				{"type":"send", "payload":"90 r4 m1 00 FF"},
				{"type":"recv", "payload":"E0 r1 82"}
			]}
		]
	},
	{
		"group": "v5.0   SUBACK ALLOWED PROPERTIES",
		"ver":5,
		"tests": [
			{ "name": "90 with reason-string property", "msgs": [
				{"type":"send", "payload":"90 r8 m1 04 1F s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with 2*reason-string property", "msgs": [
				{"type":"send", "payload":"90 r12 m1 0008 1F s1 'p' 1F s1 'q'"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with reason-string property missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 01 1F 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with user-property", "msgs": [
				{"type":"send", "payload":"90 r11 m1 07 26 s1 'p' s1 'q' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with user-property missing value", "msgs": [
				{"type":"send", "payload":"90 r8 m1 04 26 s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with user-property missing key,value", "msgs": [
				{"type":"send", "payload":"90 r5 m1 01 26 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with user-property empty key", "msgs": [
				{"type":"send", "payload":"90 r10 m1 06 26 s0 s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with user-property empty value", "msgs": [
				{"type":"send", "payload":"90 r10 m1 06 26 s1 'p' s0 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with user-property empty key,value", "msgs": [
				{"type":"send", "payload":"90 r9 m1 05 26 s0 s0 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]}
		]
	},
	{
		"group": "v5.0   SUBACK DISALLOWED PROPERTIES",
		"ver":5,
		"tests": [
			{ "name": "90 with payload-format-indicator (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 01 i0 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with request-problem-information (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 17 i0 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with maximum-qos (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 24 i0 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with retain-available (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 25 i0 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with wildcard-subscription-available (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 28 i0 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with subscription-identifier-available (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 29 i0 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with shared-subscription-available (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 2A i0 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with payload-format-indicator (byte) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 01 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with request-problem-information (byte) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 17 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with maximum-qos (byte) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 24 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with retain-available (byte) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 25 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with wildcard-subscription-available (byte) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 28 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with subscription-identifier-available (byte) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 29 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with shared-subscription-available (byte) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 2A 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with message-expiry-interval (four byte integer)", "msgs": [
				{"type":"send", "payload":"90 r9 m1 v5 02 L1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with session-expiry-interval (four byte integer)", "msgs": [
				{"type":"send", "payload":"90 r9 m1 v5 11 L1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with will-delay-interval (four byte integer)", "msgs": [
				{"type":"send", "payload":"90 r9 m1 v5 18 L1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with maximum-packet-size (four byte integer)", "msgs": [
				{"type":"send", "payload":"90 r9 m1 v5 27 L1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with message-expiry-interval (four byte integer) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 02 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with session-expiry-interval (four byte integer) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 11 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with will-delay-interval (four byte integer) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 18 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with maximum-packet-size (four byte integer) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 27 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with content-type (UTF-8 string)", "msgs": [
				{"type":"send", "payload":"90 r8 m1 v4 03 s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with response-topic (UTF-8 string)", "msgs": [
				{"type":"send", "payload":"90 r8 m1 v4 08 s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with assigned-client-identifier (UTF-8 string)", "msgs": [
				{"type":"send", "payload":"90 r8 m1 v4 12 s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with authentication-method (UTF-8 string)", "msgs": [
				{"type":"send", "payload":"90 r8 m1 v4 15 s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with response-information (UTF-8 string)", "msgs": [
				{"type":"send", "payload":"90 r8 m1 v4 1A s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with server-reference (UTF-8 string)", "msgs": [
				{"type":"send", "payload":"90 r8 m1 v4 1C s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with content-type (UTF-8 string) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 03 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with response-topic (UTF-8 string) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 08 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with assigned-client-identifier (UTF-8 string) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 12 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with authentication-method (UTF-8 string) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 15 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with response-information (UTF-8 string) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 1A00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with server-reference (UTF-8 string) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 1C00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with correlation-data (binary data)", "msgs": [
				{"type":"send", "payload":"90 r8 m1 v4 09 s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with authentication-data (binary data)", "msgs": [
				{"type":"send", "payload":"90 r8 m1 v4 16 s1 'p' 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with correlation-data (binary data) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 09 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with authentication-data (binary data) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 16 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with subscription-identifier (variable byte integer)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 0B v1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with subscription-identifier (variable byte integer) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 0B 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with server-keep-alive (two byte integer)", "msgs": [
				{"type":"send", "payload":"90 r7 m1 v3 13 H5 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with receive-maximum (two byte integer)", "msgs": [
				{"type":"send", "payload":"90 r7 m1 v3 21 H5 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with topic-alias-maximum (two byte integer)", "msgs": [
				{"type":"send", "payload":"90 r7 m1 v3 22 H5 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with topic-alias (two byte integer)", "msgs": [
				{"type":"send", "payload":"90 r7 m1 v3 23 H5 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with server-keep-alive (two byte integer) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 13 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with receive-maximum (two byte integer) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 21 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with topic-alias-maximum (two byte integer) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 22 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with topic-alias (two byte integer) missing", "msgs": [
				{"type":"send", "payload":"90 r5 m1 v1 23 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},

			{ "name": "90 with invalid-property 0x00 (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 00 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x04 (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 04 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x05 (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 05 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x06 (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 06 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x07 (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 07 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x0A (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 0A i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x0C (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 0C i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x0D (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 0D i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x0E (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 0E i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x0F (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 0F i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x10 (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 10 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x14 (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 14 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x1B (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 19 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x1D (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 1D i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x1E (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 1E i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x20 (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 20 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x7F (byte)", "msgs": [
				{"type":"send", "payload":"90 r6 m1 v2 7F i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with invalid-property 0x8000 (byte)", "msgs": [
				{"type":"send", "payload":"90 r7 m1 v3 8000 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x8001 (byte)", "msgs": [
				{"type":"send", "payload":"90 r7 m1 v3 8001 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0xFF7F (byte)", "msgs": [
				{"type":"send", "payload":"90 r7 m1 v3 FF7F i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x808001 (byte)", "msgs": [
				{"type":"send", "payload":"90 r8 m1 v4 808001 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0xFFFF7F (byte)", "msgs": [
				{"type":"send", "payload":"90 r8 m1 v4 FFFF7F i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0x80808001 (byte)", "msgs": [
				{"type":"send", "payload":"90 r9 m1 v5 80808001 i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]},
			{ "name": "90 with unknown-property 0xFFFFFF7F (byte)", "msgs": [
				{"type":"send", "payload":"90 r9 m1 v5 FFFFFF7F i1 00"},
				{"type":"recv", "payload":"E0 r1 82"}
			]}
		]
	}
]
