Skip Menu |

This queue is for tickets about the Config-Crontab CPAN distribution.

Report information
The Basics
Id: 117922
Status: rejected
Worked: 16 min
Priority: 0/
Queue: Config-Crontab

People
Owner: scott [...] mailblock.net
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.41
Fixed in: 1.41



Subject: have_crontab() and existing crontabs
The check for a crontab command in the test suite doesn't handle exit code 0, which happens at least on Debian when the user has a crontab file. Also, checking for the command at all seems unnecessary when the test suite doesn't actually call it anywhere. Is this intentional? Thanks for your work on free software, -- Niko Tyni (Debian Perl Group) ntyni@debian.org
Can you help me understand what you mean? The test suite should *not* run if the user already has a crontab installed. All OSes that I know of have exit code 0 when a crontab exists. I tried running the suite on Debian 8 and it runs as expected both without a crontab (tests run) and with a crontab installed (no tests run).
Subject: Re: [rt.cpan.org #117922] have_crontab() and existing crontabs
Date: Sun, 18 Sep 2016 12:19:07 +0300
To: Scott Wiersdorf via RT <bug-Config-Crontab [...] rt.cpan.org>
From: Niko Tyni <ntyni [...] iki.fi>
On Sat, Sep 17, 2016 at 09:24:44PM -0400, Scott Wiersdorf via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=117922 > > > Can you help me understand what you mean? The test suite should *not* run if the user already has a crontab installed. All OSes that I know of have exit code 0 when a crontab exists. I tried running the suite on Debian 8 and it runs as expected both without a crontab (tests run) and with a crontab installed (no tests run).
Oh, this part was not clear to me. I thought have_crontab() was trying to detect the presence of a 'crontab' command, not if the user has a crontab file. Your comment in https://rt.cpan.org/Public/Bug/Display.html?id=59578#txn-921606 seemed to support this. Having the tests skipped with 'no crontab available' when the user has an installed crontab seems confusing to me. Is this just a safety precaution? The test suite doesn't actually seem to manipulate user crontabs - judging by strace it never calls the crontab command except in the have_crontab() check. Anyway, feel free to close this if it's working as it should. Apologies for the noise. Thanks again, -- Niko Tyni ntyni@debian.org
On Sun Sep 18 05:19:22 2016, ntyni@iki.fi wrote: Show quoted text
> On Sat, Sep 17, 2016 at 09:24:44PM -0400, Scott Wiersdorf via RT > wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=117922 > > > > > Can you help me understand what you mean? The test suite should *not* > > run if the user already has a crontab installed. All OSes that I know > > of have exit code 0 when a crontab exists. I tried running the suite > > on Debian 8 and it runs as expected both without a crontab (tests > > run) and with a crontab installed (no tests run).
> > Oh, this part was not clear to me. I thought have_crontab() > was trying to detect the presence of a 'crontab' > command, not if the user has a crontab file. Your comment in > https://rt.cpan.org/Public/Bug/Display.html?id=59578#txn-921606 > seemed to support this. > > Having the tests skipped with 'no crontab available' when the user has > an installed crontab seems confusing to me. > > Is this just a safety precaution? The test suite doesn't actually seem > to manipulate user crontabs - judging by strace it never calls the > crontab command except in the have_crontab() check.
Skipping tests in the presence of a crontab is a safety feature. Should the user abort the tests, their crontab may be put into an inconsistent state. I could clean things up with an END block or something, but don't want to be responsible for someone's cron not running. I appreciate your looking at the module, though. Never hurts to ask :) Scott