Test nix-store --verify-path and --repair-path

This commit is contained in:
Eelco Dolstra 2014-02-17 23:24:12 +01:00
parent 99f14c2584
commit 4ec626a286

View file

@ -45,3 +45,21 @@ if [ "$(nix-hash $path2)" != "$hash" -o -e $path2/bad ]; then
echo "path not repaired properly" >&2 echo "path not repaired properly" >&2
exit 1 exit 1
fi fi
# Check --verify-path and --repair-path.
nix-store --verify-path $path2
chmod u+w $path2
rm -rf $path2
if nix-store --verify-path $path2; then
echo "nix-store --verify-path succeeded unexpectedly" >&2
exit 1
fi
nix-store --repair-path $path2 --option binary-caches "file://$cacheDir"
if [ "$(nix-hash $path2)" != "$hash" -o -e $path2/bad ]; then
echo "path not repaired properly" >&2
exit 1
fi