4
0

check_pop.t 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #! /usr/bin/perl -w -I ..
  2. #
  3. # Post Office Protocol (POP) Server Tests via check_pop
  4. #
  5. # $Id$
  6. #
  7. use strict;
  8. use Test;
  9. use NPTest;
  10. use vars qw($tests);
  11. BEGIN {$tests = 5; plan tests => $tests}
  12. my $host_tcp_smtp = getTestParameter( "host_tcp_smtp", "NP_HOST_TCP_SMTP", "mailhost",
  13. "A host providing an STMP Service (a mail server)");
  14. my $host_tcp_pop = getTestParameter( "host_tcp_pop", "NP_HOST_TCP_POP", $host_tcp_smtp,
  15. "A host providing an POP Service (a mail server)");
  16. my $host_nonresponsive = getTestParameter( "host_nonresponsive", "NP_HOST_NONRESPONSIVE", "10.0.0.1",
  17. "The hostname of system not responsive to network requests" );
  18. my $hostname_invalid = getTestParameter( "hostname_invalid", "NP_HOSTNAME_INVALID", "nosuchhost",
  19. "An invalid (not known to DNS) hostname" );
  20. my %exceptions = ( 2 => "No POP Server present?" );
  21. my $t;
  22. $t += checkCmd( "./check_pop $host_tcp_pop", 0, undef, %exceptions );
  23. $t += checkCmd( "./check_pop -H $host_tcp_pop -p 110 -w 9 -c 9 -t 10 -e '+OK'", 0, undef, %exceptions );
  24. $t += checkCmd( "./check_pop $host_tcp_pop -p 110 -wt 9 -ct 9 -to 10 -e '+OK'", 0, undef, %exceptions );
  25. $t += checkCmd( "./check_pop $host_nonresponsive", 2 );
  26. $t += checkCmd( "./check_pop $hostname_invalid", 2 );
  27. exit(0) if defined($Test::Harness::VERSION);
  28. exit($tests - $t);