C
Chris
Hi all,
Apologies for the long posting, but the details are important (I
think )...
I'm trying to install the DBI module via cpan and it all goes fine apart
from one minor test. To me there seems to be a problem with the test,
but before I file it as a bug would you confirm or deny my thoughts?
TIA
The test is no. 228 in t/10examp and the output is:
ok 224 - The object isa DBI::st
ok 225
ok 226 # skip # dump_results test skipped: unable to
open /homes/chris/tmp/dumpcsr.tst: Permission d
enied
#
ok 227 # skip # dump_results test skipped: unable to
open /homes/chris/tmp/dumpcsr.tst: Permission d
enied
#
not ok 228 - Remove /homes/chris/tmp/dumpcsr.tst
ok 229 - Actually gone
The code snippet which generates the error is in this block:
{
# dump_results;
my $sth = $dbh->prepare($std_sql);
isa_ok($sth, "DBI::st");
if ($haveFileSpec && length(File::Spec->updir)) {
ok($sth->execute(File::Spec->updir));
} else {
ok($sth->execute('../'));
}
my $dump_dir = ($ENV{TMP} ||
$ENV{TEMP} ||
$ENV{TMPDIR} ||
$ENV{'SYS$SCRATCH'} ||
'/tmp');
my $dump_file = ($haveFileSpec) ?
File::Spec->catfile($dump_dir, 'dumpcsr.tst')
:
"$dump_dir/dumpcsr.tst";
($dump_file) = ($dump_file =~ m/^(.*)$/); # untaint
SKIP: {
skip "# dump_results test skipped: unable to open
$dump_file: $!\n", 2 unless (open(
DUMP_RESULTS, ">$dump_file"));
ok($sth->dump_results("10", "\n", ",\t",
\*DUMP_RESULTS));
close(DUMP_RESULTS);
ok(-s $dump_file > 0);
}
is( unlink( $dump_file ), 1, "Remove $dump_file" ); <-- ERROR
ok( !-e $dump_file, "Actually gone" );
}
It seems that the code fails to create the dump_file which is 'ok', but
then when it tries to delete it and fails that is 'nok'. My issues are:
1. If the failure of the file create is ok then it shouldn't try to
delete it.
2. My $HOME/tmp permissions are 700 so that's the cause of the problem.
The test should really check for this.
3. This is such a minor error that the installation DBI shouldn't fail
because of it.
Has anyone else come across this or is this particular to my setup?
Again TIA
Apologies for the long posting, but the details are important (I
think )...
I'm trying to install the DBI module via cpan and it all goes fine apart
from one minor test. To me there seems to be a problem with the test,
but before I file it as a bug would you confirm or deny my thoughts?
TIA
The test is no. 228 in t/10examp and the output is:
ok 224 - The object isa DBI::st
ok 225
ok 226 # skip # dump_results test skipped: unable to
open /homes/chris/tmp/dumpcsr.tst: Permission d
enied
#
ok 227 # skip # dump_results test skipped: unable to
open /homes/chris/tmp/dumpcsr.tst: Permission d
enied
#
not ok 228 - Remove /homes/chris/tmp/dumpcsr.tst
ok 229 - Actually gone
The code snippet which generates the error is in this block:
{
# dump_results;
my $sth = $dbh->prepare($std_sql);
isa_ok($sth, "DBI::st");
if ($haveFileSpec && length(File::Spec->updir)) {
ok($sth->execute(File::Spec->updir));
} else {
ok($sth->execute('../'));
}
my $dump_dir = ($ENV{TMP} ||
$ENV{TEMP} ||
$ENV{TMPDIR} ||
$ENV{'SYS$SCRATCH'} ||
'/tmp');
my $dump_file = ($haveFileSpec) ?
File::Spec->catfile($dump_dir, 'dumpcsr.tst')
:
"$dump_dir/dumpcsr.tst";
($dump_file) = ($dump_file =~ m/^(.*)$/); # untaint
SKIP: {
skip "# dump_results test skipped: unable to open
$dump_file: $!\n", 2 unless (open(
DUMP_RESULTS, ">$dump_file"));
ok($sth->dump_results("10", "\n", ",\t",
\*DUMP_RESULTS));
close(DUMP_RESULTS);
ok(-s $dump_file > 0);
}
is( unlink( $dump_file ), 1, "Remove $dump_file" ); <-- ERROR
ok( !-e $dump_file, "Actually gone" );
}
It seems that the code fails to create the dump_file which is 'ok', but
then when it tries to delete it and fails that is 'nok'. My issues are:
1. If the failure of the file create is ok then it shouldn't try to
delete it.
2. My $HOME/tmp permissions are 700 so that's the cause of the problem.
The test should really check for this.
3. This is such a minor error that the installation DBI shouldn't fail
because of it.
Has anyone else come across this or is this particular to my setup?
Again TIA