diff options
author | ghciv6 <ghciv6@localhost> | 2021-12-20 22:39:57 +0000 |
---|---|---|
committer | Sven Nierlein <sven@nierlein.org> | 2022-01-29 12:19:23 +0100 |
commit | 986b2479465648c49a7eefc3fbf4df8860e3e4b7 (patch) | |
tree | 51fdf3d530752053cd8be76120249f77c5e540d9 /plugins-root/t/check_icmp.t | |
parent | ee2a60fc4e26828b115051564706f8fbc4c4b153 (diff) | |
download | monitoring-plugins-986b2479465648c49a7eefc3fbf4df8860e3e4b7.tar.gz |
- delay set_source_ip() until address_family is detected
- add a test to check '-s'
Diffstat (limited to 'plugins-root/t/check_icmp.t')
-rw-r--r-- | plugins-root/t/check_icmp.t | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins-root/t/check_icmp.t b/plugins-root/t/check_icmp.t index e043d4ed..55edc31b 100644 --- a/plugins-root/t/check_icmp.t +++ b/plugins-root/t/check_icmp.t | |||
@@ -12,7 +12,7 @@ my $allow_sudo = getTestParameter( "NP_ALLOW_SUDO", | |||
12 | "no" ); | 12 | "no" ); |
13 | 13 | ||
14 | if ($allow_sudo eq "yes" or $> == 0) { | 14 | if ($allow_sudo eq "yes" or $> == 0) { |
15 | plan tests => 16; | 15 | plan tests => 18; |
16 | } else { | 16 | } else { |
17 | plan skip_all => "Need sudo to test check_icmp"; | 17 | plan skip_all => "Need sudo to test check_icmp"; |
18 | } | 18 | } |
@@ -83,3 +83,9 @@ $res = NPTest->testCmd( | |||
83 | is( $res->return_code, 2, "One of two host nonresponsive - two required" ); | 83 | is( $res->return_code, 2, "One of two host nonresponsive - two required" ); |
84 | like( $res->output, $failureOutput, "Output OK" ); | 84 | like( $res->output, $failureOutput, "Output OK" ); |
85 | 85 | ||
86 | $res = NPTest->testCmd( | ||
87 | "$sudo ./check_icmp -H $host_responsive -s 127.0.15.15 -w 10000ms,100% -c 10000ms,100% -n 1 -m 2" | ||
88 | ); | ||
89 | is( $res->return_code, 0, "IPv4 source_ip accepted" ); | ||
90 | like( $res->output, $successOutput, "Output OK" ); | ||
91 | |||