From 26fe5af3e39405b19b8b52f6e3263cd9d1cb8653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Jun 2026 23:42:02 +0200 Subject: =?UTF-8?q?tests:=20Fix=20improper=20narinfo=20=E2=80=98Deriver?= =?UTF-8?q?=E2=80=99=20and=20=E2=80=98References=E2=80=99=20field=20values?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/guix-daemon.sh | 4 ++-- tests/substitute.scm | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'tests') 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 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +# Copyright © 2012, 2014-2019, 2026 Ludovic Courtès # # This file is part of GNU Guix. # @@ -48,7 +48,7 @@ Compression: none NarSize: 1234 References: System: `guile -c '(use-modules (guix)) (display (%current-system))'` -Deriver: $drv +Deriver: $(basename $drv) EOF # 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 NarHash: sha256:" (bytevector->nix-base32-string (plain-file-nar-sha256 "Substitutable data.")) " NarSize: 42 -References: bar baz -Deriver: " (%store-prefix) "/foo.drv +References: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-baz +Deriver: cccccccccccccccccccccccccccccccc-foo.drv System: mips64el-linux\n")) (define* (call-with-narinfo narinfo thunk @@ -299,8 +299,8 @@ Compression: none\n"))) "Signature: " (signature-field prefix) " NarHash: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa NarSize: 42 -References: bar baz -Deriver: " (%store-prefix) "/foo.drv +References: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-baz +Deriver: cccccccccccccccccccccccccccccccc-foo.drv System: mips64el-linux\n") (string-trim-both (with-output-to-string @@ -318,13 +318,13 @@ System: mips64el-linux\n") (let ((prefix (string-append "StorePath: " (%store-prefix) "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo NarHash: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -References: bar baz\n"))) +References: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-baz\n"))) (with-narinfo (string-append prefix "Signature: " (signature-field prefix) " URL: example.nar Compression: none NarSize: 42 -Deriver: " (%store-prefix) "/foo.drv") +Deriver: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo.drv") (string-trim-both (with-output-to-string (lambda () @@ -434,7 +434,7 @@ Compression: none NarHash: sha256:" (bytevector->nix-base32-string (sha256 #vu8())) " NarSize: 42 References: -Deriver: " (%store-prefix) "/foo.drv +Deriver: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo.drv System: mips64el-linux\n"))) (with-narinfo (string-append narinfo "Signature: " (signature-field narinfo) "\n") @@ -837,8 +837,8 @@ Compression: none NarHash: sha256:" (bytevector->nix-base32-string (plain-file-nar-sha256 "Substitutable data.")) " NarSize: 42 -References: bar baz -Deriver: " (%store-prefix) "/foo.drv +References: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-baz +Deriver: cccccccccccccccccccccccccccccccc-foo.drv System: mips64el-linux\n"))) (with-narinfo (string-append narinfo "Signature: " (signature-field narinfo)) -- cgit v1.2.3