Skip Menu |

This queue is for tickets about the Tree-Persist CPAN distribution.

Report information
The Basics
Id: 86309
Status: resolved
Priority: 0/
Queue: Tree-Persist

People
Owner: Nobody in particular
Requestors: james2vegas [...] aim.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: t/associate_with_file.t (and t/autocommit.t) fails writing to a read-only file
$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/add_from_db.t .......... ok
t/associate_with_db.t .... ok
Cannot open '/tmp/temp.KEGS/save1.xml' for writing: Permission denied
Show quoted text
# Looks like you planned 15 tests but ran 10.
# Looks like your test exited with 13 just after 10.
t/associate_with_file.t ..
Dubious, test returned 13 (wstat 3328, 0xd00)
Failed 5/15 subtests
Cannot open '/tmp/temp.b03c/save1.xml' for writing: Permission denied
Show quoted text
# Looks like you planned 20 tests but ran 9.
# Looks like your test exited with 13 just after 9.
t/autocommit.t ...........
Dubious, test returned 13 (wstat 3328, 0xd00)
Failed 11/20 subtests
t/interface.t ............ ok
t/load_from_db.t ......... ok
t/load_from_file.t ....... ok
t/pod.t .................. ok
t/pod_coverage.t ......... ok
t/save_and_load.t ........ ok
t/save_to_db.t ........... ok
t/save_to_file.t ......... ok

Test Summary Report
-------------------
t/associate_with_file.t (Wstat: 3328 Tests: 10 Failed: 0)
  Non-zero exit status: 13
  Parse errors: Bad plan.  You planned 15 tests but ran 10.
t/autocommit.t         (Wstat: 3328 Tests: 9 Failed: 0)
  Non-zero exit status: 13
  Parse errors: Bad plan.  You planned 20 tests but ran 9.
Files=12, Tests=155,  2 wallclock secs ( 0.06 usr  0.12 sys +  1.00 cusr  0.14 csys =  1.32 CPU)
Result: FAIL
Failed 2/12 test programs. 0/155 subtests failed.
*** Error code 255

Stop in /home/perlu/.cpanm/work/1371835983.25327/Tree-Persist-1.07 (line 894 of Makefile).


The files are not writable because File::Copy::cp is copying across the file permissions for t/datafiles/tree{1,2}.xml (mode 444)  to the file in the tempdir.
Subject: Re: [rt.cpan.org #86309] t/associate_with_file.t (and t/autocommit.t) fails writing to a read-only file
Date: Sat, 22 Jun 2013 10:00:25 +1000
To: bug-Tree-Persist [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi James Thanx for the report. I did not understand the issue. I thought that /tmp was read-only (it's possible), so that a temp dir underneath it would be too. On 22/06/13 04:01, James Wright via RT wrote: Show quoted text
> Fri Jun 21 14:01:17 2013: Request 86309 was acted upon. > Transaction: Ticket created by JWRIGHT > Queue: Tree-Persist > Subject: t/associate_with_file.t (and t/autocommit.t) fails writing to a > read-only file > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: james2vegas@aim.com > Status: new > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=86309> > > > $ make test > PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, > 'blib/lib', 'blib/arch')" t/*.t > t/add_from_db.t .......... ok > t/associate_with_db.t .... ok > Cannot open '/tmp/temp.KEGS/save1.xml' for writing: Permission denied > # Looks like you planned 15 tests but ran 10. > # Looks like your test exited with 13 just after 10. > t/associate_with_file.t .. > Dubious, test returned 13 (wstat 3328, 0xd00) > Failed 5/15 subtests > Cannot open '/tmp/temp.b03c/save1.xml' for writing: Permission denied > # Looks like you planned 20 tests but ran 9. > # Looks like your test exited with 13 just after 9. > t/autocommit.t ........... > Dubious, test returned 13 (wstat 3328, 0xd00) > Failed 11/20 subtests > t/interface.t ............ ok > t/load_from_db.t ......... ok > t/load_from_file.t ....... ok > t/pod.t .................. ok > t/pod_coverage.t ......... ok > t/save_and_load.t ........ ok > t/save_to_db.t ........... ok > t/save_to_file.t ......... ok > > Test Summary Report > ------------------- > t/associate_with_file.t (Wstat: 3328 Tests: 10 Failed: 0) > Non-zero exit status: 13 > Parse errors: Bad plan. You planned 15 tests but ran 10. > t/autocommit.t (Wstat: 3328 Tests: 9 Failed: 0) > Non-zero exit status: 13 > Parse errors: Bad plan. You planned 20 tests but ran 9. > Files=12, Tests=155, 2 wallclock secs ( 0.06 usr 0.12 sys + 1.00 cusr 0.14 csys > = 1.32 CPU) > Result: FAIL > Failed 2/12 test programs. 0/155 subtests failed. > *** Error code 255 > > Stop in /home/perlu/.cpanm/work/1371835983.25327/Tree-Persist-1.07 (line 894 of > Makefile). > > > The files are not writable because File::Copy::cp is copying across the file > permissions for t/datafiles/tree{1,2}.xml (mode 444) to the file in the > tempdir. >
-- Ron Savage http://savage.net.au/ Ph: 0421 920 622
Fixed, hopefully, in V 1.09. I replaced File::Copy with File::Slurp, whose write_file() method has a saner set of defaults for permissions.