Add type-aware backup job forms

This commit is contained in:
Mikei386
2026-06-14 12:46:11 +02:00
parent 92564a1620
commit 800cb60f83
13 changed files with 153 additions and 17 deletions
+11
View File
@@ -34,3 +34,14 @@ func TestRepositoryCannotBeSharedByJobs(t *testing.T) {
t.Fatal("shared repository accepted")
}
}
func TestDockerJobRequiresWorkloadSources(t *testing.T) {
job := Job{SchemaVersion: 1, ID: "docker-job", Name: "Docker", Type: JobDocker, RepositoryID: "repo", Sources: []Source{{Path: "/mnt/user/appdata"}}, Consistency: Consistency{Mode: "live"}, Compression: "auto"}
if err := ValidateJob(job); err == nil {
t.Fatal("docker path source accepted without workload selection")
}
job.Sources = []Source{{WorkloadID: "plex"}}
if err := ValidateJob(job); err != nil {
t.Fatalf("valid docker workload rejected: %v", err)
}
}