From 3838e90154b0ae314b9e5803d7c2f58e72c95eaf Mon Sep 17 00:00:00 2001 From: Martin Topholm Date: Sat, 3 Sep 2016 20:47:18 +0200 Subject: [PATCH] Added tests -g for long prefixes Expanded tests for -g option to hopefully cover both long prefixes and too long prefixes. --- ci/test-06-options-f-h.pl | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ci/test-06-options-f-h.pl b/ci/test-06-options-f-h.pl index 8b252cc..b5eaac5 100755 --- a/ci/test-06-options-f-h.pl +++ b/ci/test-06-options-f-h.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -use Test::Command tests => 18; +use Test::Command tests => 24; use File::Temp; # -f file read list of targets from a file ( - means stdin) (only if no -g specified) @@ -53,6 +53,22 @@ $cmd->stdout_is_eq("127.0.0.1 is alive\n127.0.0.2 is alive\n"); $cmd->stderr_is_eq(""); } +# fping -g (cidr - long prefixes) +{ +my $cmd = Test::Command->new(cmd => "fping -g 127.0.0.2/31"); +$cmd->exit_is_num(0); +$cmd->stdout_is_eq("127.0.0.2 is alive\n127.0.0.3 is alive\n"); +$cmd->stderr_is_eq(""); +} + +# fping -g (cidr - too long prefixes) +{ +my $cmd = Test::Command->new(cmd => "fping -g 127.0.0.2/33"); +$cmd->exit_is_num(1); +$cmd->stdout_is_eq(""); +$cmd->stderr_is_eq("Error: netmask must be between 1 and 32 (is: 33)\n"); +} + # fping -H { my $cmd = Test::Command->new(cmd => "fping -H 1 127.0.0.1");