diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-02-29 16:33:56 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-02-29 16:33:56 +0000 |
commit | 1a5dcd2a8591062e5ec466db7c14ca5456d959de (patch) | |
tree | 43e40bce8a2a506b15a27553b85210fc7cc85346 | |
parent | 7bc54ceabb946519c8e8183aeaf67cb19ae981c1 (diff) | |
download | perl-1a5dcd2a8591062e5ec466db7c14ca5456d959de.tar.gz |
Make ext/POSIX/t/sysconf.t use File::Spec->tmpdir() for pathconf/
fpathconf testing rather than ->curdir(), as the latter can be on
networked storage that fails the syscall (and the tests).
p4raw-id: //depot/perl@33401
-rw-r--r-- | ext/POSIX/t/sysconf.t | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/POSIX/t/sysconf.t b/ext/POSIX/t/sysconf.t index a1326a1da2..f11841c7fb 100644 --- a/ext/POSIX/t/sysconf.t +++ b/ext/POSIX/t/sysconf.t @@ -48,8 +48,11 @@ plan $tests : (skip_all => "No tests to run on this OS") ; -my $curdir = File::Spec->curdir; -$curdir = VMS::Filespec::fileify($curdir) if $^O eq 'VMS'; +# Don't test on "." as it can be networked storage which returns EINVAL +# Testing on "/" may not be portable to non-Unix as it may not be readable +# "/tmp" should be readable and likely also local. +my $testdir = File::Spec->tmpdir; +$testdir = VMS::Filespec::fileify($testdir) if $^O eq 'VMS'; my $r; @@ -77,8 +80,9 @@ sub _check_and_report { # testing fpathconf() on a non-terminal file SKIP: { - my $fd = POSIX::open($curdir, O_RDONLY) - or skip "could not open current directory ($!)", 3 * @path_consts; + my $fd = POSIX::open($testdir, O_RDONLY) + or skip "could not open test directory '$testdir' ($!)", + 3 * @path_consts; for my $constant (@path_consts) { $! = 0; @@ -92,8 +96,8 @@ SKIP: { # testing pathconf() on a non-terminal file for my $constant (@path_consts) { $! = 0; - $r = eval { pathconf( $curdir, eval "$constant()" ) }; - _check_and_report( $@, $r, qq[calling pathconf("$curdir", $constant)] ); + $r = eval { pathconf( $testdir, eval "$constant()" ) }; + _check_and_report( $@, $r, qq[calling pathconf("$testdir", $constant)] ); } SKIP: { |