r29751 - in /trunk/libio-socket-ssl-perl: Changes SSL.pm debian/changelog t/acceptSSL-timeout.t t/connectSSL-timeout.t t/core.t t/nonblock.t t/sysread_write.t t/testlib.pl

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Sat Jan 17 15:20:17 UTC 2009


Author: ansgar-guest
Date: Sat Jan 17 15:20:14 2009
New Revision: 29751

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=29751
Log:
NOTE: 1.20 has only changes to t/*.  No upload needed.

Modified:
    trunk/libio-socket-ssl-perl/Changes
    trunk/libio-socket-ssl-perl/SSL.pm
    trunk/libio-socket-ssl-perl/debian/changelog
    trunk/libio-socket-ssl-perl/t/acceptSSL-timeout.t
    trunk/libio-socket-ssl-perl/t/connectSSL-timeout.t
    trunk/libio-socket-ssl-perl/t/core.t
    trunk/libio-socket-ssl-perl/t/nonblock.t
    trunk/libio-socket-ssl-perl/t/sysread_write.t
    trunk/libio-socket-ssl-perl/t/testlib.pl

Modified: trunk/libio-socket-ssl-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-socket-ssl-perl/Changes?rev=29751&op=diff
==============================================================================
--- trunk/libio-socket-ssl-perl/Changes (original)
+++ trunk/libio-socket-ssl-perl/Changes Sat Jan 17 15:20:14 2009
@@ -1,3 +1,7 @@
+
+v1.20 2009.01.15
+- only changes on test suite to make it ready for win32
+  (tested with strawberry perl 5.8.8)
 
 v1.19 2008.12.31
 - fix verfycn_name autodetection from PeerAddr/PeerHost

Modified: trunk/libio-socket-ssl-perl/SSL.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-socket-ssl-perl/SSL.pm?rev=29751&op=diff
==============================================================================
--- trunk/libio-socket-ssl-perl/SSL.pm (original)
+++ trunk/libio-socket-ssl-perl/SSL.pm Sat Jan 17 15:20:14 2009
@@ -66,7 +66,7 @@
 	}) {
 		@ISA = qw(IO::Socket::INET);
 	}
-	$VERSION = '1.19';
+	$VERSION = '1.20';
 	$GLOBAL_CONTEXT_ARGS = {};
 
 	#Make $DEBUG another name for $Net::SSLeay::trace

Modified: trunk/libio-socket-ssl-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-socket-ssl-perl/debian/changelog?rev=29751&op=diff
==============================================================================
--- trunk/libio-socket-ssl-perl/debian/changelog (original)
+++ trunk/libio-socket-ssl-perl/debian/changelog Sat Jan 17 15:20:14 2009
@@ -1,3 +1,9 @@
+libio-socket-ssl-perl (1.20-1) UNRELEASED; urgency=low
+
+  * NOTE: 1.20 has only changes to t/*.  No upload needed.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org>  Sat, 17 Jan 2009 16:19:27 +0100
+
 libio-socket-ssl-perl (1.19-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libio-socket-ssl-perl/t/acceptSSL-timeout.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-socket-ssl-perl/t/acceptSSL-timeout.t?rev=29751&op=diff
==============================================================================
--- trunk/libio-socket-ssl-perl/t/acceptSSL-timeout.t (original)
+++ trunk/libio-socket-ssl-perl/t/acceptSSL-timeout.t Sat Jan 17 15:20:14 2009
@@ -1,34 +1,44 @@
 use strict;
 use warnings;
+use IO::Socket::SSL;
 do './testlib.pl' || do './t/testlib.pl' || die "no testlib";
 
 $|=1;
-print "1..14\n";
+print "1..15\n";
 
-my ($server,$saddr) = create_listen_socket();
-ok( 'listening' );
+# first use SSL client
+{
+	my ($server,$saddr) = create_listen_socket();
+	ok(1, "listening \@$saddr" );
+	my $srv = fork_sub( 'server',$server );
+	close($server);
+	fd_grep_ok( 'Waiting', $srv );
+	my $cl = fork_sub( 'client_ssl',$saddr );
+	fd_grep_ok( 'Connect from',$srv );
+	fd_grep_ok( 'Connected', $cl );
+	fd_grep_ok( 'SSL Handshake OK', $srv );
+	fd_grep_ok( 'Hi!', $cl );
+}
 
-# first try bad non-SSL client
-my $srv = fork_sub( 'server' );
-fd_grep_ok( 'Waiting', $srv );
-my $cl = fork_sub( 'client_no_ssl' );
-fd_grep_ok( 'Connect from',$srv );
-fd_grep_ok( 'Connected', $cl );
-fd_grep_ok( 'SSL Handshake FAILED', $srv );
-killall();
-
-# then use SSL client
-$srv = fork_sub( 'server' );
-fd_grep_ok( 'Waiting', $srv );
-$cl = fork_sub( 'client_ssl' );
-fd_grep_ok( 'Connect from',$srv );
-fd_grep_ok( 'Connected', $cl );
-fd_grep_ok( 'SSL Handshake OK', $srv );
-fd_grep_ok( 'Hi!', $cl );
-killall();
+# then try bad non-SSL client
+if ( $^O =~m{mswin32}i ) {
+	# skip
+	ok( 1, "skip - TODO on win32" ) for(1..7);
+} else {
+	my ($server,$saddr) = create_listen_socket();
+	ok(1, "listening \@$saddr" );
+	my $srv = fork_sub( 'server',$server );
+	close($server);
+	fd_grep_ok( 'Waiting', $srv );
+	my $cl = fork_sub( 'client_no_ssl',$saddr );
+	fd_grep_ok( 'Connect from',$srv );
+	fd_grep_ok( 'Connected', $cl );
+	fd_grep_ok( 'SSL Handshake FAILED', $srv );
+}
 
 
 sub server {
+	my $server = shift;
 	print "Waiting\n";
 	my $client = $server->accept || die "accept failed: $!";
 	print "Connect from ".$client->peerhost.':'.$client->peerport."\n";
@@ -41,13 +51,15 @@
 }
 
 sub client_no_ssl {
+	my $saddr = shift;
 	my $c = IO::Socket::INET->new( $saddr ) || die "connect failed: $!";
 	print "Connected\n";
 	while ( sysread( $c,my $buf,8000 )) {}
 }
 
 sub client_ssl {
-	my $c = IO::Socket::SSL->new( $saddr ) || die "connect failed: $!";
+	my $saddr = shift;
+	my $c = IO::Socket::SSL->new( $saddr ) || die "connect failed: $!|$SSL_ERROR";
 	print "Connected\n";
 	while ( sysread( $c,my $buf,8000 )) { print $buf }
 }

Modified: trunk/libio-socket-ssl-perl/t/connectSSL-timeout.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-socket-ssl-perl/t/connectSSL-timeout.t?rev=29751&op=diff
==============================================================================
--- trunk/libio-socket-ssl-perl/t/connectSSL-timeout.t (original)
+++ trunk/libio-socket-ssl-perl/t/connectSSL-timeout.t Sat Jan 17 15:20:14 2009
@@ -3,34 +3,43 @@
 do './testlib.pl' || do './t/testlib.pl' || die "no testlib";
 
 $|=1;
-print "1..15\n";
+print "1..16\n";
 
-my ($server,$saddr) = create_listen_socket();
-ok( 'listening' );
 
-# first try bad non-SSL client
-my $srv = fork_sub( 'server' );
-fd_grep_ok( 'Waiting', $srv );
-my $cl = fork_sub( 'client' );
-fd_grep_ok( 'Connect from',$srv );
-fd_grep_ok( 'Connected', $cl );
-fd_grep_ok( 'SSL Handshake FAILED', $cl );
-killall();
+{
+	# first use SSL client
+	my ($server,$saddr) = create_listen_socket();
+	ok( 1, "listening \@$saddr" );
+	my $srv = fork_sub( 'server','ssl',$server );
+	close($server);
+	fd_grep_ok( 'Waiting', $srv );
+	my $cl = fork_sub( 'client',$saddr );
+	fd_grep_ok( 'Connect from',$srv );
+	fd_grep_ok( 'Connected', $cl );
+	fd_grep_ok( 'SSL Handshake OK', $srv );
+	fd_grep_ok( 'SSL Handshake OK', $cl );
+	fd_grep_ok( 'Hi!', $cl );
+}
 
-# then use SSL client
-$srv = fork_sub( 'server','ssl' );
-fd_grep_ok( 'Waiting', $srv );
-$cl = fork_sub( 'client' );
-fd_grep_ok( 'Connect from',$srv );
-fd_grep_ok( 'Connected', $cl );
-fd_grep_ok( 'SSL Handshake OK', $srv );
-fd_grep_ok( 'SSL Handshake OK', $cl );
-fd_grep_ok( 'Hi!', $cl );
-killall();
+if ( $^O =~m{mswin32}i ) {
+	# skip
+	ok( 1, "skip - TODO on win32" ) for(1..7);
+} else {
+	# then try bad non-SSL client
+	my ($server,$saddr) = create_listen_socket();
+	ok( 1, "listening \@$saddr" );
+	my $srv = fork_sub( 'server','nossl',$server );
+	close($server);
+	fd_grep_ok( 'Waiting', $srv );
+	my $cl = fork_sub( 'client',$saddr );
+	fd_grep_ok( 'Connect from',$srv );
+	fd_grep_ok( 'Connected', $cl );
+	fd_grep_ok( 'SSL Handshake FAILED', $cl );
+}
 
 
 sub server {
-	my $behavior = shift || 'nossl';
+	my ($behavior,$server) = @_;
 	print "Waiting\n";
 	my $client = $server->accept || die "accept failed: $!";
 	print "Connect from ".$client->peerhost.':'.$client->peerport."\n";
@@ -45,6 +54,7 @@
 }
 
 sub client {
+	my $saddr = shift;
 	my $c = IO::Socket::INET->new( $saddr ) || die "connect failed: $!";
 	print "Connected\n";
 	if ( IO::Socket::SSL->start_SSL( $c, Timeout => 5 )) {

Modified: trunk/libio-socket-ssl-perl/t/core.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-socket-ssl-perl/t/core.t?rev=29751&op=diff
==============================================================================
--- trunk/libio-socket-ssl-perl/t/core.t (original)
+++ trunk/libio-socket-ssl-perl/t/core.t Sat Jan 17 15:20:14 2009
@@ -11,6 +11,7 @@
 eval {require "ssl_settings.req";};
 
 $GUARANTEED_TO_HAVE_NONBLOCKING_SOCKETS = eval "use 5.006; use IO::Select; return 1";
+$GUARANTEED_TO_HAVE_NONBLOCKING_SOCKETS = 0 if $^O =~m{mswin32}i;
 $NET_SSLEAY_VERSION = $Net::SSLeay::VERSION;
 $OPENSSL_VERSION = 0;
 $OPENSSL_VERSION = &Net::SSLeay::OPENSSL_VERSION_NUMBER if ($NET_SSLEAY_VERSION>=1.19);

Modified: trunk/libio-socket-ssl-perl/t/nonblock.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-socket-ssl-perl/t/nonblock.t?rev=29751&op=diff
==============================================================================
--- trunk/libio-socket-ssl-perl/t/nonblock.t (original)
+++ trunk/libio-socket-ssl-perl/t/nonblock.t Sat Jan 17 15:20:14 2009
@@ -20,6 +20,11 @@
 if ( grep { $^O =~m{$_} } qw( MacOS VOS vmesa riscos amigaos ) ) {
     print "1..0 # Skipped: fork not implemented on this platform\n";
     exit
+}
+
+if ( $^O =~m{mswin32}i ) {
+	print "1..0 # Skipped: nonblocking does not work on Win32\n";
+	exit
 }
 
 $SIG{PIPE} = 'IGNORE'; # use EPIPE not signal handler

Modified: trunk/libio-socket-ssl-perl/t/sysread_write.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-socket-ssl-perl/t/sysread_write.t?rev=29751&op=diff
==============================================================================
--- trunk/libio-socket-ssl-perl/t/sysread_write.t (original)
+++ trunk/libio-socket-ssl-perl/t/sysread_write.t Sat Jan 17 15:20:14 2009
@@ -95,11 +95,13 @@
     print "not " if $n != 16384;
     ok( "partial write in syswrite" );
 
+    # TODO does not work on Win32!!!
+    print "ok # TODO(win32): " if $^O=~m{mswin32}i;
     # but write should send everything because it does ssl_write_all
     $n = $to_server->write( 'x' x 18000 );
     #DEBUG( "send $n bytes" );
     print "not " if $n != 18000;
-    ok( "full write in write" );
+    ok( "full write in write ($n)" );
 
     exit;
 

Modified: trunk/libio-socket-ssl-perl/t/testlib.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-socket-ssl-perl/t/testlib.pl?rev=29751&op=diff
==============================================================================
--- trunk/libio-socket-ssl-perl/t/testlib.pl (original)
+++ trunk/libio-socket-ssl-perl/t/testlib.pl Sat Jan 17 15:20:14 2009
@@ -69,11 +69,8 @@
 	if ( ! $pid ) {
 		# CHILD, exec sub
 		close($rh);
-		open( STDOUT,'>&'.fileno($wh) ) || die $!;
-		close( $wh );
-		open( STDERR,'>&STDOUT' ) || die $!;
-		STDOUT->autoflush;
-		STDERR->autoflush;
+		local *STDOUT = local *STDERR = $wh;
+		$wh->autoflush;
 		print "OK\n";
 		$sub->(@arg);
 		exit(0);
@@ -117,7 +114,7 @@
 		foreach my $fd (@fd) {
 			my $buf = \$fd2buf{$fd};
 			$$buf || next;
-			if ( $$buf =~s{\A(?:.*?)($pattern)(.*)}{$2}s ) {
+			if ( $$buf =~s{\A(?:.*?)($pattern)}{}s ) {
 				#diag( "found" );
 				return wantarray ? ( $1,$name ) : $1;
 			}




More information about the Pkg-perl-cvs-commits mailing list