File: dns.t

package info (click to toggle)
libio-stream-perl 2.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 332 kB
  • sloc: perl: 775; makefile: 7
file content (34 lines) | stat: -rw-r--r-- 712 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# DNS error.
use warnings;
use strict;
use lib 't';
use share;

@CheckPoint = (
    {
        normal => [
            [ 'client', 0,          IO::Stream::EDNS    ], 'no such host',
        ],
        misconfigured => [ # some systems are configured to resolve anything, just deal with it!
            [ 'client', RESOLVED,   undef               ], 'resolve junk',
        ],
    },
);
plan skip_all => 'Network connection';

IO::Stream->new({
    host        => 'no.such.host.q1w2e3',
    port        => 80,
    cb          => \&client,
    wait_for    => IN|EOF|OUT|SENT|CONNECTED|RESOLVED,
});

EV::loop;

sub client {
    my ($io, $e, $err) = @_;
  # &diag_event;
    checkpoint($e, $err);
    EV::unloop;
}