diff options
author | regnat <rg@regnat.ovh> | 2021-04-22 17:54:02 +0200 |
---|---|---|
committer | regnat <rg@regnat.ovh> | 2021-04-22 20:07:02 +0200 |
commit | b1711071d1a22a1c28448823634b0dc7212e4fe5 (patch) | |
tree | adbc902153e16ba6a7640c9b97f6cdeb2869a559 /tests/ca | |
parent | d9864be4b757468d33bc49edddce5e4f04ef4b90 (diff) |
Add a regression test for #4725
Diffstat (limited to 'tests/ca')
-rw-r--r-- | tests/ca/substitute.sh | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/ca/substitute.sh b/tests/ca/substitute.sh index b44fe499a..5d0fc6a87 100644 --- a/tests/ca/substitute.sh +++ b/tests/ca/substitute.sh @@ -8,7 +8,8 @@ sed -i 's/experimental-features .*/& ca-derivations ca-references/' "$NIX_CONF_D rm -rf $TEST_ROOT/binary_cache -export REMOTE_STORE=file://$TEST_ROOT/binary_cache +export REMOTE_STORE_DIR=$TEST_ROOT/binary_cache +export REMOTE_STORE=file://$REMOTE_STORE_DIR buildDrvs () { nix build --file ./content-addressed.nix -L --no-link "$@" @@ -22,3 +23,20 @@ buildDrvs --post-build-hook ../push-to-store.sh clearStore buildDrvs --substitute --substituters $REMOTE_STORE --no-require-sigs -j0 +# Same thing, but +# 1. With non-ca derivations +# 2. Erasing the realisations on the remote store +# +# Even in that case, realising the derivations should still produce the right +# realisations on the local store +# +# Regression test for #4725 +clearStore +nix build --file ../simple.nix -L --no-link --post-build-hook ../push-to-store.sh +clearStore +rm -r "$REMOTE_STORE_DIR/realisations" +nix build --file ../simple.nix -L --no-link --substitute --substituters "$REMOTE_STORE" --no-require-sigs -j0 +if [[ $(sqlite3 "$NIX_STATE_DIR/db/db.sqlite" 'select count(*) from Realisations') -eq 0 ]]; then + echo "Realisations not rebuilt" + exit 1 +fi |