From 910fe3e877ebcaf9bbb2ee13386454892eac6171 Mon Sep 17 00:00:00 2001 From: regnat Date: Tue, 27 Oct 2020 17:53:10 +0100 Subject: [PATCH] Add a test for copying CA derivations outputs --- tests/local.mk | 4 +++- tests/nix-copy-content-addressed.sh | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 tests/nix-copy-content-addressed.sh diff --git a/tests/local.mk b/tests/local.mk index 2ac035869c11..5dee5bc5c8b8 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -37,7 +37,9 @@ nix_tests = \ describe-stores.sh \ flakes.sh \ content-addressed.sh \ - build.sh + build.sh \ + content-addressed.sh \ + nix-copy-content-addressed.sh # parallel.sh # build-remote-content-addressed-fixed.sh \ diff --git a/tests/nix-copy-content-addressed.sh b/tests/nix-copy-content-addressed.sh new file mode 100644 index 000000000000..9b67a78859f9 --- /dev/null +++ b/tests/nix-copy-content-addressed.sh @@ -0,0 +1,24 @@ +source common.sh + +clearStore +clearCache + +commonArgs=( \ + --experimental-features 'nix-command flakes ca-derivations ca-references' \ + --file ./content-addressed.nix \ + -v +) + +remoteRoot=$TEST_ROOT/store2 +chmod -R u+w "$remoteRoot" || true +rm -rf "$remoteRoot" + +# Fill the remote cache +nix copy --to $remoteRoot --no-require-sigs "${commonArgs[@]}" +clearStore + +# Fetch the otput from the cache +nix copy --from $remoteRoot --no-require-sigs "${commonArgs[@]}" + +# Ensure that everything is locally present +nix build "${commonArgs[@]}" -j0 --no-link