| -- test_enc_dec_rfc_qname -- |
| domain: "hlr.1234567.imsi" |
| exp: "\3hlr\a1234567\4imsi" |
| res: "\3hlr\a1234567\4imsi" |
| => OK |
| |
| qname: "\3hlr\a1234567\4imsi" |
| exp: "hlr.1234567.imsi" |
| res: "hlr.1234567.imsi" |
| => OK |
| |
| domain: "hlr..imsi" |
| exp: NULL |
| res: NULL |
| => OK |
| |
| domain: "hlr" |
| exp: "\3hlr" |
| res: "\3hlr" |
| => OK |
| |
| qname: "\3hlr" |
| exp: "hlr" |
| res: "hlr" |
| => OK |
| |
| domain: "hlr." |
| exp: NULL |
| res: NULL |
| => OK |
| |
| domain: ".hlr" |
| exp: NULL |
| res: NULL |
| => OK |
| |
| domain: "" |
| exp: NULL |
| res: NULL |
| => OK |
| |
| domain: "123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.12345" |
| exp: "\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\512345" |
| res: "\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\512345" |
| => OK |
| |
| qname: "\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\512345" |
| exp: "123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.12345" |
| res: "123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.12345" |
| => OK |
| |
| domain: "123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.12345toolong" |
| exp: NULL |
| res: NULL |
| => OK |
| |
| qname: "\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\ |
| exp: NULL |
| res: NULL |
| => OK |
| |
| qname: "\3hlr\a1234567\5imsi" |
| exp: NULL |
| res: NULL |
| => OK |
| |
| qname: "\2hlr\a1234567\4imsi" |
| exp: NULL |
| res: NULL |
| => OK |
| |
| qname: "\3hlr\3" |
| exp: NULL |
| res: NULL |
| => OK |
| |
| qname_max_len: 17 |
| qname: "\3hlr\a1234567\4imsi" |
| exp: NULL |
| res: NULL |
| => OK |
| |
| -- test_enc_dec_rfc_header -- |
| header in: |
| .id = 1337 |
| .qr = 0 |
| .opcode = 0 |
| .aa = 0 |
| .tc = 0 |
| .rd = 0 |
| .ra = 0 |
| .z = 0 |
| .rcode = 0 |
| .qdcount = 1 |
| .ancount = 0 |
| .nscount = 0 |
| .arcount = 0 |
| encoded: 05 39 00 00 00 01 00 00 00 00 00 00 |
| header out: |
| .id = 1337 |
| .qr = 0 |
| .opcode = 0 |
| .aa = 0 |
| .tc = 0 |
| .rd = 0 |
| .ra = 0 |
| .z = 0 |
| .rcode = 0 |
| .qdcount = 1 |
| .ancount = 0 |
| .nscount = 0 |
| .arcount = 0 |
| in (hexdump): 39 05 00 00 01 00 00 00 00 00 00 00 |
| out (hexdump): 39 05 00 00 01 00 00 00 00 00 00 00 |
| => OK |
| |
| header in: |
| .id = 42 |
| .qr = 1 |
| .opcode = 2 |
| .aa = 1 |
| .tc = 1 |
| .rd = 1 |
| .ra = 1 |
| .z = 2 |
| .rcode = 3 |
| .qdcount = 1234 |
| .ancount = 1111 |
| .nscount = 2222 |
| .arcount = 3333 |
| encoded: 00 2a 97 a3 04 d2 04 57 08 ae 0d 05 |
| header out: |
| .id = 42 |
| .qr = 1 |
| .opcode = 2 |
| .aa = 1 |
| .tc = 1 |
| .rd = 1 |
| .ra = 1 |
| .z = 2 |
| .rcode = 3 |
| .qdcount = 1234 |
| .ancount = 1111 |
| .nscount = 2222 |
| .arcount = 3333 |
| in (hexdump): 2a 00 97 a3 d2 04 57 04 ae 08 05 0d |
| out (hexdump): 2a 00 97 a3 d2 04 57 04 ae 08 05 0d |
| => OK |
| |
| -- test_enc_dec_rfc_header_einval -- |
| => OK |
| |
| -- test_enc_dec_rfc_question -- |
| question in: |
| .domain = hlr.1234567.imsi |
| .qtype = 255 |
| .qclass = 1 |
| encoded: 03 68 6c 72 07 31 32 33 34 35 36 37 04 69 6d 73 69 00 00 ff 00 01 |
| question out: |
| .domain = hlr.1234567.imsi |
| .qtype = 255 |
| .qclass = 1 |
| => OK |
| |
| question in: |
| .domain = hlr.1234567.imsi |
| .qtype = 1 |
| .qclass = 255 |
| encoded: 03 68 6c 72 07 31 32 33 34 35 36 37 04 69 6d 73 69 00 00 01 00 ff |
| question out: |
| .domain = hlr.1234567.imsi |
| .qtype = 1 |
| .qclass = 255 |
| => OK |
| |
| question in: |
| .domain = hlr.1234567.imsi |
| .qtype = 28 |
| .qclass = 255 |
| encoded: 03 68 6c 72 07 31 32 33 34 35 36 37 04 69 6d 73 69 00 00 1c 00 ff |
| question out: |
| .domain = hlr.1234567.imsi |
| .qtype = 28 |
| .qclass = 255 |
| => OK |
| |
| -- test_enc_dec_rfc_question_null -- |
| => OK |
| |
| -- test_enc_dec_rfc_record -- |
| question in: |
| .domain = hlr.1234567.imsi |
| .type = 1 |
| .class = 1 |
| .ttl = 1234 |
| .rdlength = 9 |
| .rdata = "10.42.2.1" |
| encoded: 03 68 6c 72 07 31 32 33 34 35 36 37 04 69 6d 73 69 00 00 01 00 01 00 00 04 d2 00 09 31 30 2e 34 32 2e 32 2e 31 |
| record_len: 37 |
| question out: |
| .domain = hlr.1234567.imsi |
| .type = 1 |
| .class = 1 |
| .ttl = 1234 |
| .rdlength = 9 |
| .rdata = "10.42.2.1" |
| => OK |
| |
| -- test_result_from_answer -- |
| --- |
| test: IPv4 |
| error: false |
| records: |
| - TXT age=3 |
| - A 42.42.42.42 |
| - TXT port=444 |
| exp: -> ipv4: 23.42.47.11:444 (age=3) (not-last) |
| res: -> ipv4: 23.42.47.11:444 (age=3) (not-last) |
| => OK |
| --- |
| test: IPv6 |
| error: false |
| records: |
| - TXT age=3 |
| - AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00 |
| - TXT port=666 |
| exp: -> ipv6: [1122:3344:5566:7788:99aa:bbcc:ddee:ff00]:666 (age=3) (not-last) |
| res: -> ipv6: [1122:3344:5566:7788:99aa:bbcc:ddee:ff00]:666 (age=3) (not-last) |
| => OK |
| --- |
| test: IPv4 + IPv6 |
| error: false |
| records: |
| - TXT age=3 |
| - A 42.42.42.42 |
| - TXT port=444 |
| - AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00 |
| - TXT port=666 |
| exp: -> ipv4: 23.42.47.11:444 -> ipv6: [1122:3344:5566:7788:99aa:bbcc:ddee:ff00]:666 (age=3) (not-last) |
| res: -> ipv4: 23.42.47.11:444 -> ipv6: [1122:3344:5566:7788:99aa:bbcc:ddee:ff00]:666 (age=3) (not-last) |
| => OK |
| --- |
| test: A twice |
| error: true |
| records: |
| - TXT age=3 |
| - A 42.42.42.42 |
| - TXT port=444 |
| - A 42.42.42.42 |
| DLGLOBAL ERROR 'A' record found twice in mDNS answer |
| => OK |
| --- |
| test: AAAA twice |
| error: true |
| records: |
| - TXT age=3 |
| - AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00 |
| - TXT port=444 |
| - AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00 |
| DLGLOBAL ERROR 'AAAA' record found twice in mDNS answer |
| => OK |
| --- |
| test: invalid TXT: no key/value pair |
| error: true |
| records: |
| - TXT age=3 |
| - AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00 |
| - TXT 12345 |
| DLGLOBAL ERROR failed to decode txt record |
| => OK |
| --- |
| test: age twice |
| error: true |
| records: |
| - TXT age=3 |
| - TXT age=3 |
| DLGLOBAL ERROR duplicate 'TXT' record for 'age' |
| => OK |
| --- |
| test: port as first record |
| error: true |
| records: |
| - TXT port=444 |
| DLGLOBAL ERROR 'TXT' record for 'port' without previous 'A' or 'AAAA' record |
| => OK |
| --- |
| test: port without previous ip record |
| error: true |
| records: |
| - TXT age=3 |
| - TXT port=444 |
| DLGLOBAL ERROR 'TXT' record for 'port' without previous 'A' or 'AAAA' record |
| => OK |
| --- |
| test: invalid TXT: invalid key |
| error: true |
| records: |
| - TXT age=3 |
| - AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00 |
| - TXT hello=world |
| DLGLOBAL ERROR unexpected key 'hello' in TXT record |
| => OK |
| --- |
| test: unexpected record type |
| error: true |
| records: |
| - TXT age=3 |
| - (invalid) |
| DLGLOBAL ERROR unexpected record type |
| => OK |
| --- |
| test: missing record: age |
| error: true |
| records: |
| - A 42.42.42.42 |
| - TXT port=444 |
| DLGLOBAL ERROR missing resource records in mDNS answer |
| => OK |
| --- |
| test: missing record: port for ipv4 |
| error: true |
| records: |
| - TXT age=3 |
| - A 42.42.42.42 |
| DLGLOBAL ERROR missing resource records in mDNS answer |
| => OK |
| --- |
| test: missing record: port for ipv4 #2 |
| error: true |
| records: |
| - TXT age=3 |
| - AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00 |
| - TXT port=666 |
| - A 42.42.42.42 |
| DLGLOBAL ERROR missing resource records in mDNS answer |
| => OK |