From: Jason Ish Date: Wed, 21 Dec 2022 15:01:15 +0000 (-0600) Subject: dns: mark test buffers with rustfmt::skip X-Git-Tag: suricata-6.0.13~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66b36f4de167ee9892ec83de35b9d63227199f99;p=thirdparty%2Fsuricata.git dns: mark test buffers with rustfmt::skip (cherry picked from commit 39d2524bf6d57658b532c73ceb4def34ed9e2c8a) --- diff --git a/rust/src/dns/dns.rs b/rust/src/dns/dns.rs index ace6d0a394..ee00986588 100644 --- a/rust/src/dns/dns.rs +++ b/rust/src/dns/dns.rs @@ -1200,6 +1200,7 @@ mod tests { fn test_dns_parse_request_tcp_valid() { // A UDP DNS request with the DNS payload starting at byte 42. // From pcap: https://github.com/jasonish/suricata-verify/blob/7cc0e1bd0a5249b52e6e87d82d57c0b6aaf75fce/dns-udp-dig-a-www-suricata-ids-org/dig-a-www.suricata-ids.org.pcap + #[rustfmt::skip] let buf: &[u8] = &[ 0x00, 0x15, 0x17, 0x0d, 0x06, 0xf7, 0xd8, 0xcb, /* ........ */ 0x8a, 0xed, 0xa1, 0x46, 0x08, 0x00, 0x45, 0x00, /* ...F..E. */ @@ -1235,6 +1236,7 @@ mod tests { fn test_dns_parse_request_tcp_short_payload() { // A UDP DNS request with the DNS payload starting at byte 42. // From pcap: https://github.com/jasonish/suricata-verify/blob/7cc0e1bd0a5249b52e6e87d82d57c0b6aaf75fce/dns-udp-dig-a-www-suricata-ids-org/dig-a-www.suricata-ids.org.pcap + #[rustfmt::skip] let buf: &[u8] = &[ 0x00, 0x15, 0x17, 0x0d, 0x06, 0xf7, 0xd8, 0xcb, /* ........ */ 0x8a, 0xed, 0xa1, 0x46, 0x08, 0x00, 0x45, 0x00, /* ...F..E. */ @@ -1271,6 +1273,7 @@ mod tests { fn test_dns_parse_response_tcp_valid() { // A UDP DNS response with the DNS payload starting at byte 42. // From pcap: https://github.com/jasonish/suricata-verify/blob/7cc0e1bd0a5249b52e6e87d82d57c0b6aaf75fce/dns-udp-dig-a-www-suricata-ids-org/dig-a-www.suricata-ids.org.pcap + #[rustfmt::skip] let buf: &[u8] = &[ 0xd8, 0xcb, 0x8a, 0xed, 0xa1, 0x46, 0x00, 0x15, /* .....F.. */ 0x17, 0x0d, 0x06, 0xf7, 0x08, 0x00, 0x45, 0x00, /* ......E. */ @@ -1314,6 +1317,7 @@ mod tests { fn test_dns_parse_response_tcp_short_payload() { // A UDP DNS response with the DNS payload starting at byte 42. // From pcap: https://github.com/jasonish/suricata-verify/blob/7cc0e1bd0a5249b52e6e87d82d57c0b6aaf75fce/dns-udp-dig-a-www-suricata-ids-org/dig-a-www.suricata-ids.org.pcap + #[rustfmt::skip] let buf: &[u8] = &[ 0xd8, 0xcb, 0x8a, 0xed, 0xa1, 0x46, 0x00, 0x15, /* .....F.. */ 0x17, 0x0d, 0x06, 0xf7, 0x08, 0x00, 0x45, 0x00, /* ......E. */ @@ -1359,6 +1363,7 @@ mod tests { * TTL: 86400 * serial 20130422 refresh 28800 retry 7200 exp 604800 min ttl 86400 * ns, hostmaster */ + #[rustfmt::skip] let buf: &[u8] = &[ 0x00, 0x3c, 0x85, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x61, 0x62, 0x63, @@ -1379,6 +1384,7 @@ mod tests { // Port of the C RustDNSUDPParserTest02 unit test. #[test] fn test_dns_udp_parser_test_02() { + #[rustfmt::skip] let buf: &[u8] = &[ 0x6D,0x08,0x84,0x80,0x00,0x01,0x00,0x08,0x00,0x00,0x00,0x01,0x03,0x57,0x57,0x57, 0x04,0x54,0x54,0x54,0x54,0x03,0x56,0x56,0x56,0x03,0x63,0x6F,0x6D,0x02,0x79,0x79, @@ -1398,6 +1404,7 @@ mod tests { // Port of the C RustDNSUDPParserTest03 unit test. #[test] fn test_dns_udp_parser_test_03() { + #[rustfmt::skip] let buf: &[u8] = &[ 0x6F,0xB4,0x84,0x80,0x00,0x01,0x00,0x02,0x00,0x02,0x00,0x03,0x03,0x57,0x57,0x77, 0x0B,0x56,0x56,0x56,0x56,0x56,0x56,0x56,0x56,0x56,0x56,0x56,0x03,0x55,0x55,0x55, @@ -1419,6 +1426,7 @@ mod tests { // Test the TXT records in an answer. #[test] fn test_dns_udp_parser_test_04() { + #[rustfmt::skip] let buf: &[u8] = &[ 0xc2,0x2f,0x81,0x80,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x0a,0x41,0x41,0x41, 0x41,0x41,0x4f,0x31,0x6b,0x51,0x41,0x05,0x3d,0x61,0x75,0x74,0x68,0x03,0x73,0x72, @@ -1442,6 +1450,7 @@ mod tests { // Test TXT records in answer with a bad length. #[test] fn test_dns_udp_parser_test_05() { + #[rustfmt::skip] let buf: &[u8] = &[ 0xc2,0x2f,0x81,0x80,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x0a,0x41,0x41,0x41, 0x41,0x41,0x4f,0x31,0x6b,0x51,0x41,0x05,0x3d,0x61,0x75,0x74,0x68,0x03,0x73,0x72, @@ -1463,6 +1472,7 @@ mod tests { // Port of the C RustDNSTCPParserTestMultiRecord unit test. #[test] fn test_dns_tcp_parser_multi_record() { + #[rustfmt::skip] let buf: &[u8] = &[ 0x00, 0x1e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30, @@ -1557,11 +1567,13 @@ mod tests { #[test] fn test_dns_tcp_parser_split_payload() { /* incomplete payload */ + #[rustfmt::skip] let buf1: &[u8] = &[ 0x00, 0x1c, 0x10, 0x32, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]; /* complete payload plus the start of a new payload */ + #[rustfmt::skip] let buf2: &[u8] = &[ 0x00, 0x1c, 0x10, 0x32, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1574,6 +1586,7 @@ mod tests { ]; /* and the complete payload again with no trailing data. */ + #[rustfmt::skip] let buf3: &[u8] = &[ 0x00, 0x1c, 0x10, 0x32, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,