From patchwork Sun Feb 27 13:53:39 2022 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: 37515 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 317C327BBEA; Sun, 27 Feb 2022 14:02:07 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CEAEB27BBE9 for ; Sun, 27 Feb 2022 14:02:06 +0000 (GMT) Received: from localhost ([::1]:41438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOK7h-0003Jo-Lw for patchwork@mira.cbaines.net; Sun, 27 Feb 2022 09:02:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOK0w-0000WM-8T for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35055) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOK0v-0001t0-5C for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOK0v-0004uL-4M for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54180] [PATCH 09/12] tests: Check 'guix home reconfigure' for a second generation. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Feb 2022 13:55:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54180 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54180@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 54180-submit@debbugs.gnu.org id=B54180.164597006918739 (code B ref 54180); Sun, 27 Feb 2022 13:55:05 +0000 Received: (at 54180) by debbugs.gnu.org; 27 Feb 2022 13:54:29 +0000 Received: from localhost ([127.0.0.1]:57170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOK0K-0004s4-KS for submit@debbugs.gnu.org; Sun, 27 Feb 2022 08:54:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOK0B-0004qL-EB for 54180@debbugs.gnu.org; Sun, 27 Feb 2022 08:54:20 -0500 Received: from [2001:470:142:3::e] (port=50244 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOK01-0001Zp-Cn; Sun, 27 Feb 2022 08:54:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=kRaL04jmZdrVlSDR58XrELI9WO17jDsb7AMDz2U7LbM=; b=QFC/VUdAih5+L7iDWGXR odFHQiJjnZVNzbGkR638kbJtfpNSxCqTu8ZBZmzbKdN3+wReJdF1rnO6zW8iDI8z7y2WVPHa4/cXC bvO712P9ALmtRk25Lb/fzNw0b1hn3gXuHmicw9RSGdit5fK99vwvYRAWaOwbFxDpQHP0wEMggddO6 MCMp1CYhzgn5YZybYxGOQhOy2ug78K39mg/WgiH4M5AaxTCNeC0Y8goj0y/fxc5nLzcEUDMIRuQgG Gx0oQofwyn2OUilCyAvSLt1QGtUVSX53apK9UTYZq9tG89QNkgqyQPfyjSQ/CBwaHDG24uuUFFO0y RvXijYW/DidjyA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55804 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOJzz-0007Pg-VT; Sun, 27 Feb 2022 08:54:09 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sun, 27 Feb 2022 14:53:39 +0100 Message-Id: <20220227135342.10296-9-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220227135342.10296-1-ludo@gnu.org> References: <20220227135342.10296-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/guix-home.sh: Invoke "guix home reconfigure" a second time with a modify config file and check the result. --- tests/guix-home.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/guix-home.sh b/tests/guix-home.sh index 3b397649cc..f054d15172 100644 --- a/tests/guix-home.sh +++ b/tests/guix-home.sh @@ -108,6 +108,7 @@ EOF # Make sure preexisting files were backed up. grep "overridden" "$HOME"/*guix-home*backup/.bashrc grep "overridden" "$HOME"/*guix-home*backup/.config/test.conf + rm -r "$HOME"/*guix-home*backup # # Test 'guix home describe'. @@ -131,6 +132,28 @@ EOF } test "$(canonical_file_name)" == "$(readlink "${HOME}/.guix-home")" + # + # Configure a new generation. + # + + # Change the bashrc snippet content and comment out one service. + sed -i "home.scm" -e's/the content of/the NEW content of/g' + sed -i "home.scm" -e"s/(simple-service 'test-config/#;(simple-service 'test-config/g" + + guix home reconfigure "${test_directory}/home.scm" + test "$(tail -n 2 "${HOME}/.bashrc")" == "\ +# dot-bashrc test file for guix home +# the NEW content of bashrc-test-config.sh" + + # This file must have been removed and not backed up. + ! test -e "$HOME/.config/test.conf" + ! test -e "$HOME"/*guix-home*backup/.config/test.conf + + test "$(cat "$(configuration_file)")" == "$(cat home.scm)" + test "$(canonical_file_name)" == "$(readlink "${HOME}/.guix-home")" + + test $(guix home list-generations | grep "^Generation" | wc -l) -eq 2 + # # Test 'guix home search'. #