check_http.t 440 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\/1.1 [0-9]{3} (OK|Found) - [0-9]+ second 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);