diff options
Diffstat (limited to 'plugins/t/check_curl.t')
-rw-r--r-- | plugins/t/check_curl.t | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/t/check_curl.t b/plugins/t/check_curl.t index e67fafb..050416c 100644 --- a/plugins/t/check_curl.t +++ b/plugins/t/check_curl.t | |||
@@ -9,7 +9,7 @@ use Test::More; | |||
9 | use POSIX qw/mktime strftime/; | 9 | use POSIX qw/mktime strftime/; |
10 | use NPTest; | 10 | use NPTest; |
11 | 11 | ||
12 | plan tests => 49; | 12 | plan tests => 57; |
13 | 13 | ||
14 | my $successOutput = '/OK.*HTTP.*second/'; | 14 | my $successOutput = '/OK.*HTTP.*second/'; |
15 | 15 | ||
@@ -78,15 +78,27 @@ like( $res->output, "/cURL returned 6 - Couldn't resolve host name/", "Output OK | |||
78 | # host header checks | 78 | # host header checks |
79 | $res = NPTest->testCmd("./$plugin -v -H $host_tcp_http"); | 79 | $res = NPTest->testCmd("./$plugin -v -H $host_tcp_http"); |
80 | like( $res->output, '/^Host: '.$host_tcp_http.'\s*$/ms', "Host Header OK" ); | 80 | like( $res->output, '/^Host: '.$host_tcp_http.'\s*$/ms', "Host Header OK" ); |
81 | like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" ); | ||
81 | 82 | ||
82 | $res = NPTest->testCmd("./$plugin -v -H $host_tcp_http -p 80"); | 83 | $res = NPTest->testCmd("./$plugin -v -H $host_tcp_http -p 80"); |
83 | like( $res->output, '/^Host: '.$host_tcp_http.'\s*$/ms', "Host Header OK" ); | 84 | like( $res->output, '/^Host: '.$host_tcp_http.'\s*$/ms', "Host Header OK" ); |
85 | like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" ); | ||
84 | 86 | ||
85 | $res = NPTest->testCmd("./$plugin -v -H $host_tcp_http:8080 -p 80"); | 87 | $res = NPTest->testCmd("./$plugin -v -H $host_tcp_http:8080 -p 80"); |
86 | like( $res->output, '/^Host: '.$host_tcp_http.':8080\s*$/ms', "Host Header OK" ); | 88 | like( $res->output, '/^Host: '.$host_tcp_http.':8080\s*$/ms', "Host Header OK" ); |
89 | like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" ); | ||
87 | 90 | ||
88 | $res = NPTest->testCmd("./$plugin -v -H $host_tcp_http:8080 -p 80"); | 91 | $res = NPTest->testCmd("./$plugin -v -H $host_tcp_http:8080 -p 80"); |
89 | like( $res->output, '/^Host: '.$host_tcp_http.':8080\s*$/ms', "Host Header OK" ); | 92 | like( $res->output, '/^Host: '.$host_tcp_http.':8080\s*$/ms', "Host Header OK" ); |
93 | like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" ); | ||
94 | |||
95 | $res = NPTest->testCmd("./$plugin -v -H $host_tcp_http:8080 -p 80 -k 'Host: testhost:8001'"); | ||
96 | like( $res->output, '/^Host: testhost:8001\s*$/ms', "Host Header OK" ); | ||
97 | like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" ); | ||
98 | |||
99 | $res = NPTest->testCmd("./$plugin -v -I $host_tcp_http -p 80 -k 'Host: testhost:8001'"); | ||
100 | like( $res->output, '/^Host: testhost:8001\s*$/ms', "Host Header OK" ); | ||
101 | like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" ); | ||
90 | 102 | ||
91 | SKIP: { | 103 | SKIP: { |
92 | skip "No internet access", 3 if $internet_access eq "no"; | 104 | skip "No internet access", 3 if $internet_access eq "no"; |