Better test packet logging & validation

Summary:
related to T12015, T11798
- improved packet logging in test broker for easier debugging
- test broker will fail the test if a packet is sent after all the messages were exchanged
- fixed a bug in assemble_op where read buffer was not properly cleared if an error occurred (for example, malformed packet cases)

Reviewers: ivica

Reviewed By: ivica

Subscribers: iljazovic, miljen

Differential Revision: https://repo.mireo.local/D27561
This commit is contained in:
Korina Šimičević
2024-01-25 13:43:59 +01:00
parent 61f17f6e0f
commit 4bf59cc18c
7 changed files with 307 additions and 69 deletions

View File

@@ -197,8 +197,8 @@ private:
return perform(wait_for, asio::transfer_at_least(0));
bool is_reply = code != control_code_e::publish &&
code != control_code_e::auth &&
code != control_code_e::disconnect;
code != control_code_e::auth &&
code != control_code_e::disconnect;
if (is_reply) {
auto packet_id = decoders::decode_packet_id(first).value();
@@ -213,6 +213,8 @@ private:
error_code ec, uint8_t control_code,
byte_citer first, byte_citer last
) {
if (ec)
_data_span = { _read_buff.cend(), _read_buff.cend() };
std::move(_handler)(ec, control_code, first, last);
}
};