about summary refs log tree commit diff
path: root/tests/repair.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-17T22·24+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-17T22·24+0100
commit4ec626a286afd4a9596357fc6d36aaf8bc07442a (patch)
tree5d98c77f044f4e14f83777f4aa234109fc26f869 /tests/repair.sh
parent99f14c25842a897a1a352a3b3be7c0362cb0313f (diff)
Test nix-store --verify-path and --repair-path
Diffstat (limited to 'tests/repair.sh')
-rw-r--r--tests/repair.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/repair.sh b/tests/repair.sh
index f17aef2771f9..ae82b649c6ac 100644
--- a/tests/repair.sh
+++ b/tests/repair.sh
@@ -45,3 +45,21 @@ if [ "$(nix-hash $path2)" != "$hash" -o -e $path2/bad ]; then
     echo "path not repaired properly" >&2
     exit 1
 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