emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#36953: closed ([PATCH] reconfigure: Improve tests


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#36953: closed ([PATCH] reconfigure: Improve tests for system activation.)
Date: Wed, 07 Aug 2019 19:35:02 +0000

Your message dated Wed, 07 Aug 2019 15:34:16 -0400
with message-id <address@hidden>
and subject line Re: [bug#36953] [PATCH] reconfigure: Improve tests for system 
activation.
has caused the debbugs.gnu.org bug report #36953,
regarding [PATCH] reconfigure: Improve tests for system activation.
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden.)


-- 
36953: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36953
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] reconfigure: Improve tests for system activation. Date: Wed, 07 Aug 2019 08:42:42 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
* gnu/tests/reconfigure.scm (run-switch-to-system-test): Assert that
'/run/current-system' points to the activated system, and that new user
accounts specified in the operating system declaration are created.
---
 gnu/tests/reconfigure.scm | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/gnu/tests/reconfigure.scm b/gnu/tests/reconfigure.scm
index 3a2f0a2e53..fb11e6164e 100644
--- a/gnu/tests/reconfigure.scm
+++ b/gnu/tests/reconfigure.scm
@@ -19,8 +19,10 @@
 (define-module (gnu tests reconfigure)
   #:use-module (gnu bootloader)
   #:use-module (gnu services shepherd)
-  #:use-module (gnu system vm)
   #:use-module (gnu system)
+  #:use-module (gnu system accounts)
+  #:use-module (gnu system shadow)
+  #:use-module (gnu system vm)
   #:use-module (gnu tests)
   #:use-module (guix derivations)
   #:use-module (guix gexp)
@@ -43,7 +45,13 @@
 generation of the system profile."
   (define os
     (marionette-operating-system
-     (simple-operating-system)
+     (operating-system
+       (inherit (simple-operating-system))
+       (users (cons (user-account
+                     (name "jakob")
+                     (group "users")
+                     (home-directory "/home/jakob"))
+                    %base-user-accounts)))
      #:imported-modules '((gnu services herd)
                           (guix combinators))))
 
@@ -84,7 +92,25 @@ generation of the system profile."
 
             (test-equal "script created new generation"
               (length (system-generations marionette))
-              (1+ (length generations-prior))))
+              (1+ (length generations-prior)))
+
+            (test-assert "script activated the new generation"
+              (and (eqv? 'symlink
+                         (marionette-eval
+                          '(stat:type (lstat "/run/current-system"))
+                          marionette))
+                   (string= #$os
+                            (marionette-eval
+                             '(readlink "/run/current-system")
+                             marionette))))
+
+            (test-assert "script activated user accounts"
+              (marionette-eval
+               '(string-contains (call-with-input-file "/etc/passwd"
+                                   (lambda (port)
+                                     (get-string-all port)))
+                                 "jakob")
+               marionette)))
 
           (test-end)
           (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
-- 
2.22.0

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message --- Subject: Re: [bug#36953] [PATCH] reconfigure: Improve tests for system activation. Date: Wed, 07 Aug 2019 15:34:16 -0400 User-agent: mu4e 1.2.0; emacs 26.2
Jakob L. Kreuze writes:

> +       (users (cons (user-account
> +                     (name "jakob")
> +                     (group "users")
> +                     (home-directory "/home/jakob"))
> +                    %base-user-accounts)))

Welcome to the test machine, jakob ;)

Looks great.  Merged and pushed.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]