blob: 0d650be26d33d7bcaaf5f16ca588b6a55ccd88be [file] [log] [blame]
Oliver Smith3a9f2672019-11-20 10:56:35 +01001-- test_enc_dec_rfc_header --
2header in:
3.id = 1337
4.qr = 0
5.opcode = 0
6.aa = 0
7.tc = 0
8.rd = 0
9.ra = 0
10.z = 0
11.rcode = 0
12.qdcount = 1
13.ancount = 0
14.nscount = 0
15.arcount = 0
16encoded: 05 39 00 00 00 01 00 00 00 00 00 00
17header out:
18.id = 1337
19.qr = 0
20.opcode = 0
21.aa = 0
22.tc = 0
23.rd = 0
24.ra = 0
25.z = 0
26.rcode = 0
27.qdcount = 1
28.ancount = 0
29.nscount = 0
30.arcount = 0
31in (hexdump): 39 05 00 00 01 00 00 00 00 00 00 00
32out (hexdump): 39 05 00 00 01 00 00 00 00 00 00 00
33=> OK
34
35header in:
36.id = 42
37.qr = 1
38.opcode = 2
39.aa = 1
40.tc = 1
41.rd = 1
42.ra = 1
43.z = 2
44.rcode = 3
45.qdcount = 1234
46.ancount = 1111
47.nscount = 2222
48.arcount = 3333
49encoded: 00 2a 97 a3 04 d2 04 57 08 ae 0d 05
50header out:
51.id = 42
52.qr = 1
53.opcode = 2
54.aa = 1
55.tc = 1
56.rd = 1
57.ra = 1
58.z = 2
59.rcode = 3
60.qdcount = 1234
61.ancount = 1111
62.nscount = 2222
63.arcount = 3333
64in (hexdump): 2a 00 97 a3 d2 04 57 04 ae 08 05 0d
65out (hexdump): 2a 00 97 a3 d2 04 57 04 ae 08 05 0d
66=> OK
67
68-- test_enc_dec_rfc_header_einval --
69=> OK
70
71-- test_enc_dec_rfc_question --
72question in:
73.domain = hlr.1234567.imsi
74.qtype = 255
75.qclass = 1
76encoded: 03 68 6c 72 07 31 32 33 34 35 36 37 04 69 6d 73 69 00 00 ff 00 01
77question out:
78.domain = hlr.1234567.imsi
79.qtype = 255
80.qclass = 1
81=> OK
82
83question in:
84.domain = hlr.1234567.imsi
85.qtype = 1
86.qclass = 255
87encoded: 03 68 6c 72 07 31 32 33 34 35 36 37 04 69 6d 73 69 00 00 01 00 ff
88question out:
89.domain = hlr.1234567.imsi
90.qtype = 1
91.qclass = 255
92=> OK
93
94question in:
95.domain = hlr.1234567.imsi
96.qtype = 28
97.qclass = 255
98encoded: 03 68 6c 72 07 31 32 33 34 35 36 37 04 69 6d 73 69 00 00 1c 00 ff
99question out:
100.domain = hlr.1234567.imsi
101.qtype = 28
102.qclass = 255
103=> OK
104
105-- test_enc_dec_rfc_question_null --
106=> OK
107
108-- test_enc_dec_rfc_record --
109question in:
110.domain = hlr.1234567.imsi
111.type = 1
112.class = 1
113.ttl = 1234
114.rdlength = 9
115.rdata = "10.42.2.1"
116encoded: 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
117record_len: 37
118question out:
119.domain = hlr.1234567.imsi
120.type = 1
121.class = 1
122.ttl = 1234
123.rdlength = 9
124.rdata = "10.42.2.1"
125=> OK
126
127-- test_result_from_answer --
128---
129test: IPv4
130error: false
131records:
132- TXT age=3
133- A 42.42.42.42
134- TXT port=444
135exp: -> ipv4: 23.42.47.11:444 (age=3) (not-last)
136res: -> ipv4: 23.42.47.11:444 (age=3) (not-last)
137=> OK
138---
139test: IPv6
140error: false
141records:
142- TXT age=3
143- AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00
144- TXT port=666
145exp: -> ipv6: [1122:3344:5566:7788:99aa:bbcc:ddee:ff00]:666 (age=3) (not-last)
146res: -> ipv6: [1122:3344:5566:7788:99aa:bbcc:ddee:ff00]:666 (age=3) (not-last)
147=> OK
148---
149test: IPv4 + IPv6
150error: false
151records:
152- TXT age=3
153- A 42.42.42.42
154- TXT port=444
155- AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00
156- TXT port=666
157exp: -> ipv4: 23.42.47.11:444 -> ipv6: [1122:3344:5566:7788:99aa:bbcc:ddee:ff00]:666 (age=3) (not-last)
158res: -> ipv4: 23.42.47.11:444 -> ipv6: [1122:3344:5566:7788:99aa:bbcc:ddee:ff00]:666 (age=3) (not-last)
159=> OK
160---
161test: A twice
162error: true
163records:
164- TXT age=3
165- A 42.42.42.42
166- TXT port=444
167- A 42.42.42.42
168DLGLOBAL ERROR 'A' record found twice in mDNS answer
169=> OK
170---
171test: AAAA twice
172error: true
173records:
174- TXT age=3
175- AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00
176- TXT port=444
177- AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00
178DLGLOBAL ERROR 'AAAA' record found twice in mDNS answer
179=> OK
180---
181test: invalid TXT: no key/value pair
182error: true
183records:
184- TXT age=3
185- AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00
186- TXT 12345
187DLGLOBAL ERROR failed to decode txt record
188=> OK
189---
190test: age twice
191error: true
192records:
193- TXT age=3
194- TXT age=3
195DLGLOBAL ERROR duplicate 'TXT' record for 'age'
196=> OK
197---
198test: port as first record
199error: true
200records:
201- TXT port=444
202DLGLOBAL ERROR 'TXT' record for 'port' without previous 'A' or 'AAAA' record
203=> OK
204---
205test: port without previous ip record
206error: true
207records:
208- TXT age=3
209- TXT port=444
210DLGLOBAL ERROR 'TXT' record for 'port' without previous 'A' or 'AAAA' record
211=> OK
212---
213test: invalid TXT: invalid key
214error: true
215records:
216- TXT age=3
217- AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00
218- TXT hello=world
219DLGLOBAL ERROR unexpected key 'hello' in TXT record
220=> OK
221---
222test: unexpected record type
223error: true
224records:
225- TXT age=3
226- (invalid)
227DLGLOBAL ERROR unexpected record type
228=> OK
229---
230test: missing record: age
231error: true
232records:
233- A 42.42.42.42
234- TXT port=444
235DLGLOBAL ERROR missing resource records in mDNS answer
236=> OK
237---
238test: missing record: port for ipv4
239error: true
240records:
241- TXT age=3
242- A 42.42.42.42
243DLGLOBAL ERROR missing resource records in mDNS answer
244=> OK
245---
246test: missing record: port for ipv4 #2
247error: true
248records:
249- TXT age=3
250- AAAA 1122:3344:5566:7788:99aa:bbcc:ddee:ff00
251- TXT port=666
252- A 42.42.42.42
253DLGLOBAL ERROR missing resource records in mDNS answer
254=> OK