pytest-testinfra icon indicating copy to clipboard operation
pytest-testinfra copied to clipboard

Add a cron module

Open rgarrigue opened this issue 6 years ago • 0 comments

Hi

After searching quickly in the issues, I see no mention of checking cron job, hence this feature request.

Here's my use case : I'm testing Ansible Roles via Molecule and Testinfra. Which include ansible tasks like

---
- name: Add cron job for certbot renewal (if configured).
  cron:
    name: Certbot automatic renewal.
    job: "{{ certbot_script }} renew {{ certbot_auto_renew_options }}"
    minute: "{{ certbot_auto_renew_minute }}"
    hour: "{{ certbot_auto_renew_hour }}"
    user: "{{ certbot_auto_renew_user }}"

So I'ld like to check there's a job at the given hh:mm:ss for the given user and command.

Thanks again for this wonderful testinfra tool & best regards,

rgarrigue avatar Oct 07 '19 07:10 rgarrigue