diff options
Diffstat (limited to 'mqtt-tester/src/behaviour/invalid_utf8_is_rejected.rs')
-rw-r--r-- | mqtt-tester/src/behaviour/invalid_utf8_is_rejected.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mqtt-tester/src/behaviour/invalid_utf8_is_rejected.rs b/mqtt-tester/src/behaviour/invalid_utf8_is_rejected.rs index eea0fa5..efe7a6d 100644 --- a/mqtt-tester/src/behaviour/invalid_utf8_is_rejected.rs +++ b/mqtt-tester/src/behaviour/invalid_utf8_is_rejected.rs @@ -10,6 +10,7 @@ use crate::{ behaviour_test::BehaviourTest, command::{Input, Output}, executable::ClientExecutableCommand, + report::ReportResult, }; pub struct InvalidUtf8IsRejected; @@ -44,4 +45,24 @@ impl BehaviourTest for InvalidUtf8IsRejected { .await?; Ok(()) } + + fn report_name(&self) -> &str { + "Check if invalid UTF-8 is rejected" + } + + fn report_desc(&self) -> &str { + "Invalid UTF-8 is not allowed per the MQTT spec. Any receiver should immediately close the connection upon receiving such a packet." + } + + fn report_normative(&self) -> &str { + "[MQTT-1.5.3-1, MQTT-1.5.3-2]" + } + + fn translate_client_exit_code(&self, success: bool) -> ReportResult { + if success { + ReportResult::Failure + } else { + ReportResult::Success + } + } } |