]> git.gsnw.org Git - fping.git/commitdiff
Add longer test for -Q SECS
authorErik Auerswald <auerswal@unix-ag.uni-kl.de>
Mon, 8 Jan 2024 08:15:04 +0000 (09:15 +0100)
committerDavid Schweikert <david@schweikert.ch>
Mon, 8 Jan 2024 09:22:01 +0000 (10:22 +0100)
The statistics printed every SECS seconds show the results
since the the last report, not since the beginning.  Also,
every report starts with a timestamp.

ci/test-08-options-n-q.pl

index 51720bf1ab216895161d8913a80ef8b0d6a0b46f..fe2bfab6d88d08b80ad826bf2618cdfc406d8aee 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-use Test::Command tests => 18;
+use Test::Command tests => 21;
 
 #  -n         show targets by name (-d is equivalent)
 #  -O n       set the type of service (tos) flag on the ICMP packets
@@ -68,4 +68,17 @@ $cmd->stderr_like(qr{\[\d+:\d+:\d+\]
 });
 }
 
+# fping -Q (longer test to show two time stamps and reset statistics)
+{
+my $cmd = Test::Command->new(cmd => "fping -Q 1 -p 550 -c 5 127.0.0.1");
+$cmd->exit_is_num(0);
+$cmd->stdout_is_eq("");
+$cmd->stderr_like(qr{\[\d+:\d+:\d+\]
+127\.0\.0\.1 : xmt/rcv/%loss = 2/2/0%, min/avg/max = \d\.\d+/\d\.\d+/\d\.\d+
+\[\d+:\d+:\d+\]
+127\.0\.0\.1 : xmt/rcv/%loss = 2/2/0%, min/avg/max = \d\.\d+/\d\.\d+/\d\.\d+
+127\.0\.0\.1 : xmt/rcv/%loss = 5/5/0%, min/avg/max = \d\.\d+/\d\.\d+/\d\.\d+
+});
+}
+