[
	{
		"group": "v3.1.1 CONNACK",
		"connack": false,
		"ver":4,
		"tests": [
			{ "name": "20 [MQTT-3.1.0-1]", "expect_disconnect":false, "msgs": [{"type":"send", "payload":"20 r2 00 00"}]},
			{ "name": "20 remaining length 5 bytes", "msgs":[{"type":"send", "payload":"20 r268435456"}]},
			{ "name": "20 long", "msgs": [{"type":"send", "payload":"20 r3 00 00 00"}]},
			{ "name": "20 short 1", "msgs": [{"type":"send", "payload":"20 r1 00"}]},
			{ "name": "20 short 0", "msgs": [{"type":"send", "payload":"20 r0"}]},
			{ "name": "20", "expect_disconnect":false, "msgs": [{"type":"send", "payload":"20 r2 00 00"}]},
			{ "name": "21", "msgs": [{"type":"send", "payload":"21 02 00 00"}]},
			{ "name": "22", "msgs": [{"type":"send", "payload":"22 02 00 00"}]},
			{ "name": "24", "msgs": [{"type":"send", "payload":"24 02 00 00"}]},
			{ "name": "28", "msgs": [{"type":"send", "payload":"28 02 00 00"}]},
			{ "name": "issue 2163 v3", "ver":3, "msgs": [{"type":"send", "payload":"29 02 00 01"}]},
			{ "name": "issue 2163 v4", "msgs": [{"type":"send", "payload":"29 02 00 01"}]},
			{ "name": "20 CAF=0x01", "msgs": [{"type":"send", "payload":"20 r2 01 00"}]},
			{ "name": "20 CAF=0x02", "msgs": [{"type":"send", "payload":"20 r2 02 00"}]},
			{ "name": "20 CAF=0x04", "msgs": [{"type":"send", "payload":"20 r2 04 00"}]},
			{ "name": "20 CAF=0x08", "msgs": [{"type":"send", "payload":"20 r2 08 00"}]},
			{ "name": "20 CAF=0x10", "msgs": [{"type":"send", "payload":"20 r2 10 00"}]},
			{ "name": "20 CAF=0x20", "msgs": [{"type":"send", "payload":"20 r2 20 00"}]},
			{ "name": "20 CAF=0x40", "msgs": [{"type":"send", "payload":"20 r2 40 00"}]},
			{ "name": "20 CAF=0x80", "msgs": [{"type":"send", "payload":"20 r2 80 00"}]}
		]
	},
	{
		"group": "v5.0   CONNACK",
		"comment": "CMD RL FLAG RC PROPLEN PROPS",
		"ver":5,
		"connack": false,
		"tests": [
			{ "name": "20 [MQTT-3.1.0-1]", "expect_disconnect":false, "msgs": [{"type":"send", "payload":"20 r3 00 00 v0"}]},
			{ "name": "20 remaining length 5 bytes", "msgs":[{"type":"send", "payload":"20 r268435456"}]},
			{ "name": "20 with properties", "expect_disconnect":false, "msgs": [{"type":"send", "payload":"20 r6 00 00 v3 21 H10"}]},
			{ "name": "20 long", "expect_disconnect":false, "msgs": [{"type":"send", "payload":"20 r4 00 00 00 00"}]},
			{ "name": "20 short 2", "msgs": [{"type":"send", "payload":"20 r2 00 00"}]},
			{ "name": "20 short 1", "msgs": [{"type":"send", "payload":"20 r1 00"}]},
			{ "name": "20 short 0", "msgs": [{"type":"send", "payload":"20 r0"}]},
			{ "name": "21", "msgs": [{"type":"send", "payload":"21 r3 00 00 v0"}]},
			{ "name": "22", "msgs": [{"type":"send", "payload":"22 r3 00 00 v0"}]},
			{ "name": "24", "msgs": [{"type":"send", "payload":"24 r3 00 00 v0"}]},
			{ "name": "28", "msgs": [{"type":"send", "payload":"28 r3 00 00 v0"}]},
			{ "name": "issue 2163 v5", "msgs": [{"type":"send", "payload":"29 r2 00 01"}]},
			{ "name": "20 CAF=0x01", "msgs": [{"type":"send", "payload":"20 r3 01 00 v0"}]},
			{ "name": "20 CAF=0x02", "msgs": [{"type":"send", "payload":"20 r3 02 00 v0"}]},
			{ "name": "20 CAF=0x04", "msgs": [{"type":"send", "payload":"20 r3 04 00 v0"}]},
			{ "name": "20 CAF=0x08", "msgs": [{"type":"send", "payload":"20 r3 08 00 v0"}]},
			{ "name": "20 CAF=0x10", "msgs": [{"type":"send", "payload":"20 r3 10 00 v0"}]},
			{ "name": "20 CAF=0x20", "msgs": [{"type":"send", "payload":"20 r3 20 00 v0"}]},
			{ "name": "20 CAF=0x40", "msgs": [{"type":"send", "payload":"20 r3 40 00 v0"}]},
			{ "name": "20 CAF=0x80", "msgs": [{"type":"send", "payload":"20 r3 80 00 v0"}]},
			{ "name": "20 RC=0x01 (invalid)", "msgs": [{"type":"send", "payload":"20 r3 00 01 v0"}]},
			{ "name": "20 RC=0x80 (unspecified error)", "msgs": [{"type":"send", "payload":"20 r3 00 80 v0"}]},
			{ "name": "20 RC=0x81 (malformed packet)", "msgs": [{"type":"send", "payload":"20 r3 00 81 v0"}]},
			{ "name": "20 RC=0x82 (protocol error)", "msgs": [{"type":"send", "payload":"20 r3 00 82 v0"}]},
			{ "name": "20 RC=0x83 (implementation specific error)", "msgs": [{"type":"send", "payload":"20 r3 00 83 v0"}]},
			{ "name": "20 RC=0x84 (unsupported protocol version)", "msgs": [{"type":"send", "payload":"20 r3 00 84 v0"}]},
			{ "name": "20 RC=0x85 (client identifier not valid)", "msgs": [{"type":"send", "payload":"20 r3 00 85 v0"}]},
			{ "name": "20 RC=0x86 (bad user name or password)", "msgs": [{"type":"send", "payload":"20 r3 00 86 v0"}]},
			{ "name": "20 RC=0x87 (not authorised)", "msgs": [{"type":"send", "payload":"20 r3 00 87 v0"}]},
			{ "name": "20 RC=0x88 (server unavailable)", "msgs": [{"type":"send", "payload":"20 r3 00 88 v0"}]},
			{ "name": "20 RC=0x89 (server busy)", "msgs": [{"type":"send", "payload":"20 r3 00 89 v0"}]},
			{ "name": "20 RC=0x8A (banned)", "msgs": [{"type":"send", "payload":"20 r3 00 8A v0"}]},
			{ "name": "20 RC=0x8C (bad authentication method)", "msgs": [{"type":"send", "payload":"20 r3 00 8C v0"}]},
			{ "name": "20 RC=0x90 (topic name invalid)", "msgs": [{"type":"send", "payload":"20 r3 00 90 v0"}]},
			{ "name": "20 RC=0x95 (packet too large)", "msgs": [{"type":"send", "payload":"20 r3 00 95 v0"}]},
			{ "name": "20 RC=0x97 (quota exceeded)", "msgs": [{"type":"send", "payload":"20 r3 00 97 v0"}]},
			{ "name": "20 RC=0x99 (payload format invalid)", "msgs": [{"type":"send", "payload":"20 r3 00 99 v0"}]},
			{ "name": "20 RC=0x9A (retain not supported)", "msgs": [{"type":"send", "payload":"20 r3 00 9A v0"}]},
			{ "name": "20 RC=0x9B (qos not supported)", "msgs": [{"type":"send", "payload":"20 r3 00 9B v0"}]},
			{ "name": "20 RC=0x9C (use another server)", "msgs": [{"type":"send", "payload":"20 r3 00 9C v0"}]},
			{ "name": "20 RC=0x9D (server moved)", "msgs": [{"type":"send", "payload":"20 r3 00 9D v0"}]},
			{ "name": "20 RC=0x9F (connection rate exceeded)", "msgs": [{"type":"send", "payload":"20 r3 00 9F v0"}]},
			{ "name": "20 RC=0xFF (invalid)", "msgs": [{"type":"send", "payload":"20 r3 00 FF v0"}]}
		]
	},
	{
		"group": "v5.0   CONNACK ALLOWED PROPERTIES VALID",
		"comment": "CMD RL FLAG RC PROPLEN PROPS",
		"ver":5,
		"connack": false,
		"expect_disconnect":false,
		"tests": [
			{ "name": "20 with session-expiry-interval (four byte integer)", "msgs": [{"type":"send", "payload":"20 r8 00 00 v5 11 L1"}]},
			{ "name": "20 with receive-maximum (two byte integer)", "msgs": [{"type":"send", "payload":"20 r6 00 00 v3 21 H5"}]},
			{ "name": "20 with maximum-qos (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 24 i0"}]},
			{ "name": "20 with retain-available (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 25 i0"}]},
			{ "name": "20 with maximum-packet-size (four byte integer)", "msgs": [{"type":"send", "payload":"20 r8 00 00 v5 27 L1"}]},
			{ "name": "20 with maximum-packet-size (four byte integer)", "msgs": [{"type":"send", "payload":"20 r8 00 00 v5 27 L1"}]},
			{ "name": "20 with topic-alias-maximum (two byte integer)", "msgs": [{"type":"send", "payload":"20 r6 00 00 v3 22 H5"}]},
			{ "name": "20 with reason-string property", "msgs": [{"type":"send", "payload":"20 r7 00 00 v4 1F s1 'p'"}]},
			{ "name": "20 with reason-string property empty", "msgs": [{"type":"send", "payload":"20 r6 00 00 v3 1F s0"}]},
			{ "name": "20 with wildcard-subscription-available (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 28 i0"}]},
			{ "name": "20 with subscription-identifier-available (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 29 i0"}]},
			{ "name": "20 with server-keep-alive (two byte integer)", "msgs": [{"type":"send", "payload":"20 r6 00 00 v3 13 H5"}]},
			{ "name": "20 with shared-subscription-available (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 2A i0"}]},
			{ "name": "20 with response-information (UTF-8 string)", "msgs": [{"type":"send", "payload":"20 r7 00 00 v4 1A s1 'p'"}]},
			{ "name": "20 with server-reference (UTF-8 string)", "msgs": [{"type":"send", "payload":"20 r7 00 00 v4 1C s1 'p'"}]},
			{ "name": "20 with authentication-method (UTF-8 string)", "msgs": [{"type":"send", "payload":"20 r7 00 00 v4 15 s1 'p'"}]},
			{ "name": "20 with authentication-data (binary data)", "msgs": [{"type":"send", "payload":"20 r7 00 00 v4 16 s1 'p'"}]},
			{ "name": "20 with user-property", "msgs": [{"type":"send", "payload":"20 r10 00 00 07 26 s1 'p' s1 'q'"}]}
		]
	},
	{
		"group": "v5.0   CONNACK ALLOWED PROPERTIES INVALID",
		"comment": "CMD RL FLAG RC PROPLEN PROPS",
		"ver":5,
		"connack": false,
		"expect_disconnect":true,
		"tests": [
			{ "name": "20 with session-expiry-interval (four byte integer) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 11"}]},
			{ "name": "20 with receive-maximum (two byte integer) 0 value", "msgs": [{"type":"send", "payload":"20 r6 00 00 v3 21 H0"}]},
			{ "name": "20 with receive-maximum (two byte integer) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 21"}]},
			{ "name": "20 with assigned-client-identifier (UTF-8 string)", "msgs": [{"type":"send", "payload":"20 r7 00 00 v4 12 s1 'p'"}]},
			{ "name": "20 with maximum-qos (byte) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 24"}]},
			{ "name": "20 with maximum-qos (byte) 2 value", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 24 i2"}]},
			{ "name": "20 with retain-available (byte) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 25"}]},
			{ "name": "20 with maximum-packet-size (four byte integer) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 27"}]},
			{ "name": "20 with assigned-client-identifier (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 12"}]},
			{ "name": "20 with topic-alias-maximum (two byte integer) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 22"}]},
			{ "name": "20 with reason-string property missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 01 1F"}]},
			{ "name": "20 with wildcard-subscription-available (byte) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 28"}]},
			{ "name": "20 with subscription-identifier-available (byte) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 29"}]},
			{ "name": "20 with server-keep-alive (two byte integer) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 13"}]},
			{ "name": "20 with shared-subscription-available (byte) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 2A"}]},
			{ "name": "20 with response-information (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 01 1A"}]},
			{ "name": "20 with server-reference (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 1C"}]},
			{ "name": "20 with authentication-method (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 15"}]},
			{ "name": "20 with authentication-data (binary data) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 16"}]},
			{ "name": "20 with user-property missing value", "msgs": [{"type":"send", "payload":"20 r7 00 00 04 26 s1 'p'"}]},
			{ "name": "20 with user-property missing key,value", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 26"}]}
		]
	},
	{
		"group": "v5.0   CONNACK DISALLOWED PROPERTIES",
		"comment": "CMD RL FLAG RC PROPLEN PROPS",
		"ver":5,
		"connack": false,
		"tests": [
			{ "name": "20 with payload-format-indicator (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 01 i0"}]},
			{ "name": "20 with request-problem-information (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 17 i0"}]},
			{ "name": "20 with payload-format-indicator (byte) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 01"}]},
			{ "name": "20 with request-problem-information (byte) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 17"}]},
			{ "name": "20 with message-expiry-interval (four byte integer)", "msgs": [{"type":"send", "payload":"20 r8 00 00 v5 02 L1"}]},
			{ "name": "20 with will-delay-interval (four byte integer)", "msgs": [{"type":"send", "payload":"20 r8 00 00 v5 18 L1"}]},
			{ "name": "20 with message-expiry-interval (four byte integer) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 02"}]},
			{ "name": "20 with will-delay-interval (four byte integer) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 18"}]},
			{ "name": "20 with content-type (UTF-8 string)", "msgs": [{"type":"send", "payload":"20 r7 00 00 v4 03 s1 'p'"}]},
			{ "name": "20 with response-topic (UTF-8 string)", "msgs": [{"type":"send", "payload":"20 r7 00 00 v4 08 s1 'p'"}]},
			{ "name": "20 with content-type (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 03"}]},
			{ "name": "20 with response-topic (UTF-8 string) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 08"}]},
			{ "name": "20 with correlation-data (binary data)", "msgs": [{"type":"send", "payload":"20 r7 00 00 v4 09 s1 'p'"}]},
			{ "name": "20 with correlation-data (binary data) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 09"}]},
			{ "name": "20 with subscription-identifier (variable byte integer)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 0B i1"}]},
			{ "name": "20 with subscription-identifier (variable byte integer) missing", "msgs": [{"type":"send", "payload":"20 04 00 00 v1 0B"}]},
			{ "name": "20 with topic-alias (two byte integer)", "msgs": [{"type":"send", "payload":"20 r6 00 00 v3 23 H5"}]},
			{ "name": "20 with topic-alias (two byte integer) missing", "msgs": [{"type":"send", "payload":"20 r4 00 00 v1 23"}]},
			{ "name": "20 with invalid-property 0x00 (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 00 i1"}]},
			{ "name": "20 with unknown-property 0x04 (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 04 i1"}]},
			{ "name": "20 with unknown-property 0x05 (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 05 i1"}]},
			{ "name": "20 with unknown-property 0x06 (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 06 i1"}]},
			{ "name": "20 with unknown-property 0x07 (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 07 i1"}]},
			{ "name": "20 with unknown-property 0x0A (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 0A i1"}]},
			{ "name": "20 with unknown-property 0x0C (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 0C i1"}]},
			{ "name": "20 with unknown-property 0x0D (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 0D i1"}]},
			{ "name": "20 with unknown-property 0x0E (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 0E i1"}]},
			{ "name": "20 with unknown-property 0x0F (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 0F i1"}]},
			{ "name": "20 with unknown-property 0x10 (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 10 i1"}]},
			{ "name": "20 with unknown-property 0x14 (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 14 i1"}]},
			{ "name": "20 with unknown-property 0x1B (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 1B i1"}]},
			{ "name": "20 with unknown-property 0x1D (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 1D i1"}]},
			{ "name": "20 with unknown-property 0x1E (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 1E i1"}]},
			{ "name": "20 with unknown-property 0x20 (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 20 i1"}]},
			{ "name": "20 with unknown-property 0x7F (byte)", "msgs": [{"type":"send", "payload":"20 r5 00 00 v2 7F i1"}]},
			{ "name": "20 with invalid-property 0x8000 (byte)", "msgs": [{"type":"send", "payload":"20 r6 00 00 v3 8000 i1"}]},
			{ "name": "20 with unknown-property 0x8001 (byte)", "msgs": [{"type":"send", "payload":"20 r6 00 00 v3 8001 i1"}]},
			{ "name": "20 with unknown-property 0xFF7F (byte)", "msgs": [{"type":"send", "payload":"20 r6 00 00 v3 FF7F i1"}]},
			{ "name": "20 with unknown-property 0x808001 (byte)", "msgs": [{"type":"send", "payload":"20 r7 00 00 v4 808001 i1"}]},
			{ "name": "20 with unknown-property 0xFFFF7F (byte)", "msgs": [{"type":"send", "payload":"20 r7 00 00 v4 FFFF7F i1"}]},
			{ "name": "20 with unknown-property 0x80808001 (byte)", "msgs": [{"type":"send", "payload":"20 r8 00 00 v5 80808001 i1"}]},
			{ "name": "20 with unknown-property 0xFFFFFF7F (byte)", "msgs": [{"type":"send", "payload":"20 r8 00 00 v5 FFFFFF7F i1"}]}
		]
	}
]
