zfs: fix qbittorrent

This commit is contained in:
2025-11-20 16:17:09 -05:00
parent ae5189b6c6
commit 223910744a
3 changed files with 67 additions and 50 deletions

View File

@@ -21,6 +21,10 @@ testPkgs.testers.runNixOSTest {
# Test service with paths outside zpool (should fail assertion)
(lib.serviceMountWithZpool "invalid-service" "rpool2" [ "/mnt/rpool_data" ])
# Test multi-command logic: service with multiple serviceMountWithZpool calls
(lib.serviceMountWithZpool "multi-service" "rpool" [ "/mnt/rpool_data" ])
(lib.serviceMountWithZpool "multi-service" "rpool2" [ "/mnt/rpool2_data" ])
];
virtualisation = {
@@ -56,6 +60,14 @@ testPkgs.testers.runNixOSTest {
ExecStart = lib.getExe pkgs.bash;
};
};
systemd.services."multi-service" = {
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = lib.getExe pkgs.bash;
};
};
};
testScript = ''
@@ -105,6 +117,7 @@ testPkgs.testers.runNixOSTest {
assert "Expected pool: rpool2" in journal_output
assert "Actual pool: rpool" in journal_output
print("SUCCESS: Runtime validation correctly detected zpool mismatch!")
machine.succeed("systemctl start multi-service")
machine.succeed("systemctl is-active multi-service-mounts.service")
'';
}