fix(scheduled-jobs): an own job goes to /etc/cron.d only where the host has it
driver / standard (pull_request) Successful in 19s
driver / lint (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m12s
driver / test (3.12) (pull_request) Successful in 1m21s
driver / lowest (pull_request) Successful in 39s
driver / test (3.13) (pull_request) Successful in 1m21s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m7s
CI / driver (pull_request) Successful in 3m3s
driver / publish (pull_request) Skipped

BusyBox crond reads no /etc/cron.d, so an Alpine host without systemd
takes the job in the user's crontab instead of a file it would never run.

Refs #86
This commit is contained in:
christianmanivong committed 2026-11-03 05:30:19 +01:00
1 parent f573fa53d2
commit 834cb2e0ea
2 files changed
+17 -2

No files matched your search

+6
View File
@@ -484,6 +484,12 @@ class TestApplicationJobs:
host.delete_scheduled_job("job:netork-tidy", digest=job["digest"])
assert (root / "spool/nobody").read_text() == ""
def test_a_cron_d_that_is_not_there_is_the_crontab(self, root: Path):
host = Host(root, systemd=False)
host.OWN_CRON_D_DIR = str(root / "etc/no-cron.d") # type: ignore[misc]
host.put_scheduled_job(SPEC)
assert "netork-tidy" in (root / "spool/root").read_text()
def test_a_cron_line_holds_one_line(self, root: Path):
with pytest.raises(ScheduledJobRefused, match="one line"):
Host(root, systemd=False).put_scheduled_job({**SPEC, "command": "a\nb"})