aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-13 20:28:01 +0000
committertv <tv@krebsco.de>2026-11-13 21:59:20 +0100
commita8db913b7144dbcdbe479f32c12c4dd8c21e0675 (patch)
tree098c0668d0e420a6891a8a2f204fbdd1a2b6c879 /tests
parent24fd14b1e6de45def6a59b65486f5035ac486ee3 (diff)
populate: run pipe commands through a shell
A pipe source's command is an absolute path, which a shell runs as a script if it isn't a program, e.g. lacks #!. The program ran it directly, which fails for such a command. pipe-script runs a pipe command without #!.
Diffstat (limited to 'tests')
-rw-r--r--tests/scenarios.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/scenarios.nix b/tests/scenarios.nix
index 15d0a53..362a854 100644
--- a/tests/scenarios.nix
+++ b/tests/scenarios.nix
@@ -1176,6 +1176,19 @@ assert !(krops.isLocalTarget (targets.remote "/"));
expect.fail = "error: flake /fixtures/top has no input nope";
}];
})
+ # A pipe command without #!, which a shell runs as a script.
+ (s "pipe-script" {
+ prepareDeployer = ''
+ printf 'echo piped\n' > /tmp/pipe-script
+ chmod +x /tmp/pipe-script
+ '';
+ phases = [{
+ sources.x.pipe = "/tmp/pipe-script";
+ check = ''
+ expect_eq x "$(cat "$T"/x)" piped
+ '';
+ }];
+ })
# An input locked to a path the target doesn't have.
(s "gone" {
phases = [{