guix-commits
[Top][All Lists]
Advanced

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

04/05: tests: 'getlogin' test creates its file atomically.


From: guix-commits
Subject: 04/05: tests: 'getlogin' test creates its file atomically.
Date: Wed, 15 May 2019 06:19:05 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 8b310793d2b7d3cf5b3a5301423640dcf68e2528
Author: Ludovic Courtès <address@hidden>
Date:   Wed May 15 12:09:48 2019 +0200

    tests: 'getlogin' test creates its file atomically.
    
    Previously we could end up reading an empty /root/login-id file.
    
    * gnu/tests/base.scm (run-basic-test)["getlogin on tty1"]: Create
    /root/login-id atomically.
---
 gnu/tests/base.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index d578f19..cf942fe 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -311,7 +311,9 @@ info --version")
             "\"root\""
             (begin
               ;; Assume we logged in in the previous test and type.
-              (marionette-type "guile -c '(write (getlogin))' > 
/root/login-id\n"
+              (marionette-type "guile -c '(write (getlogin))' > 
/root/login-id.tmp\n"
+                               marionette)
+              (marionette-type "mv /root/login-id{.tmp,}\n"
                                marionette)
 
               ;; It can take a while before the shell commands are executed.



reply via email to

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