From patchwork Tue Dec 15 09:57:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 25791 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8845327BC05; Tue, 15 Dec 2020 09:58:18 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 24E4927BC04 for ; Tue, 15 Dec 2020 09:58:18 +0000 (GMT) Received: from localhost ([::1]:51144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kp761-0007jq-5Y for patchwork@mira.cbaines.net; Tue, 15 Dec 2020 04:58:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kp75o-0007iZ-7t for guix-patches@gnu.org; Tue, 15 Dec 2020 04:58:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44133) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kp75n-0004YT-7j for guix-patches@gnu.org; Tue, 15 Dec 2020 04:58:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kp75n-0007BX-6w for guix-patches@gnu.org; Tue, 15 Dec 2020 04:58:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45253] [PATCH 3/6] tests: Check the mtime and permissions of substituted items. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 15 Dec 2020 09:58:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45253 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45253@debbugs.gnu.org Received: via spool by 45253-submit@debbugs.gnu.org id=B45253.160802626827563 (code B ref 45253); Tue, 15 Dec 2020 09:58:03 +0000 Received: (at 45253) by debbugs.gnu.org; 15 Dec 2020 09:57:48 +0000 Received: from localhost ([127.0.0.1]:55671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kp75Y-0007AP-CS for submit@debbugs.gnu.org; Tue, 15 Dec 2020 04:57:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kp75U-00079X-5i for 45253@debbugs.gnu.org; Tue, 15 Dec 2020 04:57:44 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48637) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kp75O-0004R4-UC; Tue, 15 Dec 2020 04:57:38 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44330 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kp75O-0001j8-6i; Tue, 15 Dec 2020 04:57:38 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Tue, 15 Dec 2020 10:57:27 +0100 Message-Id: <20201215095730.10954-3-ludo@gnu.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201215095730.10954-1-ludo@gnu.org> References: <20201215095730.10954-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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"))))))