check_ftp.t 671 B

1234567891011121314151617181920212223242526272829303132
  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 $cmd;
  9. my $str;
  10. my $t;
  11. $cmd = "./check_ftp $Cache::hostname -wt 300 -ct 600";
  12. $str = `$cmd`;
  13. $t += ok $?>>8,0;
  14. print "Test was: $cmd\n" if ($?);
  15. $t += ok $str, '/FTP OK -\s+[0-9]?\.?[0-9]+ second response time/';
  16. #$cmd = "./check_ftp $Cache::noserver -wt 0 -ct 0";
  17. #$str = `$cmd`;
  18. #$t += ok $?>>8,2;
  19. #print "Test was: $cmd\n" unless ($?);
  20. $cmd = "./check_ftp $Cache::nullhost -wt 0 -ct 0 -to 1";
  21. $str = `$cmd`;
  22. $t += ok $?>>8,2;
  23. print "Test was: $cmd\n" unless ($?);
  24. exit(0) if defined($Test::Harness::VERSION);
  25. exit($tests - $t);