You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mqtt: the subscribe.reject.missing.packet.id scripts omit the packet id instead of sending id 0 and are not run against the binding #3239
Found while fixing #3216 (PR #3225): subscribe.reject.missing.packet.id (v4 and v5, specs/binding-mqtt.spec) omits the Packet Identifier bytes from the SUBSCRIBE rather than sending Packet Identifier 0, so it does not exercise the case its name describes, and no runtime IT method runs it against the binding. #3225 covers packet id 0 with shouldRejectPacketIdZero. These scripts are left as dead coverage with a misleading name.
Specification statements (to be re-read from the OASIS text before changing the scripts)
MQTT 5.0:
2.2.1 [MQTT-2.2.1-3]: "Each time a Client sends a new SUBSCRIBE, UNSUBSCRIBE,or PUBLISH (where QoS > 0) MQTT Control Packet it MUST assign it a non-zero Packet Identifier that is currently unused".
1.2: "Malformed Packet: A control packet that cannot be parsed according to this specification."
MQTT 3.1.1:
2.3.1 [MQTT-2.3.1-1]: "SUBSCRIBE, UNSUBSCRIBE, and PUBLISH (in cases where QoS > 0) Control Packets MUST contain a non-zero 16-bit Packet Identifier."
A SUBSCRIBE whose Remaining Length is shorter than the Packet Identifier is a different case from id 0: it cannot be parsed, so it is a Malformed Packet (0x81 on MQTT 5, close on 3.1.1). Settle from 4.13.1 which reason code a truncated variable header gets.
Expected
Decide whether the scripts are meant to cover a truncated packet (packet shorter than its Packet Identifier). If so, rename them to say so, fix the Remaining Length so the packet is a truncated SUBSCRIBE rather than one that parses differently, and run them against the binding with the expected reaction.
If they are not meant to, delete them.
Scripts are corrected only where they violate the protocol; do not bend a script to fit current behaviour.
Test plan (test-first)
If kept: script pairs for v5 and v4 in specs/binding-mqtt.spec and the runtime server IT methods in the existing SubscribeIT classes; the first commit holds the failing scripts, or a passing run if the binding already rejects the packet.
Notes
Follow-up from #3216 (PR #3225). Part of the MQTT conformance work under #512.
Activity
test(binding-mqtt): rename subscribe.reject.missing.packet.id to omit…