On 03/03/2008, demerphq <[EMAIL PROTECTED]> wrote:
> On 03/03/2008, Andy Armstrong <[EMAIL PROTECTED]> wrote:
>  > On 3 Mar 2008, at 12:24, demerphq wrote:
>  >  > Chris has since explained on IRC that this is a CPANPLUS bug that is
>  >  > tickled by the fact that I put "Config" in the EU::Install
>  >  > prerequisite list so ill be uploading a new release shortly.
>  >
>  >
>  >
>  > The CPANPLUS bug is the reason you got an NA rather than a FAIL but
>  >  the original test failure was in one of your tests AFAIK.
>
>
> Yes, it turns out that Chris was running the test as root. We are
>  currently investigating how to fix it so the test works as expected
>  when root as well.

New version of ExtUtils::Install is released.

It turned out the problem is that when the tests are root it seems to
be not possible to create a directory that is not writeable by root.
Our test is verifying some private logic that checks if a directory is
writeable, and it fails as root.

Im not really sure how to tackle this better than simply skipping the
tests as root which is what the most recent release does.

Ideas as to how to improve the testing in
ExtUtils-Install/t/can_write_dir.t would be graciously welcome.

The relevent code looks like the following. Any ideas how it could be
changed so it doesnt have to skip these tests as root?

SKIP: {
    my $exists = FS->catdir(qw(exists));
    my $subdir = FS->catdir(qw(exists subdir));

    skip "Tests will not work as expected when run under root", 9
          unless $>; #effective UID must not be 0
    ok mkdir $exists;
    END { rmdir $exists }

    ok chmod 0555, $exists, 'make read only';
    ok !-w $exists;
    is_deeply [can_write_dir($exists)], [0, $exists];
    is_deeply [can_write_dir($subdir)], [0, $exists, $subdir];

    ok chmod 0777, $exists, 'make writable';
    ok -w $exists;
    is_deeply [can_write_dir($exists)], [1, $exists];
    is_deeply [can_write_dir($subdir)],
              [1,
               $exists,
               $subdir
              ];
}

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Reply via email to