Change 29874 by [EMAIL PROTECTED] on 2007/01/18 16:26:05
Integrate:
[ 27699]
Subject: [PATCH] ext/IO/t/io_unix.t
From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
Date: Sun, 02 Apr 2006 21:57:19 +0300
Message-ID: <[EMAIL PROTECTED]>
[ 29578]
Subject: [PATCH 5.8.8] Fixes for the test suite on OS/2
From: Ilya Zakharevich <[EMAIL PROTECTED]>
Date: Wed, 13 Dec 2006 18:32:22 -0800
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/maint-5.8/perl/ext/IO/t/io_unix.t#4 integrate
... //depot/maint-5.8/perl/lib/Time/Local.t#9 integrate
... //depot/maint-5.8/perl/os2/OS2/ExtAttr/t/os2_ea.t#2 integrate
... //depot/maint-5.8/perl/t/io/fs.t#8 integrate
... //depot/maint-5.8/perl/t/op/stat.t#13 integrate
Differences ...
==== //depot/maint-5.8/perl/ext/IO/t/io_unix.t#4 (text) ====
Index: perl/ext/IO/t/io_unix.t
--- perl/ext/IO/t/io_unix.t#3~29129~ 2006-10-29 10:29:46.000000000 -0800
+++ perl/ext/IO/t/io_unix.t 2007-01-18 08:26:05.000000000 -0800
@@ -38,6 +38,13 @@
$PATH = "sock-$$";
+if ($^O eq 'os2') { # Can't create sockets with relative path...
+ require Cwd;
+ my $d = Cwd::cwd();
+ $d =~ s/^[a-z]://i;
+ $PATH = "$d/$PATH";
+}
+
# Test if we can create the file within the tmp directory
if (-e $PATH or not open(TEST, ">$PATH") and $^O ne 'os2') {
print "1..0 # Skip: cannot open '$PATH' for write\n";
@@ -52,7 +59,26 @@
use IO::Socket;
-$listen = IO::Socket::UNIX->new(Local=>$PATH, Listen=>0) || die "$!";
+$listen = IO::Socket::UNIX->new(Local => $PATH, Listen => 0);
+
+# Sometimes UNIX filesystems are mounted for security reasons
+# with "nodev" option which spells out "no" for creating UNIX
+# local sockets. Therefore we will retry with a File::Temp
+# generated filename from a temp directory.
+unless (defined $listen) {
+ eval { require File::Temp };
+ unless ($@) {
+ import File::Temp 'mktemp';
+ for my $TMPDIR ($ENV{TMPDIR}, "/tmp") {
+ if (defined $TMPDIR && -d $TMPDIR && -w $TMPDIR) {
+ $PATH = mktemp("$TMPDIR/sXXXXXXXX");
+ last if $listen = IO::Socket::UNIX->new(Local => $PATH,
+ Listen => 0);
+ }
+ }
+ }
+ defined $listen or die "$PATH: $!";
+}
print "ok 1\n";
if($pid = fork()) {
==== //depot/maint-5.8/perl/lib/Time/Local.t#9 (xtext) ====
Index: perl/lib/Time/Local.t
--- perl/lib/Time/Local.t#8~25556~ 2005-09-21 13:05:39.000000000 -0700
+++ perl/lib/Time/Local.t 2007-01-18 08:26:05.000000000 -0800
@@ -56,7 +56,8 @@
# Use 3 days before the start of the epoch because with Borland on
# Win32 it will work for -3600 _if_ your time zone is +01:00 (or
# greater).
-my $neg_epoch_ok = defined ((localtime(-259200))[0]) ? 1 : 0;
+my $neg_epoch_ok = # take into account systems with unsigned time too
+ (defined ((localtime(-259200))[0]) and (localtime(-259200))[5] == 69) ? 1
: 0;
# use vmsish 'time' makes for oddness around the Unix epoch
if ($^O eq 'VMS') {
==== //depot/maint-5.8/perl/os2/OS2/ExtAttr/t/os2_ea.t#2 (text) ====
Index: perl/os2/OS2/ExtAttr/t/os2_ea.t
--- perl/os2/OS2/ExtAttr/t/os2_ea.t#1~17645~ 2002-07-19 12:29:57.000000000
-0700
+++ perl/os2/OS2/ExtAttr/t/os2_ea.t 2007-01-18 08:26:05.000000000 -0800
@@ -37,9 +37,14 @@
print "ok 2\n";
keys %a == 0 ? print "ok 3\n" : print "not ok 3\n";
- $a{'++'} = '---';
+# Standard Extended Attributes (SEAs) have a dot (.) as a prefix.
+# This identifies the extended attribute as a SEA. The leading dot is reserved,
+# so applications should not define extended attributes that start with a dot.
+# Also, extended attributes
+# that start with the characters $, @, &, or + are reserved for system use.
+ $a{'X--Y'} = '---'; # '++', -++', '!++', 'X++Y' fail on JFS
print "ok 4\n";
- $a{'AAA'} = 'xyz';
+ $a{'AAA'} = 'xyz'; # Name is going to be uppercased???
print "ok 5\n";
}
@@ -51,10 +56,10 @@
my $c = keys %a;
$c == 2 ? print "ok 7\n" : print "not ok 7\n# c=$c\n";
my @b = sort keys %a;
- "@b" eq '++ AAA' ? print "ok 8\n" : print "not ok 8\n# [EMAIL PROTECTED]'\n";
- $a{'++'} eq '---' ? print "ok 9\n" : print "not ok 9\n";;
+ "@b" eq 'AAA X--Y' ? print "ok 8\n" : print "not ok 8\n# [EMAIL
PROTECTED]'\n";
+ $a{'X--Y'} eq '---' ? print "ok 9\n" : print "not ok 9\n";;
$a{'AAA'} eq 'xyz' ? print "ok 10\n" : print "not ok 10\n# aaa->`$a{AAA}'\n";
- $c = delete $a{'++'};
+ $c = delete $a{'X--Y'};
$c eq '---' ? print "ok 11\n" : print "not ok 11\n# deleted->`$c'\n";;
}
@@ -70,10 +75,11 @@
"@b" eq 'AAA' ? print "ok 15\n" : print "not ok 15\n";
$a{'AAA'} eq 'xyz' ? print "ok 16\n" : print "not ok 16\n";;
! exists $a{'+'} ? print "ok 17\n" : print "not ok 17\n";;
- ! defined $a{'+'} ? print "ok 18\n" : print "not ok 18\n# ->`$a{'++'}'\n";;
- ! exists $a{'++'} ? print "ok 19\n" : print "not ok 19\n";;
- ! defined $a{'++'} ? print "ok 20\n" : print "not ok 20\n# ->`$a{'++'}'\n";;
+ ! defined $a{'+'} ? print "ok 18\n" : print "not ok 18\n# ->`$a{'X--Y'}'\n";;
+ ! exists $a{'X--Y'} ? print "ok 19\n" : print "not ok 19\n";;
+ ! defined $a{'X--Y'} ? print "ok 20\n" : print "not ok 20\n#
->`$a{'X--Y'}'\n";;
}
print "ok 21\n";
unlink 't.out';
+
==== //depot/maint-5.8/perl/t/io/fs.t#8 (xtext) ====
Index: perl/t/io/fs.t
--- perl/t/io/fs.t#7~29754~ 2007-01-11 05:30:43.000000000 -0800
+++ perl/t/io/fs.t 2007-01-18 08:26:05.000000000 -0800
@@ -202,7 +202,7 @@
skip "has fchown", 1 if ($Config{d_fchown} || "") eq "define";
open(my $fh, "<", "a");
eval { chown(0, 0, $fh); };
- like($@, qr/^The fchown function is unimplemented at/, "fchown is
unimplemented");
+ like($@, qr/^The f?chown function is unimplemented at/, "fchown is
unimplemented");
}
is(rename('a','b'), 1, "rename a b");
==== //depot/maint-5.8/perl/t/op/stat.t#13 (xtext) ====
Index: perl/t/op/stat.t
--- perl/t/op/stat.t#12~26689~ 2006-01-06 15:03:51.000000000 -0800
+++ perl/t/op/stat.t 2007-01-18 08:26:05.000000000 -0800
@@ -41,7 +41,7 @@
my $tmpfile = 'Op_stat.tmp';
my $tmpfile_link = $tmpfile.'2';
-
+chmod 0666, $tmpfile;
1 while unlink $tmpfile;
open(FOO, ">$tmpfile") || DIE("Can't open temp test file: $!");
close FOO;
@@ -468,5 +468,6 @@
}
END {
+ chmod 0666, $tmpfile;
1 while unlink $tmpfile;
}
End of Patch.