[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#45253] [PATCH 3/6] tests: Check the mtime and permissions of substi
From: |
Ludovic Courtès |
Subject: |
[bug#45253] [PATCH 3/6] tests: Check the mtime and permissions of substituted items. |
Date: |
Tue, 15 Dec 2020 10:57:27 +0100 |
* 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 7f1ec51875..4dc125bcb9 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 241c55a1f8..4f55a14957 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"))))))
--
2.29.2
- [bug#45253] [PATCH 0/6] Pipeline substitute integrity check, deduplication, and canonicalization, Ludovic Courtès, 2020/12/15
- [bug#45253] [PATCH 1/6] tests: Check the build trace for hash mismatches on substitutes., Ludovic Courtès, 2020/12/15
- [bug#45253] [PATCH 0/6] Pipeline substitute integrity check, deduplication, and canonicalization, Ludovic Courtès, 2020/12/15
- bug#45253: [PATCH 0/6] Pipeline substitute integrity check, deduplication, and canonicalization, Ludovic Courtès, 2020/12/19