guix-commits
[Top][All Lists]
Advanced

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

03/07: tests: Check the mtime and permissions of substituted items.


From: guix-commits
Subject: 03/07: tests: Check the mtime and permissions of substituted items.
Date: Sat, 19 Dec 2020 17:28:32 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 77a1efed9e12ce0e2c470d7b0601ae70c72b010b
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Dec 14 14:33:06 2020 +0100

    tests: Check the mtime and permissions of substituted items.
    
    * tests/store.scm ("substitute")
    ("substitute + build-things with output path")
    ("substitute + build-things with specific output"): Call 'canonical-file?'.
    * tests/substitute.scm ("substitute, authorized key"): Check the mtime
    and permissions of "substitute-retrieved".
---
 tests/store.scm      | 3 +++
 tests/substitute.scm | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/store.scm b/tests/store.scm
index 7f1ec51..4dc125b 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -715,6 +715,7 @@
                            #:substitute-urls (%test-substitute-urls))
         (and (has-substitutes? s o)
              (build-derivations s (list d))
+             (canonical-file? o)
              (equal? c (call-with-input-file o get-string-all)))))))
 
 (test-assert "substitute + build-things with output path"
@@ -735,6 +736,7 @@
         (and (has-substitutes? s o)
              (build-things s (list o))            ;give the output path
              (valid-path? s o)
+             (canonical-file? o)
              (equal? c (call-with-input-file o get-string-all)))))))
 
 (test-assert "substitute + build-things with specific output"
@@ -755,6 +757,7 @@
              (build-things s `((,(derivation-file-name d) . "out")))
 
              (valid-path? s o)
+             (canonical-file? o)
              (equal? c (call-with-input-file o get-string-all)))))))
 
 (test-assert "substitute, corrupt output hash"
diff --git a/tests/substitute.scm b/tests/substitute.scm
index 5b42632..542aaf6 100644
--- a/tests/substitute.scm
+++ b/tests/substitute.scm
@@ -378,7 +378,7 @@ System: mips64el-linux\n")))
         (guix-substitute "--substitute")))))
 
 (test-equal "substitute, authorized key"
-  "Substitutable data."
+  '("Substitutable data." 1 #o444)
   (with-narinfo (string-append %narinfo "Signature: "
                                (signature-field %narinfo))
     (dynamic-wind
@@ -387,7 +387,9 @@ System: mips64el-linux\n")))
         (request-substitution (string-append (%store-prefix)
                                              
"/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
                               "substitute-retrieved")
-        (call-with-input-file "substitute-retrieved" get-string-all))
+        (list (call-with-input-file "substitute-retrieved" get-string-all)
+              (stat:mtime (lstat "substitute-retrieved"))
+              (stat:perms (lstat "substitute-retrieved"))))
       (lambda ()
         (false-if-exception (delete-file "substitute-retrieved"))))))
 



reply via email to

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