aboutsummaryrefslogtreecommitdiff
path: root/tests/ca/substitute.sh
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2020-11-09 16:04:43 +0100
committerregnat <rg@regnat.ovh>2021-03-01 14:00:17 +0100
commit93b5a59b674c0a29846828c7d14b434cc954f8ee (patch)
treef1d0f1c3e5ac5ec1facc66160bb2f015b7159041 /tests/ca/substitute.sh
parentdf9d4f88d5aed0aa4ed67eb012e9f260550b7200 (diff)
Add a test for the remote caching of CA derivations
Diffstat (limited to 'tests/ca/substitute.sh')
-rw-r--r--tests/ca/substitute.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ca/substitute.sh b/tests/ca/substitute.sh
new file mode 100644
index 000000000..79a6ef8b1
--- /dev/null
+++ b/tests/ca/substitute.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+# Ensure that binary substitution works properly with ca derivations
+
+source common.sh
+
+sed -i 's/experimental-features .*/& ca-derivations ca-references/' "$NIX_CONF_DIR"/nix.conf
+
+export REMOTE_STORE=file://$TEST_ROOT/binary_cache
+
+buildDrvs () {
+ nix build --file ./content-addressed.nix -L --no-link "$@"
+}
+
+# Populate the remote cache
+buildDrvs --post-build-hook ../push-to-store.sh
+
+# Restart the build on an empty store, ensuring that we don't build
+clearStore
+buildDrvs --substitute --substituters $REMOTE_STORE --no-require-sigs -j0
+