aboutsummaryrefslogtreecommitdiff
path: root/tests/impure-derivations.sh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-03-31 17:38:15 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-03-31 17:38:15 +0200
commit6377442c983f4399d0a997238b898298e349fc1b (patch)
tree4d93fd4bddea1f002a6ff63191ac391fc862577a /tests/impure-derivations.sh
parentd63a5f5dd3b47e629295eb68264b4a6aadc65aa7 (diff)
tests/impure-derivations.sh: Ensure that inputAddressed build fails
Diffstat (limited to 'tests/impure-derivations.sh')
-rw-r--r--tests/impure-derivations.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/impure-derivations.sh b/tests/impure-derivations.sh
index aab5cb61a..35ae3f5d3 100644
--- a/tests/impure-derivations.sh
+++ b/tests/impure-derivations.sh
@@ -5,6 +5,8 @@ requireDaemonNewerThan "2.8pre20220311"
enableFeatures "ca-derivations ca-references impure-derivations"
restartDaemon
+set -o pipefail
+
clearStore
# Basic test of impure derivations: building one a second time should not use the previous result.
@@ -33,7 +35,7 @@ path4=$(nix build -L --no-link --json --file ./impure-derivations.nix impureOnIm
[[ $(< $path4/self/n) = X3 ]]
# Input-addressed derivations cannot depend on impure derivations directly.
-nix build -L --no-link --json --file ./impure-derivations.nix inputAddressed 2>&1 | grep 'depends on impure derivation'
+(! nix build -L --no-link --json --file ./impure-derivations.nix inputAddressed 2>&1) | grep 'depends on impure derivation'
drvPath=$(nix eval --json --file ./impure-derivations.nix impure.drvPath | jq -r .)
[[ $(nix show-derivation $drvPath | jq ".[\"$drvPath\"].outputs.out.impure") = true ]]