summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2022-01-03 15:36:15 +0100
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2022-03-15 21:04:32 +0100
commit652eadd72e901cd536f386504fe4cab0983480d0 (patch)
tree9a9c6d6caa9728c584147aff1ad3e0b3ab3719e4
parentb2a609a14edd67187a36f8cd175f1aaf25ea7dac (diff)
downloadmonitoring-plugins-652eadd.tar.gz
Remove check numbering
-rw-r--r--plugins-root/t/check_icmp.t10
1 files changed, 0 insertions, 10 deletions
diff --git a/plugins-root/t/check_icmp.t b/plugins-root/t/check_icmp.t
index 1a755866..98ef966d 100644
--- a/plugins-root/t/check_icmp.t
+++ b/plugins-root/t/check_icmp.t
@@ -39,63 +39,54 @@ my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
39 39
40my $res; 40my $res;
41 41
42# 1
43$res = NPTest->testCmd( 42$res = NPTest->testCmd(
44 "$sudo ./check_icmp -H $host_responsive -w 10000ms,100% -c 10000ms,100%" 43 "$sudo ./check_icmp -H $host_responsive -w 10000ms,100% -c 10000ms,100%"
45 ); 44 );
46is( $res->return_code, 0, "Syntax ok" ); 45is( $res->return_code, 0, "Syntax ok" );
47like( $res->output, $successOutput, "Output OK" ); 46like( $res->output, $successOutput, "Output OK" );
48 47
49# 2
50$res = NPTest->testCmd( 48$res = NPTest->testCmd(
51 "$sudo ./check_icmp -H $host_responsive -w 0ms,0% -c 10000ms,100%" 49 "$sudo ./check_icmp -H $host_responsive -w 0ms,0% -c 10000ms,100%"
52 ); 50 );
53is( $res->return_code, 1, "Syntax ok, with forced warning" ); 51is( $res->return_code, 1, "Syntax ok, with forced warning" );
54like( $res->output, $failureOutput, "Output OK" ); 52like( $res->output, $failureOutput, "Output OK" );
55 53
56# 3
57$res = NPTest->testCmd( 54$res = NPTest->testCmd(
58 "$sudo ./check_icmp -H $host_responsive -w 0,0% -c 0,0%" 55 "$sudo ./check_icmp -H $host_responsive -w 0,0% -c 0,0%"
59 ); 56 );
60is( $res->return_code, 2, "Syntax ok, with forced critical" ); 57is( $res->return_code, 2, "Syntax ok, with forced critical" );
61like( $res->output, $failureOutput, "Output OK" ); 58like( $res->output, $failureOutput, "Output OK" );
62 59
63# 4
64$res = NPTest->testCmd( 60$res = NPTest->testCmd(
65 "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100%" 61 "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100%"
66 ); 62 );
67is( $res->return_code, 2, "Timeout - host nonresponsive" ); 63is( $res->return_code, 2, "Timeout - host nonresponsive" );
68like( $res->output, '/100%/', "Error contains '100%' string (for 100% packet loss)" ); 64like( $res->output, '/100%/', "Error contains '100%' string (for 100% packet loss)" );
69 65
70# 4
71$res = NPTest->testCmd( 66$res = NPTest->testCmd(
72 "$sudo ./check_icmp -w 10000ms,100% -c 10000ms,100%" 67 "$sudo ./check_icmp -w 10000ms,100% -c 10000ms,100%"
73 ); 68 );
74is( $res->return_code, 3, "No hostname" ); 69is( $res->return_code, 3, "No hostname" );
75like( $res->output, '/No hosts to check/', "Output with appropriate error message"); 70like( $res->output, '/No hosts to check/', "Output with appropriate error message");
76 71
77# 5
78$res = NPTest->testCmd( 72$res = NPTest->testCmd(
79 "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 0" 73 "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 0"
80 ); 74 );
81is( $res->return_code, 0, "One host nonresponsive - zero required" ); 75is( $res->return_code, 0, "One host nonresponsive - zero required" );
82like( $res->output, $successOutput, "Output OK" ); 76like( $res->output, $successOutput, "Output OK" );
83 77
84# 6
85$res = NPTest->testCmd( 78$res = NPTest->testCmd(
86 "$sudo ./check_icmp -H $host_responsive -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 1" 79 "$sudo ./check_icmp -H $host_responsive -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 1"
87 ); 80 );
88is( $res->return_code, 0, "One of two host nonresponsive - one required" ); 81is( $res->return_code, 0, "One of two host nonresponsive - one required" );
89like( $res->output, $successOutput, "Output OK" ); 82like( $res->output, $successOutput, "Output OK" );
90 83
91# 7
92$res = NPTest->testCmd( 84$res = NPTest->testCmd(
93 "$sudo ./check_icmp -H $host_responsive -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 2" 85 "$sudo ./check_icmp -H $host_responsive -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 2"
94 ); 86 );
95is( $res->return_code, 2, "One of two host nonresponsive - two required" ); 87is( $res->return_code, 2, "One of two host nonresponsive - two required" );
96like( $res->output, $failureOutput, "Output OK" ); 88like( $res->output, $failureOutput, "Output OK" );
97 89
98# 8
99$res = NPTest->testCmd( 90$res = NPTest->testCmd(
100 "$sudo ./check_icmp -H $host_responsive -s 127.0.15.15 -w 10000ms,100% -c 10000ms,100% -n 1 -m 2" 91 "$sudo ./check_icmp -H $host_responsive -s 127.0.15.15 -w 10000ms,100% -c 10000ms,100% -n 1 -m 2"
101 ); 92 );
@@ -108,7 +99,6 @@ $res = NPTest->testCmd(
108is( $res->return_code, 0, "Try max paket size" ); 99is( $res->return_code, 0, "Try max paket size" );
109like( $res->output, $successOutput, "Output OK - Didn't overflow" ); 100like( $res->output, $successOutput, "Output OK - Didn't overflow" );
110 101
111# 9
112$res = NPTest->testCmd( 102$res = NPTest->testCmd(
113 "$sudo ./check_icmp -H ::1 -vvv" 103 "$sudo ./check_icmp -H ::1 -vvv"
114 ); 104 );