|
From: <jgr...@us...> - 2003-08-01 02:45:20
|
Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv10688/tests
Modified Files:
TestPOP3.tst
Log Message:
Completed test suite for the POP3 proxy; the only missing parts are the handling of the HTML forms for changing ports which will be done when I write the HTML.pm test suite
Index: TestPOP3.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestPOP3.tst,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** TestPOP3.tst 1 Aug 2003 01:09:50 -0000 1.9
--- TestPOP3.tst 1 Aug 2003 02:45:17 -0000 1.10
***************
*** 217,235 ****
}
! if ( $command =~ /CAPA/i ) {
! print $client "+OK I can handle$eol" . "AUTH$eol" . "USER$eol" . "APOP$eol.$eol";
! next;
! }
!
! if ( $command =~ /APOP (.*) (.*)/i ) {
! print $client "+OK Welcome APOPer$eol";
next;
}
! if ( $command =~ /AUTH ([^ ]+)/ ) {
next;
}
! if ( $command =~ /AUTH/ ) {
next;
}
--- 217,238 ----
}
! if ( $command =~ /AUTH ([^ ]+)/ ) {
! print $client "$1$eol";
! my $echoit = <$client>;
! print $client "Got $echoit";
! $echoit = <$client>;
! print $client "Got $echoit";
! $echoit = <$client>;
! print $client "+OK Done$eol";
next;
}
! if ( $command =~ /CAPA|AUTH/i ) {
! print $client "+OK I can handle$eol" . "AUTH$eol" . "USER$eol" . "APOP$eol.$eol";
next;
}
! if ( $command =~ /APOP (.*) (.*)/i ) {
! print $client "+OK Welcome APOPer$eol";
next;
}
***************
*** 360,365 ****
my $command = <$dreader>;
- print "[$command]\n";
-
if ( $command =~ /__QUIT/ ) {
print $uwriter "OK\n";
--- 363,366 ----
***************
*** 372,375 ****
--- 373,390 ----
next;
}
+
+ if ( $command =~ /__SECUREBAD/ ) {
+ $p->config_( 'secure_server', '127.0.0.1' );
+ $p->config_( 'secure_port', 8111 );
+ print $uwriter "OK\n";
+ next;
+ }
+
+ if ( $command =~ /__SECUREOK/ ) {
+ $p->config_( 'secure_server', '127.0.0.1' );
+ $p->config_( 'secure_port', 8110 );
+ print $uwriter "OK\n";
+ next;
+ }
}
}
***************
*** 695,699 ****
test_assert_equal( $line, "OK\n" );
-
my $client = IO::Socket::INET->new(
Proto => "tcp",
--- 710,713 ----
***************
*** 981,985 ****
close $client;
! # TODO SPA/AUTH tests with good, bad servers
# Send the remote server a special message that makes it die
--- 995,1097 ----
close $client;
! # Test SPA/AUTH with a bad server
!
! print $dwriter "__SECUREBAD\n";
! my $line = <$ureader>;
! test_assert_equal( $line, "OK\n" );
!
! my $client = IO::Socket::INET->new(
! Proto => "tcp",
! PeerAddr => 'localhost',
! PeerPort => $port );
!
! test_assert( defined( $client ) );
! test_assert( $client->connected );
!
! my $result = <$client>;
! test_assert_equal( $result, "+OK POP3 POPFile (test suite) server ready$eol" );
!
! print $client "CAPA$eol";
! $result = <$client>;
! test_assert_equal( $result, "-ERR can't connect to 127.0.0.1:8111$eol" );
!
! print $client "AUTH$eol";
! $result = <$client>;
! test_assert_equal( $result, "-ERR can't connect to 127.0.0.1:8111$eol" );
!
! print $client "AUTH username$eol";
! $result = <$client>;
! test_assert_equal( $result, "-ERR can't connect to 127.0.0.1:8111$eol" );
!
! print $client "QUIT$eol";
! $result = <$client>;
! test_assert_equal( $result, "+OK goodbye$eol" );
!
! close $client;
!
! # Test SPA/AUTH tests with good server
!
! print $dwriter "__SECUREOK\n";
! my $line = <$ureader>;
! test_assert_equal( $line, "OK\n" );
!
! my $client = IO::Socket::INET->new(
! Proto => "tcp",
! PeerAddr => 'localhost',
! PeerPort => $port );
!
! test_assert( defined( $client ) );
! test_assert( $client->connected );
!
! my $result = <$client>;
! test_assert_equal( $result, "+OK POP3 POPFile (test suite) server ready$eol" );
!
! print $client "AUTH$eol";
! $result = <$client>;
! test_assert_equal( $result, "+OK I can handle$eol" );
! $result = <$client>;
! test_assert_equal( $result, "AUTH$eol" );
! $result = <$client>;
! test_assert_equal( $result, "USER$eol" );
! $result = <$client>;
! test_assert_equal( $result, "APOP$eol" );
! $result = <$client>;
! test_assert_equal( $result, ".$eol" );
!
! print $client "QUIT$eol";
! $result = <$client>;
! test_assert_equal( $result, "+OK Bye$eol" );
!
! close $client;
!
! my $client = IO::Socket::INET->new(
! Proto => "tcp",
! PeerAddr => 'localhost',
! PeerPort => $port );
!
! test_assert( defined( $client ) );
! test_assert( $client->connected );
!
! my $result = <$client>;
! test_assert_equal( $result, "+OK POP3 POPFile (test suite) server ready$eol" );
!
! print $client "AUTH gooduser$eol";
! $result = <$client>;
! test_assert_equal( $result, "gooduser$eol" );
! print $client "repeatthis$eol";
! $result = <$client>;
! test_assert_equal( $result, "Got repeatthis$eol" );
! print $client "repeatthat$eol";
! $result = <$client>;
! test_assert_equal( $result, "Got repeatthat$eol" );
! print $client "done$eol";
! $result = <$client>;
! test_assert_equal( $result, "+OK Done$eol" );
!
! print $client "QUIT$eol";
! $result = <$client>;
! test_assert_equal( $result, "+OK Bye$eol" );
!
! close $client;
# Send the remote server a special message that makes it die
|