"Fossies" - the Fresh Open Source Software Archive

Member "fping-5.1/ci/test-15-netdata.pl" (6 Feb 2022, 1077 Bytes) of package /linux/misc/fping-5.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test-15-netdata.pl": 5.0_vs_5.1.

    1 #!/usr/bin/perl -w
    2 
    3 use Test::Command;
    4 use Test::More;
    5 
    6 plan tests => 3;
    7 
    8 # fping
    9 {
   10 my $cmd = Test::Command->new(cmd => "fping -c 2 -Q 1 -N 127.0.0.1");
   11 $cmd->exit_is_num(0);
   12 $cmd->stdout_like(qr{CHART fping\.127_0_0_1_packets '' 'FPing Packets for host 127\.0\.0\.1' packets '127.0.0.1' fping\.packets line 110020 1
   13 DIMENSION xmt sent absolute 1 1
   14 DIMENSION rcv received absolute 1 1
   15 BEGIN fping\.127_0_0_1_packets
   16 SET xmt = 1
   17 SET rcv = 1
   18 END
   19 CHART fping\.127_0_0_1_quality '' 'FPing Quality for host 127\.0\.0\.1' percentage '127.0.0.1' fping\.quality area 110010 1
   20 DIMENSION returned '' absolute 1 1
   21 BEGIN fping\.127_0_0_1_quality
   22 SET returned = 100
   23 END
   24 CHART fping\.127_0_0_1_latency '' 'FPing Latency for host 127\.0\.0\.1' ms '127.0.0.1' fping\.latency area 110000 1
   25 DIMENSION min minimum absolute 1 1000000
   26 DIMENSION max maximum absolute 1 1000000
   27 DIMENSION avg average absolute 1 1000000
   28 BEGIN fping\.127_0_0_1_latency
   29 SET min = \d+
   30 SET avg = \d+
   31 SET max = \d+
   32 END}
   33 );
   34 $cmd->stderr_like(qr{127.0.0.1 : xmt/rcv/%loss = 2/2/0%, min/avg/max = \d\.\d+/\d\.\d+/\d\.\d+});
   35 }