From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id oCYbKIWQcmeuFQEA62LTzQ:P1 (envelope-from ) for ; Mon, 30 Dec 2024 12:22:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id oCYbKIWQcmeuFQEA62LTzQ (envelope-from ) for ; Mon, 30 Dec 2024 13:22:29 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=hCbmq0Mk; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=GCsiHiCe; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735561349; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Agq7yUEZUIiwP0WeZZe0g5dw5Jo9UU+1Oxz4pUenljE=; b=MjhprSBLfQCkVarVEMYzBTxoF19ywShkHXXmbbS4oDYwkJb4Yx8j1MQ+VPIKdBRAaRBk5/ G2DOoqrM9mFSU1fldZV8A/hCr6v7ISngjzBgAP1nC4fTaQRJEzlpD9XdjVOTL7S8VcNChd NLRhFRDrUmH0q+UVwtYhYu1+Gruc7QS2A0HZC3SdNBh3nd/pqJviMUOWSHpdd7nZPnQWUO XLSToXtZiZgVCMljoj4zkhgUuc5g3/2h9Z0Wq/vcaMTJ6tmHToJDCQBH5BIRAp+Jskaldo 9bpgHQC7BtlxoNqFI+TFi/tXLeMhILRPNaqelGZ1Y17f2lTt5Af7vEKbtYLheQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=hCbmq0Mk; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=GCsiHiCe; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735561349; a=rsa-sha256; cv=none; b=X5WIWAgUYSArNzeFYolAMuBvdp/YsPhbYb9/7jo+On3fz4Ovl95zwtutaCcJxb0o2u6zh2 kAZaQQCQlc3ro93ebru4jy26SW4qPO042xgM1/HrYnZFazUxArl4/7issFSjzOH+Jmlcyc payhh1kNhJb9XREZ3HDB4y8OKJp3oN7uS+ef+SmzB7tIr0PJvfxB8F9YoTFm8KhGzpIVf1 GJ6zNL6H4Nt7p9AOz/eo8Bv+Lz6qE2jnpACDAHy1FIDdnljM+B5bAlUeKuA7oWnZNmje7F syuQO61CobOHsq7wLarIfDOpaxoWASjgceSYKqF42h1UORi5JRHVK73vwjbIHw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2F63C2441F for ; Mon, 30 Dec 2024 13:22:29 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSEme-0007pb-Kj; Mon, 30 Dec 2024 07:22:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSEmY-0007pQ-Pz for guix-patches@gnu.org; Mon, 30 Dec 2024 07:22:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tSEmX-0004vm-TV for guix-patches@gnu.org; Mon, 30 Dec 2024 07:22:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Agq7yUEZUIiwP0WeZZe0g5dw5Jo9UU+1Oxz4pUenljE=; b=hCbmq0Mk48buLjnt5JVmG2is9vx7tkl0rgzPCTh1fcijGw6kBGX3rfpe264B3LTLx1RUrrLhMMmMAWXNSmZbBoQWiBhWaso5KH/6M7EFZhBLJpF/cA5H62kQ66NcnRG5ljSwjXmydjc3BLigmx3WrqxYXbDGrS/XaeCUSVR0SRa31MlkC4fkx2+8VgwEeUVu6t6Ht2863HXx1z8kQ6ptFeIxR9W2MvPnMTEXdoQm8LAeS+lq53N4gLa8bcZ8R+rNZHJdYbRHTifKtQeM4z0j9hgm8JkVYLW+O71IHMvLs7sjPmfnzGKBfVGFebifjmq9G2lY17iisaDVKAYbV9xJJg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tSEmX-0006Z2-Mu for guix-patches@gnu.org; Mon, 30 Dec 2024 07:22:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75010] [PATCH 7/7] WIP: gnu: tests: Add module for guix deploy tests. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Dec 2024 12:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75010 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Herman Rimm Cc: 75010@debbugs.gnu.org Received: via spool by 75010-submit@debbugs.gnu.org id=B75010.173556129625194 (code B ref 75010); Mon, 30 Dec 2024 12:22:01 +0000 Received: (at 75010) by debbugs.gnu.org; 30 Dec 2024 12:21:36 +0000 Received: from localhost ([127.0.0.1]:57657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tSEm8-0006YG-1V for submit@debbugs.gnu.org; Mon, 30 Dec 2024 07:21:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tSEm5-0006Y1-GG for 75010@debbugs.gnu.org; Mon, 30 Dec 2024 07:21:34 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSElx-0004uG-UA; Mon, 30 Dec 2024 07:21:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Agq7yUEZUIiwP0WeZZe0g5dw5Jo9UU+1Oxz4pUenljE=; b=GCsiHiCebkWq9Ycx4DK9 JWtK1h1QzKhVOPbBMb7FMVQkWnf0guK3SILHUdpF+UdltMUfOqWPCBius4Jp8v/R7ztsK0v2Q7yiP 8x4i+BTda5MX2bCfCJnW6LhgfOfeAr+QoDqJU/AoqmWnyxaL3X1wiFQwlBBbKGs5dQdo/DJOXul6j HsgtuC/QKlhODzg5lHvrFAkxOhYE4SVCi5SKl2SnbEPttNGnpEmWY0Doh+FdMA2pQXtk2A/iA0ldi 6H7Ci2uYAEyJFBVTBRy65ITWx+o3+NqK63kq0pTgdyAuKm34IxeE5jdGqPzNpP8np3H4DPVtmGIHn gB3ZwGeye+GA0A==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <6438a457713360741155104b3b2c8af6fda50ee4.1734798943.git.herman@rimm.ee> (Herman Rimm's message of "Sat, 21 Dec 2024 18:04:11 +0100") References: <6438a457713360741155104b3b2c8af6fda50ee4.1734798943.git.herman@rimm.ee> Date: Mon, 30 Dec 2024 13:21:12 +0100 Message-ID: <8734i5tl8n.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -4.40 X-Spam-Score: -4.40 X-Migadu-Queue-Id: 2F63C2441F X-TUID: 2e2y7narf4Y/ Herman Rimm skribis: > * gnu/tests/deploy.scm: Add file. > > Change-Id: I348c8bf2e518ec6c00af126993eaca3fcd453901 Yay, nice! Could you add it to =E2=80=98gnu/local.mk=E2=80=99? > +(define (machines os) > + (program-file "machines.scm" > + #~(list (machine (configuration This should be =E2=80=98scheme-file=E2=80=99 (with normal indentation). > +(define* (deploy-program #:optional (os #~%simple-os)) > + (program-file "deploy.scm" > + (with-extensions (list guile-gcrypt) > + (with-imported-modules `(,@(source-module-closure > + '((guix scripts deploy)) > + #:select? not-config?) > + ((guix config) =3D> ,(make-config.scm))) > + #~(begin > + (use-modules (guix scripts deploy)) > + (guix-deploy #$(machines os))))))) We could use the =E2=80=98guix=E2=80=99 package here: it would be faster, b= ut then we would be testing an older snapshot and not the code at hand. Not great. Still, maybe using =E2=80=98current-guix=E2=80=99 would be faster (fewer th= ings to build), as in: #~(execl #$(file-append (current-guix) "/bin/guix") "guix" "deploy=E2=80=9C #$(machines os)) > + (define (system-generations marionette) > + (marionette-eval > + '(begin > + (use-modules (ice-9 ftw) > + (srfi srfi-1)) > + (let* ((profile-dir "/var/guix/profiles/") > + (entries (map first (cddr (file-system-tree profi= le-dir))))) Please use =E2=80=98match=E2=80=99 rather than =E2=80=98first=E2=80=99 and = =E2=80=98cddr=E2=80=99 (info "(guix) Data Types and Pattern Matching"). Or maybe you could just as well use =E2=80=98scandir=E2=80=99? > + (test-equal "script created new generation" > + (length (system-generations marionette)) > + (1+ (length generations-prior))) > + > + (test-equal "script activated the new generation" > + (string-append "/var/guix/profiles/system-" > + (number->string (+ 1 (length generations-pr= ior))) > + "-link") > + (marionette-eval '(readlink "/run/current-system") > + marionette))) We could also check other things, like the host name. Ludo=E2=80=99.