From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MEN9Ml1iVWFPAQEAgWs5BA (envelope-from ) for ; Thu, 30 Sep 2021 09:08:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GOA9Ll1iVWFkVAAAB5/wlQ (envelope-from ) for ; Thu, 30 Sep 2021 07:08:13 +0000 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 3F2D4359C for ; Thu, 30 Sep 2021 09:08:13 +0200 (CEST) Received: from localhost ([::1]:38392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVqAu-0004wC-9l for larch@yhetil.org; Thu, 30 Sep 2021 03:08:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVprO-0003a9-AP for guix-patches@gnu.org; Thu, 30 Sep 2021 02:48:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVprO-0005Ke-1F for guix-patches@gnu.org; Thu, 30 Sep 2021 02:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mVprN-0001S5-RN for guix-patches@gnu.org; Thu, 30 Sep 2021 02:48:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50912] [PATCH] tests: Add tests for guix home cli. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Sep 2021 06:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50912 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50912@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16329844435405 (code B ref -1); Thu, 30 Sep 2021 06:48:01 +0000 Received: (at submit) by debbugs.gnu.org; 30 Sep 2021 06:47:23 +0000 Received: from localhost ([127.0.0.1]:51215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVpqa-0001On-St for submit@debbugs.gnu.org; Thu, 30 Sep 2021 02:47:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:57014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVpqX-0001Oa-Iy for submit@debbugs.gnu.org; Thu, 30 Sep 2021 02:47:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVpqV-0001jA-DG for guix-patches@gnu.org; Thu, 30 Sep 2021 02:47:07 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]:43756) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVpqT-0004XO-3H for guix-patches@gnu.org; Thu, 30 Sep 2021 02:47:07 -0400 Received: by mail-lf1-x133.google.com with SMTP id e15so20983886lfr.10 for ; Wed, 29 Sep 2021 23:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:mime-version:subject:date:message-id; bh=UAYnMHQNpPkUuKNX+DGySTPJ51lze8oPLiymOJIsDBw=; b=TWNjiSpRQVF94/P4StdBvdpNJr6Ob37XuaTWoJ/ytgZEny4HzML0GBC64ZVKT9UlDA xL3P8548czGFVjNKAwu2la5FcYuHJCqpap9dfDGRoIwChmj998LDjURbzB6QwRgd/vgD w8onXpSN9nj9g3gDj2A0tXj2t8wKfOK50f42/6Vt/c7Fi1tIwlpjPwr/Mhwxl2rCFzje bUzqcBspgxzfVWKW3xcWfpREE4V3KCky9XRqRONYLICaobF7IxVLp68qyDt5hSnG2bvG n7mq/AynRkMTHpmmYwxidl4odHrJLEYS793D1UiKhhUAuj3OBU5zu6IlUQV17KjhL4ff 1m0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:mime-version:subject:date:message-id; bh=UAYnMHQNpPkUuKNX+DGySTPJ51lze8oPLiymOJIsDBw=; b=01yon5exM0XgvxSw3ecfdaqrmwCUF5HrMeLG9ZDiJILFbT8UpxCjwjnmycSEGWZHjM KBxnpS5X4kBlzyBN3oPbqpC0ONr2BEe5RIDujn2k3C/W06RpI42x8ofj6chfI3d/Dkdr 29BeRaKiOcE1N9hh6sHBBwVCmXKRMeX8bA7W2ykJNuf4lSiKdJKRGzDswKE4jZMbICYg 4O2rwt9uEweLtksglB0M9OzmRvE0/bKpnoKzyfsJJt4/imJL527YR7H42Riod9s9GpWL QvM+Aa3f4UYXCxufJ7q6mBo8v2gz356nAKmjiP2xbTouj+hvZ53mqsJtlHshQtA5xSuM loHg== X-Gm-Message-State: AOAM531DcI+TDfm436CVFt0TFz2RTPgE49o3XbpT+ReydA2Ya6rtbMKp n/n/WpNtOTkwBHl0F1kkNy35gWyXEc3BZA== X-Google-Smtp-Source: ABdhPJz9Lg82PLyFyxNJfXjVPgoNOfwqpkPFvtCd2sgWhpi8ZAhMvTl8a351VQ3a40pdKXIoRfI5pw== X-Received: by 2002:a19:f819:: with SMTP id a25mr3893035lff.581.1632984421278; Wed, 29 Sep 2021 23:47:01 -0700 (PDT) Received: from localhost (109-252-140-132.dynamic.spd-mgts.ru. [109.252.140.132]) by smtp.gmail.com with ESMTPSA id s15sm258604lfs.307.2021.09.29.23.47.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 23:47:00 -0700 (PDT) From: Andrew Tropin MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Date: Thu, 30 Sep 2021 09:43:10 +0300 Message-ID: <87lf3e4l26.fsf@trop.in> Received-SPF: none client-ip=2a00:1450:4864:20::133; envelope-from=andrew@trop.in; helo=mail-lf1-x133.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1632985693; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=UAYnMHQNpPkUuKNX+DGySTPJ51lze8oPLiymOJIsDBw=; b=Df4zy3OTucql1tW4nVov0NbQkP9ixKG1nCP7s++9/T2wobRUrhl8a4JMem7bWGwvzXu0bl L5GX2xvIPC90j/AeJkB7v5JXtAaM//CQ8CcdoPuHJN/iLlwRVkVd841E+CYYGjj06dJELy HeJRf9NVw3040Q8X3UppCW7okLqa0WdmR5Was7HVuFPnmt7G6SJUBBPSQuLIGU/vz3w8zD XGVYVkvSlFn5PEuYvUqn4Sr/EJsI0Ymx6IyohDpCguaXJX2KwEdOJe56BwFHEU7C7lnpP4 ep9CgWtodAS5b5ECbu4sfTwFEktVM/V+Vv/DE5QfF2EfQ4A7kNQhazhVytq2lA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632985693; a=rsa-sha256; cv=none; b=U9IoPeHXOP9AlhzCX3oT230TXjsBJ0lS+cO4popXDDNTEmiVeQbBji+4OJg1ejzy4Ea4XO KKvs6CRQxKy7I1lIeV7ZltOBfd4EdOrcutNlcjZ3YQK00qGv/TeimyP9nGlluFEhwNs/Xw T7rrryXeHaBIMSaBhnWN5X1sA/gP7The0dwnL7NBl74JCswKFYiBMpFnihBqvoq1LUZ4xd M1j3MGoTmf7/YtCKXUferZ25QxHaAr5hEfZ1OY+y/34zV6ZaCwjvmMXtyepFQjZwoQzoie 51CkgMsXkW3+92U2mjn0I+pcOvOHGLuWIDIwna2Ozp6zdQby/t4FNi/M2cMGhQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=TWNjiSpR; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -4.10 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=TWNjiSpR; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 3F2D4359C X-Spam-Score: -4.10 X-Migadu-Scanner: scn1.migadu.com X-TUID: 7DoVVGpF7/Q7 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable * tests/guix-home.sh: New file. * Makefile.am (SH_TESTS): Add tests/guix-home.sh. =2D-- Makefile.am | 1 + tests/guix-home.sh | 99 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 tests/guix-home.sh diff --git a/Makefile.am b/Makefile.am index b66789fa0b..5bf2567dc8 100644 =2D-- a/Makefile.am +++ b/Makefile.am @@ -546,6 +546,7 @@ SH_TESTS =3D \ tests/guix-package-aliases.sh \ tests/guix-package-net.sh \ tests/guix-system.sh \ + tests/guix-home.sh \ tests/guix-archive.sh \ tests/guix-authenticate.sh \ tests/guix-environment.sh \ diff --git a/tests/guix-home.sh b/tests/guix-home.sh new file mode 100644 index 0000000000..cb015c907f =2D-- /dev/null +++ b/tests/guix-home.sh @@ -0,0 +1,99 @@ +# GNU Guix --- Functional package management for GNU +# Copyright =C2=A9 2021 Andrew Tropin +# +# This file is part of GNU Guix. +# +# GNU Guix is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Guix is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Guix. If not, see . + +# +# Test 'guix home' cli. +# + +set -e + +guix home --version + +tmpfile=3D"t-guix-home-$$" +errorfile=3D"t-guix-home-error-$$" + +# Note: This directory is chosen outside $builddir so that relative file n= ame +# canonicalization doesn't mess up with 'current-source-directory', used by +# 'local-file' ('load' forces 'relative' for +# %FILE-PORT-NAME-CANONICALIZATION.) +tmpdir=3D"${TMPDIR:-/tmp}/t-guix-home-$$" +mkdir "$tmpdir" + +trap 'rm -f "$tmpfile" "$errorfile" "$tmpdir"/*; rmdir "$tmpdir"' EXIT + +# Reporting of syntax errors. + +cat > "$tmpfile"< "$errorfile" +then + # This must not succeed. + exit 1 +else + grep "$tmpfile:3:4: error: (packages): invalid field specifier" "$erro= rfile" +fi + + +cat > "$tmpfile"< "$errorfile" +then + # This must not succeed. + exit 1 +else + # Guile 3.0.6 gets line/column numbers for 'read-error' wrong + # (zero-indexed): . + grep "$tmpfile:4:1: missing closing paren" "$errorfile" || \ + grep "$tmpfile:3:0: missing closing paren" "$errorfile" +fi + +# Reporting of duplicate system service declaration. + +cat > "$tmpfile" < "$errorfile" +then + # This must not succeed. + exit 1 +else + grep "guix home: error: more than one target service of type 'home-she= pherd'" "$errorfile" +fi + +# Searching. + +guix home search mcron | grep "^name: home-mcron" +guix home search job manager | grep "^name: home-mcron" =2D-=20 2.33.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmFVXWEACgkQIgjSCVjB 3rDVqQ/6AqwB4R6g1vUCT8x8ZrsZbLZIKS7tV7n3sozguKaJm5apB2WwFQJr7xAZ X9PbsOMcTsrJSrRi9CWPXg23wMu/WcU9P93ypPNZcuZvtONKd6Tf4RMlCv35oYAJ R6hgSvM+HiYN4kaX88vSoyMvkTqXclx8de5p/K8KMe7z2RiNHC2qrW0fmPNL5FMr HwBrFpbKMd9f/ZQEO2ev3xHJutlmuxTQO0W42qXr2Eb9+233id/Uzug4wzY8bx8F Q+AUCCQOfNS6U3PB+YCTxmq5YoXPNYSoRSBl1djnML8idSyzKqN1+3bOO6d9bP+F CQIFiCpyhPDcHEb+ecyKknuHhp0Vj12V8eXwVapPVqL8E4P31jXSAgaN72lztK5d Vf0FaiVnY96XRigGYfC0zzK1JNevm+E0FAJRHEN/UVoinWe6YUbjPuWLYVnc4JFY hIIRYTVPyaRSVWX/Nud1nY1rBGkJMX6V3iTtiyz9qxDAK+Vc4XijUU+0tL/nL6ZR j759gEbnIE4vMdSLA6z+S1DyYJpY+tCWjeSwvg2DaKwKfhasl8dq9HCmIDuej0wU 56CfxO2pCxrLI8i9ZmTH4FMNTBgs+DKVXqzka8wEQmsgf4WZJGctciGwXBtrClSc Slu5Z3MT8WtDx/ypp/wKZMTaphlY8cHFq/T/5EO/qbxXdQ4TnN8= =g8c6 -----END PGP SIGNATURE----- --=-=-=--