diff options
| author | Sven Nierlein <sven@nierlein.de> | 2017-03-18 22:48:35 +0100 |
|---|---|---|
| committer | Sven Nierlein <sven@nierlein.de> | 2018-10-22 16:30:31 +0200 |
| commit | e9239b556a4748bb06f5f46a2bedbf0114cd099a (patch) | |
| tree | 0f5276b8f3862c20db927033679277b3132e7a9e /plugins/tests | |
| parent | dee8f760d3c9935a52b1d49b63940f35b3656dc8 (diff) | |
| download | monitoring-plugins-e9239b556a4748bb06f5f46a2bedbf0114cd099a.tar.gz | |
check_curl: make check_curl use the same tests as check_http
Diffstat (limited to 'plugins/tests')
| l--------- | plugins/tests/check_curl.t | 1 | ||||
| -rwxr-xr-x | plugins/tests/check_http.t | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/plugins/tests/check_curl.t b/plugins/tests/check_curl.t new file mode 120000 index 00000000..a54db967 --- /dev/null +++ b/plugins/tests/check_curl.t | |||
| @@ -0,0 +1 @@ | |||
| check_http.t \ No newline at end of file | |||
diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t index d6d31de1..f5c570ac 100755 --- a/plugins/tests/check_http.t +++ b/plugins/tests/check_http.t | |||
| @@ -30,13 +30,16 @@ eval { | |||
| 30 | require HTTP::Response; | 30 | require HTTP::Response; |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | my $plugin = 'check_http'; | ||
| 34 | $plugin = 'check_curl' if $0 =~ m/check_curl/mx; | ||
| 35 | |||
| 33 | if ($@) { | 36 | if ($@) { |
| 34 | plan skip_all => "Missing required module for test: $@"; | 37 | plan skip_all => "Missing required module for test: $@"; |
| 35 | } else { | 38 | } else { |
| 36 | if (-x "./check_http") { | 39 | if (-x "./$plugin") { |
| 37 | plan tests => $common_tests * 2 + $ssl_only_tests + $virtual_port_tests; | 40 | plan tests => $common_tests * 2 + $ssl_only_tests + $virtual_port_tests; |
| 38 | } else { | 41 | } else { |
| 39 | plan skip_all => "No check_http compiled"; | 42 | plan skip_all => "No $plugin compiled"; |
| 40 | } | 43 | } |
| 41 | } | 44 | } |
| 42 | 45 | ||
| @@ -185,7 +188,7 @@ if ($ARGV[0] && $ARGV[0] eq "-d") { | |||
| 185 | } | 188 | } |
| 186 | 189 | ||
| 187 | my $result; | 190 | my $result; |
| 188 | my $command = "./check_http -H 127.0.0.1"; | 191 | my $command = "./$plugin -H 127.0.0.1"; |
| 189 | 192 | ||
| 190 | run_common_tests( { command => "$command -p $port_http" } ); | 193 | run_common_tests( { command => "$command -p $port_http" } ); |
| 191 | SKIP: { | 194 | SKIP: { |
