summaryrefslogtreecommitdiff
path: root/gnu/tests/base.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-08-28 23:15:27 +0200
committerLudovic Courtès <ludo@gnu.org>2016-08-29 00:09:44 +0200
commit40d28609f759b1445583f6f77005f92295f1213b (patch)
tree61158076d74eeab3c1792be3d4fd6e34fff5dce6 /gnu/tests/base.scm
parentbcce05a00b20db0135b912203b9fbaff450afb6d (diff)
downloadpatches-40d28609f759b1445583f6f77005f92295f1213b.tar
patches-40d28609f759b1445583f6f77005f92295f1213b.tar.gz
tests: Make sure /run/current-system is a GC root.
* gnu/tests/base.scm (run-basic-test)["/run/current-system is a GC root"]: New test.
Diffstat (limited to 'gnu/tests/base.scm')
-rw-r--r--gnu/tests/base.scm27
1 files changed, 27 insertions, 0 deletions
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 7170ab1e38..0076566c27 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -190,6 +190,33 @@ info --version")
(setlocale LC_ALL before)))
marionette))
+ (test-assert "/run/current-system is a GC root"
+ (marionette-eval '(begin
+ ;; Make sure the (guix …) modules are found.
+ (eval-when (expand load eval)
+ (set! %load-path
+ (cons
+ (string-append
+ "/run/current-system/profile/share/guile/site/"
+ (effective-version))
+ %load-path))
+ (set! %load-compiled-path
+ (cons
+ (string-append
+ "/run/current-system/profile/share/guile/site/"
+ (effective-version))
+ %load-compiled-path)))
+
+ (use-modules (srfi srfi-34) (guix store))
+
+ (let ((system (readlink "/run/current-system")))
+ (guard (c ((nix-protocol-error? c)
+ (file-exists? system)))
+ (with-store store
+ (delete-paths store (list system))
+ #f))))
+ marionette))
+
(test-assert "screendump"
(begin
(marionette-control (string-append "screendump " #$output