check_http.t 490 B

12345678910111213141516171819202122
  1. #! /usr/bin/perl -w
  2. use strict;
  3. use Cache;
  4. use Test;
  5. use vars qw($tests);
  6. BEGIN {$tests = 3; plan tests => $tests}
  7. my $null = '';
  8. my $str;
  9. my $t;
  10. $str = `./check_http $Cache::hostname -wt 300 -ct 600`;
  11. $t += ok $?>>8,0;
  12. $t += ok $str, '/(HTTP\s[o|O][k|K]\s)?\s?HTTP\/1.[01]\s[0-9]{3}\s(OK|Found)\s-\s+([0-9]+|[0-9]+\.[0-9]+)\ssecond response time/';
  13. $str = `./check_http $Cache::nullhost -wt 1 -ct 2`;
  14. $t += ok $?>>8,2;
  15. exit(0) if defined($Test::Harness::VERSION);
  16. exit($tests - $t);