File: 81-timeout.t

package info (click to toggle)
libnet-traceroute-perl 1.15-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 276 kB
  • sloc: perl: 957; sh: 25; makefile: 4
file content (32 lines) | stat: -rwxr-xr-x 620 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/perl

# Test the timeout functionality of the pipe interface.
# Uses a helper that spews traceroute output, but then waits.

use strict;
use warnings;

use Test::More;
use Net::Traceroute;
use Time::HiRes qw(time);
require "t/testlib.pl";

os_must_unixexec();
plan tests => 2;

my $start = time();

my $tr = Net::Traceroute->new(
   trace_program => "./t/waitroute",
   host => "128.52.32.80",
   timeout => 2,
   );

my $end = time();
my $delta = $end - $start;

TODO: {
    todo_skip "Test borked", 1;
    is($tr->stat(), TRACEROUTE_TIMEOUT, "Stat is TIMEOUT");
}
ok($delta < 3, "elapsed time $delta < 3");