[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#41382] [PATCH 1/6] tests: Test 'add-to-store' with several hash alg
From: |
Ludovic Courtès |
Subject: |
[bug#41382] [PATCH 1/6] tests: Test 'add-to-store' with several hash algorithms. |
Date: |
Mon, 18 May 2020 23:32:39 +0200 |
* tests/store.scm ("add-to-store"): New test.
---
tests/store.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tests/store.scm b/tests/store.scm
index 0af099c1ad..f007846dc1 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -115,6 +115,18 @@
(passwd:name (getpwuid (getuid)))))))
(list (stat:uid s) (stat:perms s))))
+(test-equal "add-to-store"
+ '("sha1" "sha256" "sha512")
+ (let* ((file (search-path %load-path "guix.scm"))
+ (content (call-with-input-file file get-bytevector-all)))
+ (map (lambda (hash-algo)
+ (let ((file (add-to-store %store "guix.scm" #f hash-algo file)))
+ (and (direct-store-path? file)
+ (bytevector=? (call-with-input-file file get-bytevector-all)
+ content)
+ hash-algo)))
+ '("sha1" "sha256" "sha512"))))
+
(test-equal "add-data-to-store"
#vu8(1 2 3 4 5)
(call-with-input-file (add-data-to-store %store "data" #vu8(1 2 3 4 5))
--
2.26.2
- [bug#41382] [PATCH 0/6] Allow for a cryptographic hash function migration, Ludovic Courtès, 2020/05/18
- [bug#41382] [PATCH 1/6] tests: Test 'add-to-store' with several hash algorithms.,
Ludovic Courtès <=
- [bug#41382] [PATCH 3/6] guix hash, guix download: Add '--hash'., Ludovic Courtès, 2020/05/18
- [bug#41382] [PATCH 2/6] tests: Test fixed-output derivations with several hash algorithms., Ludovic Courtès, 2020/05/18
- [bug#41382] [PATCH 5/6] packages: Add 'sha512' optional field to <origin>., Ludovic Courtès, 2020/05/18
- [bug#41382] [PATCH 4/6] guix hash, guix download: Support base64 format., Ludovic Courtès, 2020/05/18
- [bug#41382] [PATCH 6/6] packages: Add 'base64' macro., Ludovic Courtès, 2020/05/18
- [bug#41382] [PATCH 0/6] Allow for a cryptographic hash function migration, Ludovic Courtès, 2020/05/19