aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/tests/scenarios.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/populate/tests/scenarios.nix')
-rw-r--r--pkgs/populate/tests/scenarios.nix35
1 files changed, 34 insertions, 1 deletions
diff --git a/pkgs/populate/tests/scenarios.nix b/pkgs/populate/tests/scenarios.nix
index f7ece9a..dac8e6b 100644
--- a/pkgs/populate/tests/scenarios.nix
+++ b/pkgs/populate/tests/scenarios.nix
@@ -468,7 +468,40 @@ in
expect_eq x "$(cat "$T"/x)" piped
'';
};
- });
+ })
+ # A directory the command makes: delivered with the modes it has, and
+ # mirrored, when what the command makes changes.
+ ++ map (targetKind: scenario (let
+ sources.x.pipe = { command = "/fixtures/pipe-dir"; directory = true; };
+ secret = value: ''
+ expect_eq secret "$(cat "$T"/x/sub/deep/secret)" ${value}
+ expect_eq modes "$(stat -c %a "$T"/x "$T"/x/sub "$T"/x/sub/deep "$T"/x/sub/deep/secret | paste -s -d ' ' -)" "700 700 700 600"
+ '';
+ in {
+ name = "pipe-directory-${targetKind}";
+ inherit targetKind;
+ prepareDeployer = ''
+ echo one > /fixtures/pipe-dir-data
+ '';
+ phases = [
+ {
+ inherit sources;
+ check = secret "one";
+ mutate = ''
+ echo stray > "$T"/x/stray
+ '';
+ mutateDeployer = ''
+ echo two > /fixtures/pipe-dir-data
+ '';
+ }
+ {
+ inherit sources;
+ check = secret "two" + ''
+ test ! -e "$T"/x/stray || fail "stray not removed"
+ '';
+ }
+ ];
+ })) targetKinds;
symlink = matrix "symlink" {
absolute = [ false true ];
[cgit] Unable to lock slot /tmp/cgit/cb200000.lock: Permission denied (13)