From 4753437b17174bcc2058d92528c2d3e195ee6007 Mon Sep 17 00:00:00 2001 From: Erik Auerswald Date: Mon, 8 Jan 2024 09:15:04 +0100 Subject: [PATCH] Add longer test for -Q SECS 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 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ci/test-08-options-n-q.pl b/ci/test-08-options-n-q.pl index 51720bf..fe2bfab 100755 --- a/ci/test-08-options-n-q.pl +++ b/ci/test-08-options-n-q.pl @@ -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+ +}); +} +