summaryrefslogtreecommitdiff
path: root/gnu/tests/foreign.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/tests/foreign.scm')
-rw-r--r--gnu/tests/foreign.scm73
1 files changed, 3 insertions, 70 deletions
diff --git a/gnu/tests/foreign.scm b/gnu/tests/foreign.scm
index 9aba803c4d..79436bf5f2 100644
--- a/gnu/tests/foreign.scm
+++ b/gnu/tests/foreign.scm
@@ -27,7 +27,8 @@
#:use-module (gnu compression)
#:use-module (gnu tests)
#:use-module ((gnu tests base)
- #:select (%hello-dependencies-manifest))
+ #:select (%hello-dependencies-manifest
+ guix-daemon-test-cases))
#:use-module (gnu packages base)
#:use-module (gnu packages bootstrap)
#:use-module (gnu packages guile)
@@ -237,81 +238,13 @@ GNU/Linux distro, and check that the installation is functional."
(%store-prefix))))))
marionette))
- (test-equal "hello not already built"
- #f
- ;; Check that the next test will really build 'hello'.
- (marionette-eval '(file-exists?
- #$(with-parameters ((%graft? #f))
- hello))
- marionette))
-
- (test-equal "guix build hello"
- 0
- ;; Check that guix-daemon is up and running and that the build
- ;; environment is properly set up (build users, etc.).
- (marionette-eval '(system* "guix" "build" "hello" "--no-grafts")
- marionette))
-
- (test-assert "hello indeed built"
- (marionette-eval '(file-exists?
- #$(with-parameters ((%graft? #f))
- hello))
- marionette))
-
- (test-equal "guix install hello"
- 0
- ;; Check that ~/.guix-profile & co. are properly created.
- (marionette-eval '(let ((pw (getpwuid (getuid))))
- (setenv "USER" (passwd:name pw))
- (setenv "HOME" (pk 'home (passwd:dir pw)))
- (system* "guix" "install" "hello"
- "--no-grafts" "--bootstrap"))
- marionette))
-
- (test-equal "user profile created"
- 0
- (marionette-eval '(system "ls -lad ~/.guix-profile")
- marionette))
-
- (test-equal "hello"
- 0
- (marionette-eval '(system "~/.guix-profile/bin/hello")
- marionette))
-
(test-equal "create user account"
0
(marionette-eval '(system* "useradd" "-d" "/home/user" "-m"
"user")
marionette))
- (test-equal "guix install hello, unprivileged user"
- 0
- ;; Check that 'guix' is in $PATH for new users and that
- ;; ~user/.guix-profile also gets created.
- (marionette-eval '(system "su - user -c \
-'guix install hello --no-grafts --bootstrap'")
- marionette))
-
- (test-equal "user hello"
- 0
- (marionette-eval '(system "~user/.guix-profile/bin/hello")
- marionette))
-
- (test-equal "unprivileged user profile created"
- 0
- (marionette-eval '(system "ls -lad ~user/.guix-profile")
- marionette))
-
- (test-equal "store is read-only"
- EROFS
- (marionette-eval '(catch 'system-error
- (lambda ()
- (mkdir (in-vicinity #$(%store-prefix)
- "whatever"))
- 0)
- (lambda args
- (system-error-errno args)))
- marionette))
+ #$(guix-daemon-test-cases #~marionette)
(test-assert "screenshot after"
(marionette-control (string-append "screendump " #$output