Merge pull request 'zfs: the scheduled run names its minutes, so its timer starts (issue 1979)' (#674) from fix/1979-scrub-schedule-list into main
This commit was merged in pull request #674.
This commit is contained in:
@@ -121,10 +121,16 @@ func TestExactlyOneScrubScheduleAndNoSettingInAUnitFile(t *testing.T) {
|
||||
}
|
||||
run := byID["scrub-run"]
|
||||
args, _ := run["run"].([]any)
|
||||
if run["type"] != "process" || run["name"] != "zfs-mesh-scrub" || run["schedule"] != "*/15 * * * *" || run["user"] != nil ||
|
||||
if run["type"] != "process" || run["name"] != "zfs-mesh-scrub" || run["schedule"] != "0,15,30,45 * * * *" || run["user"] != nil ||
|
||||
len(args) != 2 || args[1] != "scrub-run" {
|
||||
t.Errorf("the scheduled run: %v", run)
|
||||
}
|
||||
// The node-engine writes a cron step ("*/15") as a calendar systemd refuses ("*:*/15"), and the timer never
|
||||
// starts (novox/hq issue 1979, on the home server 2026-11-12). A list of minutes is written as a calendar
|
||||
// systemd takes ("*-*-* *:0,15,30,45:00"), so the schedule names its minutes and never a step.
|
||||
if s, _ := run["schedule"].(string); strings.Contains(s, "/") {
|
||||
t.Errorf("the scheduled run's schedule %q uses a step, which the node-engine writes as a calendar systemd refuses", s)
|
||||
}
|
||||
if ScrubTimer != run["name"].(string)+".timer" || ScrubService != run["name"].(string)+".service" {
|
||||
t.Errorf("the tools read %s and %s; the node-engine names them after %v", ScrubTimer, ScrubService, run["name"])
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
"./zfs-tools",
|
||||
"scrub-run"
|
||||
],
|
||||
"schedule": "*/15 * * * *"
|
||||
"schedule": "0,15,30,45 * * * *"
|
||||
},
|
||||
{
|
||||
"id": "distribution-weekly",
|
||||
|
||||
Reference in New Issue
Block a user