nix/tests/functional/zstd.sh

33 lines
511 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
2021-04-09 21:13:08 +00:00
source common.sh
TODO_NixOS
2021-04-09 21:13:08 +00:00
clearStore
clearCache
cacheURI="file://$cacheDir?compression=zstd"
outPath=$(nix-build dependencies.nix --no-out-link)
nix copy --to "$cacheURI" "$outPath"
2021-04-09 21:13:08 +00:00
HASH=$(nix hash path "$outPath")
2021-04-09 21:13:08 +00:00
clearStore
clearCacheCache
nix copy --from "$cacheURI" "$outPath" --no-check-sigs
2021-04-09 21:13:08 +00:00
if ls "$cacheDir/nar/"*.zst &> /dev/null; then
2021-04-09 21:13:08 +00:00
echo "files do exist"
else
echo "nars do not exist"
exit 1
fi
HASH2=$(nix hash path "$outPath")
2021-04-09 21:13:08 +00:00
[[ "$HASH" = "$HASH2" ]]