GNU bug report logs - #36953
[PATCH] reconfigure: Improve tests for system activation.

Previous Next

Package: guix-patches;

Reported by: zerodaysfordays <at> sdf.lonestar.org (Jakob L. Kreuze)

Date: Wed, 7 Aug 2019 12:46:03 UTC

Severity: normal

Tags: patch

Done: Christopher Lemmer Webber <cwebber <at> dustycloud.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36953 in the body.
You can then email your comments to 36953 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#36953; Package guix-patches. (Wed, 07 Aug 2019 12:46:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to zerodaysfordays <at> sdf.lonestar.org (Jakob L. Kreuze):
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 07 Aug 2019 12:46:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: zerodaysfordays <at> sdf.lonestar.org (Jakob L. Kreuze)
To: guix-patches <at> gnu.org
Subject: [PATCH] reconfigure: Improve tests for system activation.
Date: Wed, 07 Aug 2019 08:42:42 -0400
[Message part 1 (text/plain, inline)]
* 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

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#36953; Package guix-patches. (Wed, 07 Aug 2019 19:35:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Lemmer Webber <cwebber <at> dustycloud.org>
To: guix-patches <at> gnu.org
Cc: 36953-done <at> debbugs.gnu.org
Subject: Re: [bug#36953] [PATCH] reconfigure: Improve tests for system
 activation.
Date: Wed, 07 Aug 2019 15:34:16 -0400
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.




Reply sent to Christopher Lemmer Webber <cwebber <at> dustycloud.org>:
You have taken responsibility. (Wed, 07 Aug 2019 19:35:02 GMT) Full text and rfc822 format available.

Notification sent to zerodaysfordays <at> sdf.lonestar.org (Jakob L. Kreuze):
bug acknowledged by developer. (Wed, 07 Aug 2019 19:35:03 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#36953; Package guix-patches. (Wed, 07 Aug 2019 20:49:02 GMT) Full text and rfc822 format available.

Message #16 received at 36953 <at> debbugs.gnu.org (full text, mbox):

From: zerodaysfordays <at> sdf.lonestar.org (Jakob L. Kreuze)
To: 36953 <at> debbugs.gnu.org
Cc: cwebber <at> dustycloud.org
Subject: Re: bug#36953: [PATCH] reconfigure: Improve tests for system
 activation.
Date: Wed, 07 Aug 2019 16:44:54 -0400
[Message part 1 (text/plain, inline)]
Christopher Lemmer Webber <cwebber <at> dustycloud.org> writes:

> 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 ;)

Heh, I'm pretty bad at coming up with names for examples. Maybe I should
take inspiration from you and use Eva Lu Ator or Alyssa P. Hacker next
time the need arises ;)

> Looks great.  Merged and pushed.

Thanks!

Regards,
Jakob
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 05 Sep 2019 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 233 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.