From f7c3a78a3924018155d6fcf69e1b025f7d2fa389 Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Mon, 2 Jun 2014 13:50:12 +0100 Subject: Rename new test scripts from *.pl to *.t as per MANIFEST --- t/pop3_ipv6.pl | 57 -------------------------------------------------------- t/pop3_ipv6.t | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ t/smtp_ipv6.pl | 59 ---------------------------------------------------------- t/smtp_ipv6.t | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+), 116 deletions(-) delete mode 100644 t/pop3_ipv6.pl create mode 100644 t/pop3_ipv6.t delete mode 100644 t/smtp_ipv6.pl create mode 100644 t/smtp_ipv6.t diff --git a/t/pop3_ipv6.pl b/t/pop3_ipv6.pl deleted file mode 100644 index 2f073ab..0000000 --- a/t/pop3_ipv6.pl +++ /dev/null @@ -1,57 +0,0 @@ -use strict; -use warnings; -use Test::More; -use File::Temp 'tempfile'; -use Net::POP3; - -my $debug = 0; # Net::POP3->new( Debug => .. ) - -my $inet6class = Net::POP3->can_inet6; -plan skip_all => "no IPv6 support found in Net::POP3" if ! $inet6class; - -plan skip_all => "fork not supported on this platform" - if grep { $^O =~m{$_} } qw(MacOS VOS vmesa riscos amigaos); - -my $srv = $inet6class->new( - LocalAddr => '::1', - Listen => 10 -); -plan skip_all => "cannot create listener on ::1: $!" if ! $srv; -my $saddr = "[".$srv->sockhost."]".':'.$srv->sockport; -diag("server on $saddr"); - -plan tests => 1; - -defined( my $pid = fork()) or die "fork failed: $!"; -exit(pop3_server()) if ! $pid; - -my $cl = Net::POP3->new($saddr, Debug => $debug); -diag("created Net::POP3 object"); -if (!$cl) { - fail("IPv6 POP3 connect failed"); -} else { - $cl->quit; - pass("IPv6 success"); -} -wait; - -sub pop3_server { - my $cl = $srv->accept or die "accept failed: $!"; - print $cl "+OK localhost ready\r\n"; - while (<$cl>) { - my ($cmd,$arg) = m{^(\S+)(?: +(.*))?\r\n} or die $_; - $cmd = uc($cmd); - if ($cmd eq 'QUIT' ) { - print $cl "+OK bye\r\n"; - last; - } elsif ( $cmd eq 'CAPA' ) { - print $cl "+OK\r\n". - ".\r\n"; - } else { - diag("received unknown command: $cmd"); - print "-ERR unknown cmd\r\n"; - } - } - - diag("POP3 dialog done"); -} diff --git a/t/pop3_ipv6.t b/t/pop3_ipv6.t new file mode 100644 index 0000000..2f073ab --- /dev/null +++ b/t/pop3_ipv6.t @@ -0,0 +1,57 @@ +use strict; +use warnings; +use Test::More; +use File::Temp 'tempfile'; +use Net::POP3; + +my $debug = 0; # Net::POP3->new( Debug => .. ) + +my $inet6class = Net::POP3->can_inet6; +plan skip_all => "no IPv6 support found in Net::POP3" if ! $inet6class; + +plan skip_all => "fork not supported on this platform" + if grep { $^O =~m{$_} } qw(MacOS VOS vmesa riscos amigaos); + +my $srv = $inet6class->new( + LocalAddr => '::1', + Listen => 10 +); +plan skip_all => "cannot create listener on ::1: $!" if ! $srv; +my $saddr = "[".$srv->sockhost."]".':'.$srv->sockport; +diag("server on $saddr"); + +plan tests => 1; + +defined( my $pid = fork()) or die "fork failed: $!"; +exit(pop3_server()) if ! $pid; + +my $cl = Net::POP3->new($saddr, Debug => $debug); +diag("created Net::POP3 object"); +if (!$cl) { + fail("IPv6 POP3 connect failed"); +} else { + $cl->quit; + pass("IPv6 success"); +} +wait; + +sub pop3_server { + my $cl = $srv->accept or die "accept failed: $!"; + print $cl "+OK localhost ready\r\n"; + while (<$cl>) { + my ($cmd,$arg) = m{^(\S+)(?: +(.*))?\r\n} or die $_; + $cmd = uc($cmd); + if ($cmd eq 'QUIT' ) { + print $cl "+OK bye\r\n"; + last; + } elsif ( $cmd eq 'CAPA' ) { + print $cl "+OK\r\n". + ".\r\n"; + } else { + diag("received unknown command: $cmd"); + print "-ERR unknown cmd\r\n"; + } + } + + diag("POP3 dialog done"); +} diff --git a/t/smtp_ipv6.pl b/t/smtp_ipv6.pl deleted file mode 100644 index 6a01520..0000000 --- a/t/smtp_ipv6.pl +++ /dev/null @@ -1,59 +0,0 @@ -use strict; -use warnings; -use Test::More; -use File::Temp 'tempfile'; -use Net::SMTP; - -my $debug = 0; # Net::SMTP->new( Debug => .. ) - -my $inet6class = Net::SMTP->can_inet6; -plan skip_all => "no IPv6 support found in Net::SMTP" if ! $inet6class; - -plan skip_all => "fork not supported on this platform" - if grep { $^O =~m{$_} } qw(MacOS VOS vmesa riscos amigaos); - -my $srv = $inet6class->new( - LocalAddr => '::1', - Listen => 10 -); -plan skip_all => "cannot create listener on ::1: $!" if ! $srv; -my $saddr = "[".$srv->sockhost."]".':'.$srv->sockport; -diag("server on $saddr"); - -plan tests => 1; - -defined( my $pid = fork()) or die "fork failed: $!"; -exit(smtp_server()) if ! $pid; - -my $cl = Net::SMTP->new($saddr, Debug => $debug); -diag("created Net::SMTP object"); -if (!$cl) { - fail("IPv6 SMTP connect failed"); -} else { - $cl->quit; - pass("IPv6 success"); -} -wait; - -sub smtp_server { - my $cl = $srv->accept or die "accept failed: $!"; - print $cl "220 welcome\r\n"; - while (<$cl>) { - my ($cmd,$arg) = m{^(\S+)(?: +(.*))?\r\n} or die $_; - $cmd = uc($cmd); - if ($cmd eq 'QUIT' ) { - print $cl "250 bye\r\n"; - last; - } elsif ( $cmd eq 'HELO' ) { - print $cl "250 localhost\r\n"; - } elsif ( $cmd eq 'EHLO' ) { - print $cl "250-localhost\r\n". - "250 HELP\r\n"; - } else { - diag("received unknown command: $cmd"); - print "500 unknown cmd\r\n"; - } - } - - diag("SMTP dialog done"); -} diff --git a/t/smtp_ipv6.t b/t/smtp_ipv6.t new file mode 100644 index 0000000..6a01520 --- /dev/null +++ b/t/smtp_ipv6.t @@ -0,0 +1,59 @@ +use strict; +use warnings; +use Test::More; +use File::Temp 'tempfile'; +use Net::SMTP; + +my $debug = 0; # Net::SMTP->new( Debug => .. ) + +my $inet6class = Net::SMTP->can_inet6; +plan skip_all => "no IPv6 support found in Net::SMTP" if ! $inet6class; + +plan skip_all => "fork not supported on this platform" + if grep { $^O =~m{$_} } qw(MacOS VOS vmesa riscos amigaos); + +my $srv = $inet6class->new( + LocalAddr => '::1', + Listen => 10 +); +plan skip_all => "cannot create listener on ::1: $!" if ! $srv; +my $saddr = "[".$srv->sockhost."]".':'.$srv->sockport; +diag("server on $saddr"); + +plan tests => 1; + +defined( my $pid = fork()) or die "fork failed: $!"; +exit(smtp_server()) if ! $pid; + +my $cl = Net::SMTP->new($saddr, Debug => $debug); +diag("created Net::SMTP object"); +if (!$cl) { + fail("IPv6 SMTP connect failed"); +} else { + $cl->quit; + pass("IPv6 success"); +} +wait; + +sub smtp_server { + my $cl = $srv->accept or die "accept failed: $!"; + print $cl "220 welcome\r\n"; + while (<$cl>) { + my ($cmd,$arg) = m{^(\S+)(?: +(.*))?\r\n} or die $_; + $cmd = uc($cmd); + if ($cmd eq 'QUIT' ) { + print $cl "250 bye\r\n"; + last; + } elsif ( $cmd eq 'HELO' ) { + print $cl "250 localhost\r\n"; + } elsif ( $cmd eq 'EHLO' ) { + print $cl "250-localhost\r\n". + "250 HELP\r\n"; + } else { + diag("received unknown command: $cmd"); + print "500 unknown cmd\r\n"; + } + } + + diag("SMTP dialog done"); +} -- cgit v1.2.3-24-ge0c7