Skip to content

Commit 5b95d93

Browse files
committed
Tests: replaced underscores with hyphens in resolver tests.
Using underscore in domain name labels is invalid.
1 parent 760d3e7 commit 5b95d93

File tree

2 files changed

+62
-62
lines changed

2 files changed

+62
-62
lines changed

http_resolver.t

+9-9
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ like(http_host_header('cname.example.net', '/'), qr/200 OK/,
152152
# CNAME + A combined answer
153153
# demonstrates the name in answer section different from what is asked
154154

155-
like(http_host_header('cname_a.example.net', '/'), qr/200 OK/, 'CNAME + A');
155+
like(http_host_header('cname-a.example.net', '/'), qr/200 OK/, 'CNAME + A');
156156

157157
# CNAME refers to non-existing A
158158

@@ -247,11 +247,11 @@ like(http_host_header('ttl.example.net', '/valid'), qr/502 Bad/,
247247
# When ttl in CNAME is expired, the answer should not be served from cache.
248248
# Catch this by returning SERVFAIL on the 2nd and subsequent queries.
249249

250-
http_host_header('cname_a_ttl2.example.net', '/');
250+
http_host_header('cname-a-ttl2.example.net', '/');
251251

252252
sleep 2;
253253

254-
like(http_host_header('cname_a_ttl2.example.net', '/'), qr/502 Bad/,
254+
like(http_host_header('cname-a-ttl2.example.net', '/'), qr/502 Bad/,
255255
'CNAME + A with expired CNAME ttl');
256256

257257
like(http_host_header('example.net', '/invalid'), qr/502 Bad/, 'no resolver');
@@ -265,7 +265,7 @@ my $s2 = http_get('/bad', start => 1);
265265
http_end($s);
266266
ok(http_end($s2), 'timeout handler on 2nd request');
267267

268-
like(http_host_header('fe_id.example.net', '/'), qr/502 Bad/, 'format error');
268+
like(http_host_header('fe-id.example.net', '/'), qr/502 Bad/, 'format error');
269269

270270
# several requests waiting on same name query
271271
# 1st request aborts before name is resolved
@@ -356,7 +356,7 @@ sub reply_handler {
356356

357357
push @rdata, rd_addr($ttl, '127.0.0.1');
358358

359-
} elsif ($name eq 'fe_id.example.net' && $type == A) {
359+
} elsif ($name eq 'fe-id.example.net' && $type == A) {
360360
$id = 42;
361361
$rcode = FORMERR;
362362

@@ -421,7 +421,7 @@ sub reply_handler {
421421
select undef, undef, undef, 2.1;
422422
return;
423423

424-
} elsif ($name eq 'cname_a.example.net') {
424+
} elsif ($name eq 'cname-a.example.net') {
425425
push @rdata, pack("n3N nCa5n", 0xc00c, CNAME, IN, $ttl,
426426
8, 5, 'alias', 0xc014);
427427

@@ -432,16 +432,16 @@ sub reply_handler {
432432
4, split(/\./, '127.0.0.1'));
433433
}
434434

435-
} elsif ($name eq 'cname_a_ttl2.example.net' && $type == A) {
435+
} elsif ($name eq 'cname-a-ttl2.example.net' && $type == A) {
436436
push @rdata, pack("n3N nCa18n", 0xc00c, CNAME, IN, 1,
437-
21, 18, 'cname_a_ttl2_alias', 0xc019);
437+
21, 18, 'cname-a-ttl2-alias', 0xc019);
438438
if (++$state->{cttl2cnt} >= 2) {
439439
$rcode = SERVFAIL;
440440
}
441441
push @rdata, pack('n3N nC4', 0xc036, A, IN, $ttl,
442442
4, split(/\./, '127.0.0.1'));
443443

444-
} elsif ($name eq 'cname_a_ttl_alias.example.net' && $type == A) {
444+
} elsif ($name eq 'cname-a-ttl-alias.example.net' && $type == A) {
445445
push @rdata, rd_addr($ttl, '127.0.0.1');
446446

447447
} elsif ($name eq 'cname2.example.net') {

0 commit comments

Comments
 (0)