aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-01-07 13:52:48 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-01-07 13:52:48 +0100
commit2ef7e2e795c57eaa37932fd2961952815e8b67df (patch)
treecc6842c177dd77e44d3e3da7fbbe47e627d18996 /tests
parent02a66b3fd7041d32a61852b5be41802920c59d2f (diff)
Fix repair test
http://hydra.nixos.org/build/30001635
Diffstat (limited to 'tests')
-rw-r--r--tests/repair.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/repair.sh b/tests/repair.sh
index ae82b649c..92f2f8fe6 100644
--- a/tests/repair.sh
+++ b/tests/repair.sh
@@ -18,6 +18,18 @@ if nix-store --verify --check-contents -v; then
exit 1
fi
+# The path can be repaired by rebuilding the derivation.
+nix-store --verify --check-contents --repair
+
+nix-store --verify-path $path2
+
+# Re-corrupt and delete the deriver. Now --verify --repair should
+# not work.
+chmod u+w $path2
+touch $path2/bad
+
+nix-store --delete $(nix-store -qd $path2)
+
if nix-store --verify --check-contents --repair; then
echo "nix-store --verify --repair succeeded unexpectedly" >&2
exit 1