check_udp.t 522 B

123456789101112131415161718192021222324
  1. #! /usr/bin/perl -w
  2. #use strict;
  3. use Cache;
  4. use Helper;
  5. use Test;
  6. use vars qw($tests);
  7. BEGIN {$tests = 3; plan tests => $tests}
  8. my $null = '';
  9. my $str;
  10. my $t;
  11. my $hostname=get_option("udp_hostname","UDP host name");
  12. $str = `./check_udp $hostname -p 37 -wt 300 -ct 600`;
  13. $t += ok $?>>8,0;
  14. $t += ok $str, '/^Connection accepted on port 37 - [0-9]+ second response time$/';
  15. $str = `./check_udp $Cache::nullhost -p 80 -wt 0 -ct 0 -to 1`;
  16. $t += ok $?>>8,2;
  17. exit(0) if defined($Test::Harness::VERSION);
  18. exit($tests - $t);