diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2026-06-08 23:42:02 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-07-02 19:42:47 +0200 |
| commit | 26fe5af3e39405b19b8b52f6e3263cd9d1cb8653 (patch) | |
| tree | 40469b3a128acf6c4eeeec898edde400ae33380b | |
| parent | 0d28f34607fa6ea07463de88eb1d295e962a215d (diff) | |
tests: Fix improper narinfo ‘Deriver’ and ‘References’ field values.
The mistake was harmless because the ‘Deriver’ and ‘References’ field values
were unchecked so far.
* tests/substitute.scm (%narinfo)
("query narinfo with signature over irrelevant bits")
("query narinfo with signature over relevant subset")
("substitute, invalid hash")
("substitute, two invalid narinfos"): Remove store prefix from ‘Deriver’ field
value. Add hash part to ‘Deriver’ and ‘References’ values.
* tests/guix-daemon.sh: Likewise.
Change-Id: I0af4b9aa4b64cebf46d221ffab17bf5663b0cc11
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| -rw-r--r-- | tests/guix-daemon.sh | 4 | ||||
| -rw-r--r-- | tests/substitute.scm | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/guix-daemon.sh b/tests/guix-daemon.sh index 0aee853a0ca..6fc6034cc95 100644 --- a/tests/guix-daemon.sh +++ b/tests/guix-daemon.sh | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | # GNU Guix --- Functional package management for GNU | 1 | # GNU Guix --- Functional package management for GNU |
| 2 | # Copyright © 2012, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> | 2 | # Copyright © 2012, 2014-2019, 2026 Ludovic Courtès <ludo@gnu.org> |
| 3 | # | 3 | # |
| 4 | # This file is part of GNU Guix. | 4 | # This file is part of GNU Guix. |
| 5 | # | 5 | # |
| @@ -48,7 +48,7 @@ Compression: none | |||
| 48 | NarSize: 1234 | 48 | NarSize: 1234 |
| 49 | References: | 49 | References: |
| 50 | System: `guile -c '(use-modules (guix)) (display (%current-system))'` | 50 | System: `guile -c '(use-modules (guix)) (display (%current-system))'` |
| 51 | Deriver: $drv | 51 | Deriver: $(basename $drv) |
| 52 | EOF | 52 | EOF |
| 53 | 53 | ||
| 54 | # Remove the cached narinfo. | 54 | # Remove the cached narinfo. |
diff --git a/tests/substitute.scm b/tests/substitute.scm index 086bd588358..6837e7e868e 100644 --- a/tests/substitute.scm +++ b/tests/substitute.scm | |||
| @@ -168,8 +168,8 @@ Compression: none | |||
| 168 | NarHash: sha256:" (bytevector->nix-base32-string | 168 | NarHash: sha256:" (bytevector->nix-base32-string |
| 169 | (plain-file-nar-sha256 "Substitutable data.")) " | 169 | (plain-file-nar-sha256 "Substitutable data.")) " |
| 170 | NarSize: 42 | 170 | NarSize: 42 |
| 171 | References: bar baz | 171 | References: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-baz |
| 172 | Deriver: " (%store-prefix) "/foo.drv | 172 | Deriver: cccccccccccccccccccccccccccccccc-foo.drv |
| 173 | System: mips64el-linux\n")) | 173 | System: mips64el-linux\n")) |
| 174 | 174 | ||
| 175 | (define* (call-with-narinfo narinfo thunk | 175 | (define* (call-with-narinfo narinfo thunk |
| @@ -299,8 +299,8 @@ Compression: none\n"))) | |||
| 299 | "Signature: " (signature-field prefix) " | 299 | "Signature: " (signature-field prefix) " |
| 300 | NarHash: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 300 | NarHash: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
| 301 | NarSize: 42 | 301 | NarSize: 42 |
| 302 | References: bar baz | 302 | References: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-baz |
| 303 | Deriver: " (%store-prefix) "/foo.drv | 303 | Deriver: cccccccccccccccccccccccccccccccc-foo.drv |
| 304 | System: mips64el-linux\n") | 304 | System: mips64el-linux\n") |
| 305 | (string-trim-both | 305 | (string-trim-both |
| 306 | (with-output-to-string | 306 | (with-output-to-string |
| @@ -318,13 +318,13 @@ System: mips64el-linux\n") | |||
| 318 | (let ((prefix (string-append "StorePath: " (%store-prefix) | 318 | (let ((prefix (string-append "StorePath: " (%store-prefix) |
| 319 | "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo | 319 | "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo |
| 320 | NarHash: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 320 | NarHash: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
| 321 | References: bar baz\n"))) | 321 | References: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-baz\n"))) |
| 322 | (with-narinfo (string-append prefix | 322 | (with-narinfo (string-append prefix |
| 323 | "Signature: " (signature-field prefix) " | 323 | "Signature: " (signature-field prefix) " |
| 324 | URL: example.nar | 324 | URL: example.nar |
| 325 | Compression: none | 325 | Compression: none |
| 326 | NarSize: 42 | 326 | NarSize: 42 |
| 327 | Deriver: " (%store-prefix) "/foo.drv") | 327 | Deriver: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo.drv") |
| 328 | (string-trim-both | 328 | (string-trim-both |
| 329 | (with-output-to-string | 329 | (with-output-to-string |
| 330 | (lambda () | 330 | (lambda () |
| @@ -434,7 +434,7 @@ Compression: none | |||
| 434 | NarHash: sha256:" (bytevector->nix-base32-string (sha256 #vu8())) " | 434 | NarHash: sha256:" (bytevector->nix-base32-string (sha256 #vu8())) " |
| 435 | NarSize: 42 | 435 | NarSize: 42 |
| 436 | References: | 436 | References: |
| 437 | Deriver: " (%store-prefix) "/foo.drv | 437 | Deriver: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo.drv |
| 438 | System: mips64el-linux\n"))) | 438 | System: mips64el-linux\n"))) |
| 439 | (with-narinfo (string-append narinfo "Signature: " | 439 | (with-narinfo (string-append narinfo "Signature: " |
| 440 | (signature-field narinfo) "\n") | 440 | (signature-field narinfo) "\n") |
| @@ -837,8 +837,8 @@ Compression: none | |||
| 837 | NarHash: sha256:" (bytevector->nix-base32-string | 837 | NarHash: sha256:" (bytevector->nix-base32-string |
| 838 | (plain-file-nar-sha256 "Substitutable data.")) " | 838 | (plain-file-nar-sha256 "Substitutable data.")) " |
| 839 | NarSize: 42 | 839 | NarSize: 42 |
| 840 | References: bar baz | 840 | References: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-baz |
| 841 | Deriver: " (%store-prefix) "/foo.drv | 841 | Deriver: cccccccccccccccccccccccccccccccc-foo.drv |
| 842 | System: mips64el-linux\n"))) | 842 | System: mips64el-linux\n"))) |
| 843 | (with-narinfo (string-append narinfo "Signature: " | 843 | (with-narinfo (string-append narinfo "Signature: " |
| 844 | (signature-field narinfo)) | 844 | (signature-field narinfo)) |
