summary refs log tree commit diff
path: root/tests/store.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-04-12 22:32:10 +0200
committerLudovic Courtès <ludo@gnu.org>2014-04-12 22:32:10 +0200
commita9d2a10546b128c3d6df5665ef6dab929cb3db39 (patch)
treed3df68734fc6e550c01c890ba5567553cf1ff41b /tests/store.scm
parentca2baf10bad8433e92d7dde6629946f54043d63f (diff)
downloadguix-a9d2a10546b128c3d6df5665ef6dab929cb3db39.tar.gz
store: Add 'add-permanent-root' and 'remove-permanent-root'.
* guix/store.scm (add-indirect-root): Improve docstring.
  (%gc-roots-directory): New variable.
  (add-permanent-root, remove-permanent-root): New procedures.
* tests/store.scm ("permanent root"): New test.
Diffstat (limited to 'tests/store.scm')
-rw-r--r--tests/store.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/store.scm b/tests/store.scm
index 3932a8eb45..90137b9754 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -147,6 +147,18 @@
 ;;          (valid-path? %store p1)
 ;;          (member (pk p2) (live-paths %store)))))
 
+(test-assert "permanent root"
+  (let* ((p  (with-store store
+               (let ((p (add-text-to-store store "random-text"
+                                           (random-text))))
+                 (add-permanent-root p)
+                 (add-permanent-root p)           ; should not throw
+                 p))))
+    (and (member p (live-paths %store))
+         (begin
+           (remove-permanent-root p)
+           (->bool (member p (dead-paths %store)))))))
+
 (test-assert "dead path can be explicitly collected"
   (let ((p (add-text-to-store %store "random-text"
                               (random-text) '())))