Compare commits
2 changed files with 4 additions and 26 deletions
|
|
@ -62,7 +62,7 @@
|
|||
export HTTPS_PROXY=http://127.0.0.1:7000
|
||||
export NO_PROXY=localhost,127.0.0.1
|
||||
|
||||
trap "${pkgs.coreutils}/bin/kill $HTTP_SOCAT_PID || true" EXIT
|
||||
trap "${pkgs.coreutils}/bin/kill $HTTP_SOCAT_PID" EXIT
|
||||
|
||||
${command pkgs} "$@"
|
||||
'';
|
||||
|
|
@ -145,14 +145,14 @@
|
|||
${pkgs.socat}/bin/socat UNIX-LISTEN:"$JD/net.sock",fork TCP:127.0.0.1:"$FREE_PORT" &>/dev/null &
|
||||
SOCAT_PID=$!
|
||||
|
||||
trap "${pkgs.coreutils}/bin/rm -rf $JD; ${pkgs.coreutils}/bin/kill $PROXY_PID $SOCAT_PID || true" EXIT
|
||||
trap "${pkgs.coreutils}/bin/rm -rf $JD; ${pkgs.coreutils}/bin/kill $PROXY_PID $SOCAT_PID" EXIT
|
||||
|
||||
export NIX_CONFIG="
|
||||
''${NIX_CONFIG:-}
|
||||
extra-experimental-features = nix-command flakes
|
||||
substitute = true"
|
||||
|
||||
${jailed}/bin/unsafe-cell "$@"
|
||||
${jailed}/bin/unsafe-cell
|
||||
'';
|
||||
in
|
||||
host-script
|
||||
|
|
|
|||
24
tests.nix
24
tests.nix
|
|
@ -19,7 +19,6 @@ nixpkgs.lib.genAttrs
|
|||
logDir ? "$JD",
|
||||
worktreePath,
|
||||
nixDaemonSocket ? "/var/nix/daemon-socket",
|
||||
extraArgs ? "",
|
||||
}:
|
||||
let
|
||||
cell = unsafe-cell.lib.mkCell.${system} {
|
||||
|
|
@ -39,7 +38,7 @@ nixpkgs.lib.genAttrs
|
|||
export HOME=$(pwd)
|
||||
export LANG=C
|
||||
mkdir ./cell
|
||||
${cell} ${extraArgs}
|
||||
${cell}
|
||||
touch $out
|
||||
echo ":: test passed: ${name}"
|
||||
'';
|
||||
|
|
@ -380,27 +379,6 @@ nixpkgs.lib.genAttrs
|
|||
echo "ok 1 - extra combinator env var propagated"
|
||||
'';
|
||||
};
|
||||
|
||||
# CLI arguments forwarded into the jail
|
||||
cli-args = mkJailTest "cli-args" {
|
||||
worktreePath = "./cell";
|
||||
extraArgs = "foo bar baz";
|
||||
command =
|
||||
pkgs:
|
||||
pkgs.writeScript "cli-args" ''
|
||||
set -euo pipefail
|
||||
[ "$1" = "foo" ]
|
||||
echo "ok 2 - first arg is foo"
|
||||
|
||||
[ "$2" = "bar" ]
|
||||
echo "ok 3 - second arg is bar"
|
||||
|
||||
[ "$3" = "baz" ]
|
||||
echo "ok 4 - third arg is baz"
|
||||
|
||||
echo "PASS: CLI arguments forwarded correctly"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
allTests = builtins.attrValues tests;
|
||||
|
|
|
|||
Loading…
Reference in a new issue