GNU bug report logs - #50912
[PATCH] tests: Add tests for guix home cli.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Andrew Tropin <andrew@HIDDEN>; Keywords: patch; Done: Oleg Pykhalov <go.wigust@HIDDEN>; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 50912-done <at> debbugs.gnu.org:


Received: (at 50912-done) by debbugs.gnu.org; 19 Oct 2021 14:12:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 19 10:12:18 2021
Received: from localhost ([127.0.0.1]:51640 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mcpqb-00006s-G1
	for submit <at> debbugs.gnu.org; Tue, 19 Oct 2021 10:12:18 -0400
Received: from mail-lf1-f53.google.com ([209.85.167.53]:37537)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <go.wigust@HIDDEN>) id 1mcpqY-00006K-6T
 for 50912-done <at> debbugs.gnu.org; Tue, 19 Oct 2021 10:12:08 -0400
Received: by mail-lf1-f53.google.com with SMTP id z11so7811881lfj.4
 for <50912-done <at> debbugs.gnu.org>; Tue, 19 Oct 2021 07:12:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=t+2Tnagq8YSgT/NaBmugTtdEdjz7DdJs01qp+VSgtsw=;
 b=DiXCrIZcOIpuvrtc2K7RtZbXljt67QtJj5FJohyGGbimrbsuCAkU0XclbCvZ8jpR5m
 B2Tx8Lfvmqca4nJci6fh0/FvZjzxCR0/g0Dkd1pK6FPtGFJsgUS3H9awSPJBkp6Vkff2
 k8jYz7zMg37iSSzJW+I7vu/wIEZVRwA5od1yodwCdaGIMfHLlKdTcluKbi/WjzmuUy2o
 tpxZ0DaBbJwr6XXhT2pgmeukF0gEV7LGYlZiemG0b12I2m8ZTMPMKK4XamOgnet3wHyu
 aVmLakDztZnKZZkAc//h8E9VWdjzPOAhS7ayjzngJrQJnP8NVJ8QdHB0AN34V4I+f5Js
 C0Ng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=t+2Tnagq8YSgT/NaBmugTtdEdjz7DdJs01qp+VSgtsw=;
 b=XWBuU4YjihL+7v9rwSfhWW4sH2yy/6gmDwuKVTbpCj+Fus1TevxQnjjcXiYVhfGaIf
 RMi+dqvF+q9AfDk3lEMIaoLdlxHlnzqjRpyMZvfk9RMWMfM82nu+Fy1fROKA0mUfU6Wz
 rLDD3o5ZoXwEhy7kJI26bYPQavv9C6yPi7x1vvt/KcJ7er4rLFwarKstLgw+KrV5646d
 qtPEi431Giw2lBL7vm2WjKeILHGrbsHwLSTPj8lnbjTw85hnjzJlT7R+0QytSW+5UwAA
 RtqA7MRDTI7h4z0pZUWk2Rsbd2C4eAaJ8NyVh8uUjBGdUsbBiukFiI9WBTJ5r0u/K5Mc
 v/Ug==
X-Gm-Message-State: AOAM532a75gbfmY21ZjT5SYahkibgupRgR2NT8yi/SystnfVnvqK5jbf
 M2znPzPR+c+Gm8XaYIjGcKnS4uWIQm4=
X-Google-Smtp-Source: ABdhPJxFugEF8HoNPNSV9aRlHQxeoEvXC9L4w6BrxMdeYPDd7b71Y+fHbzXZuNbgrjmix1jsI/cmlA==
X-Received: by 2002:a05:6512:3f18:: with SMTP id
 y24mr6461012lfa.263.1634652718846; 
 Tue, 19 Oct 2021 07:11:58 -0700 (PDT)
Received: from guixsd ([88.201.161.72])
 by smtp.gmail.com with ESMTPSA id d20sm1678596lfv.117.2021.10.19.07.11.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 19 Oct 2021 07:11:57 -0700 (PDT)
From: Oleg Pykhalov <go.wigust@HIDDEN>
To: Andrew Tropin <andrew@HIDDEN>
Subject: Re: bug#50912: [PATCH] tests: Add tests for guix home cli.
References: <87lf3e4l26.fsf@HIDDEN>
Date: Tue, 19 Oct 2021 17:11:52 +0300
In-Reply-To: <87lf3e4l26.fsf@HIDDEN> (Andrew Tropin's message of "Thu, 30 Sep
 2021 09:43:10 +0300")
Message-ID: <87lf2p6r4n.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Hi, Andrew Tropin writes: > * tests/guix-home.sh: New file.
 > * Makefile.am (SH_TESTS): Add tests/guix-home.sh. > --- > > > Makefile.am
 | 1 + > tests/guix-home.sh | 99 ++++++++++++++++++++++++++++++++++++++++++++++
 > 2 files c [...] 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
 bl.spamcop.net
 [Blocked - see <https://www.spamcop.net/bl.shtml?209.85.167.53>]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (go.wigust[at]gmail.com)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.167.53 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.167.53 listed in list.dnswl.org]
X-Debbugs-Envelope-To: 50912-done
Cc: 50912-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.2 (/)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi,

Andrew Tropin <andrew@HIDDEN> writes:

> * tests/guix-home.sh: New file.
> * Makefile.am (SH_TESTS): Add tests/guix-home.sh.
> ---
>
>
>  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
> --- 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			\

[=E2=80=A6]

I copied 'guix home search' tests and replaced everything else with
another test suite as discussed at https://issues.guix.gnu.org/50967#35

Closing the current issue.

Oleg.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmFu0igUHGdvLndpZ3Vz
dEBnbWFpbC5jb20ACgkQFn+OpQAa+pxyog/+JonuU0LPC1c2feY72dFwGv2yIyXG
cz7cM7Eg+5ZKXV1lH/ZRpJ7ja0V2VWSGxYwCYYZV+m84H7v92H5Nk8rD8q1/Mxjo
VI4IUNhJJv7S4MAcRNoEiCEpEB1zIKURZFWqNmn08iyvfaWldTbHDpOLU3aWMaMn
sH2RKbvqkFMbZWYvWl1li7junbNwvv5ThHHgToI7QebtmUCTFjkmOyVYhfuJNQ4W
6PXJDBXPZXa/FZFTjTKuNL92roCY4WEDwceTgjcmnqLQwYTwUtGEfu0KlNiaKQKS
+saIkK9xl7usoJF/wNyZQ+NK3QXht/QBSDAGG75aNGvgaVJiv99gg+jK6DGa0YAv
ZKN1bi4BPyBwHYkj7Sa1XpwVVvT/A4Uk4GTjCQnPCxKA/rlrh0wp73xjloYs5Qkt
CrfkjZu8T/dApM0rxj4n7Y2QLMgWcC8Fw5JNjpQRCT4axM1fMad+1iRtaj9ZRrd3
ptumRNlid9WdgpZVwo6OV0ILcp+rqjU3tVBAraA3jynHR2butwZJqLY3kehMKDns
QKtYty+bVP+DlrOvPJqgRklNMJbJNjZsHRC9I0YDdJDuTiSCn73scOCGdt4/yJvu
as+BLFPscOWtU3HFSpOtYoDV5af5xszNGWVSnUNtizgC3xGjp5Y1bGeS43jRZPCv
vL0XIID8CZP3BHQ=
=Xw+i
-----END PGP SIGNATURE-----
--=-=-=--




Notification sent to Andrew Tropin <andrew@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Oleg Pykhalov <go.wigust@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 50912 <at> debbugs.gnu.org:


Received: (at 50912) by debbugs.gnu.org; 5 Oct 2021 09:47:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 05 05:47:44 2021
Received: from localhost ([127.0.0.1]:39110 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXh2s-0008Ar-IX
	for submit <at> debbugs.gnu.org; Tue, 05 Oct 2021 05:47:43 -0400
Received: from mail-lf1-f43.google.com ([209.85.167.43]:43702)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andrew@HIDDEN>) id 1mXh2p-00089s-4L
 for 50912 <at> debbugs.gnu.org; Tue, 05 Oct 2021 05:47:33 -0400
Received: by mail-lf1-f43.google.com with SMTP id r19so1233396lfe.10
 for <50912 <at> debbugs.gnu.org>; Tue, 05 Oct 2021 02:47:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=trop-in.20210112.gappssmtp.com; s=20210112;
 h=from:to:subject:in-reply-to:references:date:message-id:mime-version;
 bh=mpcyyO6gAOjZy/Eed5TCZP3FTCQVk6xzrs26rQNj1I4=;
 b=L2U4LEcXUS98pIUA/OJgxY+SNcBGgXlG2ahsbmc3PR/DtLlOsB2lQAI2ZXnZaXagLI
 BiACnfQ7HQw7aD124Cc+x1QbNbB0RwFst+txX7TXVtXp7Dt7BLqihj7G/HzMsOBbc/yV
 zYWA2Kek/OaYazbxIcJPF8xYw8LKEIFuxLkdfXzAdtVvAgsI5aWIYuQ4678rD7yH5JVx
 1+oMSEM52ztwQG7uhRGyvjwidoV+GIA7mC0anKBB9ru5Qkm6JSb5Fd5OCOBgZC+MHrFe
 wgX44VnlU+UuDv4LG1hVjvMdvP/V+FWuojUZpEDivItY212a0F/QpjpbCorzavKmN6yW
 vwzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:subject:in-reply-to:references:date
 :message-id:mime-version;
 bh=mpcyyO6gAOjZy/Eed5TCZP3FTCQVk6xzrs26rQNj1I4=;
 b=uGczd4hHuGiSzVc5JcxHbdtnJErNt/xp4ZLz/YqUtm6NVHdw/KZEAEbZopCD6RavSq
 tMu+W4UQBuadC+PgRH4/qgRkNU/01k2yCrRIYb84HCwRgkLF5SE+tpNkI0eMSwhHBONA
 JCwpmVlSN9C81Txyak+WpyFZ5eVpeo3LFWP79PkWmdMiasPu+lTbaEB6kLnY8yd8rJkk
 4Ly0h4hURDBtqKju70dHqjFmPbbTa7feTJGqqI0p973bnE+0WTqbR/AI0Hz9rdiPupIC
 sWcEPF59APR1iAH6PPDX2XLu72HC9XtKWuvPGTXa4QvHPymHEP6p13rrgsmEQls8lx/L
 rs8w==
X-Gm-Message-State: AOAM5305QcNl/wvkHEZdZM3odnIPk/s39zL19x25bTTZ4hzyJZK5+5sj
 HR1TSWhffEPngKNIti+dC5Ie3BJdrNlxjA==
X-Google-Smtp-Source: ABdhPJwwi7NuzJMRpchhFtQGeXBPw7XUeuShZxxNazeCsox14DeDP42hmLIr7H2S0MKrhWLjFDnJfw==
X-Received: by 2002:a05:6512:31e:: with SMTP id
 t30mr2532445lfp.620.1633427244156; 
 Tue, 05 Oct 2021 02:47:24 -0700 (PDT)
Received: from localhost (109-252-140-132.dynamic.spd-mgts.ru.
 [109.252.140.132])
 by smtp.gmail.com with ESMTPSA id k19sm1900734ljn.97.2021.10.05.02.47.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 05 Oct 2021 02:47:23 -0700 (PDT)
From: Andrew Tropin <andrew@HIDDEN>
To: Xinglu Chen <public@HIDDEN>, 50912 <at> debbugs.gnu.org
Subject: Re: [bug#50912] [PATCH] tests: Add tests for guix home cli.
In-Reply-To: <87v92gluh6.fsf@HIDDEN>
References: <87lf3e4l26.fsf@HIDDEN> <87v92gluh6.fsf@HIDDEN>
Date: Tue, 05 Oct 2021 12:47:19 +0300
Message-ID: <877der4xco.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50912
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 2021-10-01 15:56, Xinglu Chen wrote:

> On Thu, Sep 30 2021, Andrew Tropin wrote:
>
>> * tests/guix-home.sh: New file.
>> * Makefile.am (SH_TESTS): Add tests/guix-home.sh.
>> ---
>>
>>
>>  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
>> --- 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
>> --- /dev/null
>> +++ b/tests/guix-home.sh
>> @@ -0,0 +1,99 @@
>> +# GNU Guix --- Functional package management for GNU
>> +# Copyright =C2=A9 2021 Andrew Tropin <andrew@HIDDEN>
>> +#
>> +# 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 <http://www.gnu.org/licenses/>.
>> +
>> +#
>> +# 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 fil=
e name
>> +# canonicalization doesn't mess up with 'current-source-directory', use=
d 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"<<EOF
>> +;; This is line 1, and the next one is line 2.
>> +   (home-environment
>> +    (packages))
>> +;; The 'T' is at column 3.
>> +EOF
>> +
>> +if guix home build "$tmpfile" 2> "$errorfile"
>> +then
>> +    # This must not succeed.
>> +    exit 1
>> +else
>> +    grep "$tmpfile:3:4: error: (packages): invalid field specifier" "$e=
rrorfile"
>> +fi
>> +
>> +
>> +cat > "$tmpfile"<<EOF
>> +;; This is line 1, and the next one is line 2.
>> +   (home-environment
>> +;; This is line 3, and there is no closing paren!
>> +EOF
>> +
>> +if guix home build "$tmpfile" 2> "$errorfile"
>> +then
>> +    # This must not succeed.
>> +    exit 1
>> +else
>> +    # Guile 3.0.6 gets line/column numbers for 'read-error' wrong
>> +    # (zero-indexed): <https://bugs.gnu.org/48089>.
>> +    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" <<EOF
>> +(use-modules (gnu))
>> +(use-modules (gnu home-services shepherd))
>> +
>> +(home-environment
>> +  (services (list (service home-shepherd-service-type)
>> +                  (simple-service 'test-shepherd-extension
>> +                   home-shepherd-service-type '())
>> +                  (service home-shepherd-service-type)
>> +                  (service home-shepherd-service-type))))
>> +EOF
>> +
>> +if guix home build "$tmpfile" 2> "$errorfile"
>> +then
>> +    # This must not succeed.
>> +    exit 1
>> +else
>> +    grep "guix home: error: more than one target service of type 'home-=
shepherd'" "$errorfile"
>> +fi
>> +
>> +# Searching.
>> +
>> +guix home search mcron | grep "^name: home-mcron"
>> +guix home search job manager | grep "^name: home-mcron"
>> --=20
>> 2.33.0
>
> The tests themselves LGTM, but some additional things should probably be
> tested
>
> * The provided file doesn=E2=80=99t return a <home-environment>
>
>     guix home build /tmp/test.scm
>     guix home: error: '/tmp/test.scm' does not return a home environment

Good idea, probably I'll provide a few more test, like successful
building of a simple home environment, when migration to new namespace
will be finished.

>
> * Maybe something like =E2=80=98Reporting unmet shepherd requirements=E2=
=80=99 in
>   =E2=80=98guix-system.sh=E2=80=99
>
> =E2=80=98guix home import=E2=80=99 should also be tested, but we will hav=
e to wait for
> the fixes[1] to get merged first.
>
> [1]: <https://issues.guix.gnu.org/50873>

Perhaps it can be done in the patch series with fixes for guix home
import, just after this test script is merged.  BTW, thank you for
cleaning it up.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmFcHycACgkQIgjSCVjB
3rDgdQ//VS/iZu5US+NjblS3GDDnUBUVyTJna5M/N1mNK9CEQv1ugfbiev70+pDf
iXclojOF5nAjsztgmSDah7N5as6eua0lHy/Wqx+z43z/GH027ptD4s5TIYhfn0dd
pBRinWHuFvGxTZvyZQQgI8osY/FZzWxPMAO1lm2g+CAfOUjwgJotgWTR+4bBOCd3
jDHlv/qI2KqHyy6x9FFGQBh7UvVLtQrgVrq/ijN42F5gG33pBDKDSyJZicJ7jOx2
s1TQsN4ujTRoywVYt0rrpg1TOBgyqFtB0Irduek5vdOgabD+XNdbR53pelvBSvmt
Bl2cBdv2wTc7V6mtZPd07gUSLMQkxoh3vKf8z4T/krcyiCm5sCjkk8tpWbtVcVqI
RkFzwwEfEbG+BnTjwrjWdcD410NWJcieWYKPV66FcLiN3YcPc58/4Vcgf2p/eaQf
4j7GMLVMFkdQnqLwl3t3A05IpypoDXjn5bUNMxVLx0ecUHgs5reqRuGj4+bsK1mg
cVqE32jP80z01tLaaATOzVEO2WqbmDHDsuR4AMxqZWK2+2MBimOZD4BLrYXKmM9y
OuCqmgPdXoheZ7t1CkoNHiikbXsMRzXeUO32fthtWr8x7327xtY3SklZRXjkGIMf
iAl7v+pw9eQAJvwrCHG82ppcChl7l/SVtRLjqbI5g8crFQkVo2g=
=tQ67
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#50912; Package guix-patches. Full text available.

Message received at 50912 <at> debbugs.gnu.org:


Received: (at 50912) by debbugs.gnu.org; 1 Oct 2021 13:56:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 01 09:56:32 2021
Received: from localhost ([127.0.0.1]:56779 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWJ1S-0004qJ-SL
	for submit <at> debbugs.gnu.org; Fri, 01 Oct 2021 09:56:32 -0400
Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:48802
 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <public@HIDDEN>) id 1mWJ1M-0004q1-So
 for 50912 <at> debbugs.gnu.org; Fri, 01 Oct 2021 09:56:21 -0400
From: Xinglu Chen <public@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz;
 s=mail; t=1633096568;
 bh=EHmAe+Sg+TjSKty/u0DThZQoDqOhf8ukGTeGc1OX19g=;
 h=From:To:Subject:In-Reply-To:References:Date;
 b=JC++vWiqdhJ6LOxTz4GoaQ6iQ9rbbeCH+6DdKB7pkLq7gNk/Heu62xHtqgy532WU+
 AcTXvJ0Z/qOqAfFX0ewUtY+pwI8lHhn8suZoYxQggcWe7yiFvQlIS2yQi+4jVTBcg5
 RmVk9pYGp4cL4WhaBdANHNnmxmpzCPr6V8CHdlfk=
To: Andrew Tropin <andrew@HIDDEN>, 50912 <at> debbugs.gnu.org
Subject: Re: [bug#50912] [PATCH] tests: Add tests for guix home cli.
In-Reply-To: <87lf3e4l26.fsf@HIDDEN>
References: <87lf3e4l26.fsf@HIDDEN>
Date: Fri, 01 Oct 2021 15:56:05 +0200
Message-ID: <87v92gluh6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 2.9 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On Thu, Sep 30 2021,
 Andrew Tropin wrote: > * tests/guix-home.sh:
 New file. > * Makefile.am (SH_TESTS): Add tests/guix-home.sh. > --- > > >
 Makefile.am | 1 + > tests/guix-home.sh | 99
 ++++++++++++++++++++++++++++++++++++++++++++++
 > 2 files c [...] 
 Content analysis details:   (2.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.5 FROM_SUSPICIOUS_NTLD   From abused NTLD
 0.4 RDNS_DYNAMIC           Delivered to internal network by host with
 dynamic-looking rDNS
 0.0 PDS_RDNS_DYNAMIC_FP    RDNS_DYNAMIC with FP steps
X-Debbugs-Envelope-To: 50912
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.9 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  On Thu, Sep 30 2021, Andrew Tropin wrote: > * tests/guix-home.sh:
    New file. > * Makefile.am (SH_TESTS): Add tests/guix-home.sh. > --- > > >
    Makefile.am | 1 + > tests/guix-home.sh | 99 ++++++++++++++++++++++++++++++++++++++++++++++
    > 2 files c [...] 
 
 Content analysis details:   (2.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
  2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
                             [URI: yoctocell.xyz (xyz)]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.5 FROM_SUSPICIOUS_NTLD   From abused NTLD
  0.4 RDNS_DYNAMIC           Delivered to internal network by host with
                             dynamic-looking rDNS
  1.0 BULK_RE_SUSP_NTLD      Precedence bulk and RE: from a suspicious TLD
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager
  0.0 PDS_RDNS_DYNAMIC_FP    RDNS_DYNAMIC with FP steps

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Thu, Sep 30 2021, Andrew Tropin wrote:

> * tests/guix-home.sh: New file.
> * Makefile.am (SH_TESTS): Add tests/guix-home.sh.
> ---
>
>
>  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
> --- 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
> --- /dev/null
> +++ b/tests/guix-home.sh
> @@ -0,0 +1,99 @@
> +# GNU Guix --- Functional package management for GNU
> +# Copyright =C2=A9 2021 Andrew Tropin <andrew@HIDDEN>
> +#
> +# 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 <http://www.gnu.org/licenses/>.
> +
> +#
> +# 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=
 name
> +# 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"<<EOF
> +;; This is line 1, and the next one is line 2.
> +   (home-environment
> +    (packages))
> +;; The 'T' is at column 3.
> +EOF
> +
> +if guix home build "$tmpfile" 2> "$errorfile"
> +then
> +    # This must not succeed.
> +    exit 1
> +else
> +    grep "$tmpfile:3:4: error: (packages): invalid field specifier" "$er=
rorfile"
> +fi
> +
> +
> +cat > "$tmpfile"<<EOF
> +;; This is line 1, and the next one is line 2.
> +   (home-environment
> +;; This is line 3, and there is no closing paren!
> +EOF
> +
> +if guix home build "$tmpfile" 2> "$errorfile"
> +then
> +    # This must not succeed.
> +    exit 1
> +else
> +    # Guile 3.0.6 gets line/column numbers for 'read-error' wrong
> +    # (zero-indexed): <https://bugs.gnu.org/48089>.
> +    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" <<EOF
> +(use-modules (gnu))
> +(use-modules (gnu home-services shepherd))
> +
> +(home-environment
> +  (services (list (service home-shepherd-service-type)
> +                  (simple-service 'test-shepherd-extension
> +                   home-shepherd-service-type '())
> +                  (service home-shepherd-service-type)
> +                  (service home-shepherd-service-type))))
> +EOF
> +
> +if guix home build "$tmpfile" 2> "$errorfile"
> +then
> +    # This must not succeed.
> +    exit 1
> +else
> +    grep "guix home: error: more than one target service of type 'home-s=
hepherd'" "$errorfile"
> +fi
> +
> +# Searching.
> +
> +guix home search mcron | grep "^name: home-mcron"
> +guix home search job manager | grep "^name: home-mcron"
> --=20
> 2.33.0

The tests themselves LGTM, but some additional things should probably be
tested

* The provided file doesn=E2=80=99t return a <home-environment>

    guix home build /tmp/test.scm
    guix home: error: '/tmp/test.scm' does not return a home environment

* Maybe something like =E2=80=98Reporting unmet shepherd requirements=E2=80=
=99 in
  =E2=80=98guix-system.sh=E2=80=99

=E2=80=98guix home import=E2=80=99 should also be tested, but we will have =
to wait for
the fixes[1] to get merged first.

[1]: <https://issues.guix.gnu.org/50873>

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmFXE3UVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x51foP/jATMBfo0RrSW152t7Ua1IysaUTP
0ddbdXijlzB9Yt5v6/f2p2/sTI+VvHZ8a2FtVvbVd0lK0qXQbrhjRcOW4SbZxuO/
gQF+b0mkaaP79mIP8hnrqY9pomAeW3/VEls8WY4Sq2uRMpqEBuCcMkUBp0pfja00
bdeyVGB5iADvY3igd8nMbQR078mMmrBaO+HVn9gObYHDOf0pbwPfsYouUu0O4kVU
8OHXG3ke9k/tKNKlpZTEqACX81luX7TTOzA3MYQCg6hiKL2kQnMCLwDZCDQCqZkP
J3OOKzIz/HmwW4DtrWfSX8XthR6V1cadzRn863J2tChI3Yxiy9DWkvbJJaEY/tV0
CpS0P1c0SXn80TFOksJKpTERfvVdtX7lJF19fat46wfoi3f9BWHFFUnLwyEzssUM
DLM04GDOD9x7XHg74fa7JEZCgaLUJ2XbImjnezZetBCecmWBqzSEdvbtewxqmGXe
Ll0otjPOhBQN7B2kGD+hvIwt8WiK2N3RcrkfeRannDBSZUN4UkHop5lZU5O+vy9H
Q2YFoPXymGg5ZqsD5NCdZ+DicfXTDYNp4ARFL46HMFQdsBcY1g8VBE4nQMeEHX0M
mKME6pjpXb7f9zULCDeo8HAhX/Vpz2Sqsx02afD0BC3YGB/6P7Us8QcheCR+6v23
WeBbhW7VMR4hgJEq
=+e42
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#50912; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Sep 2021 06:57:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 30 02:57:15 2021
Received: from localhost ([127.0.0.1]:51248 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mVq0J-0001hl-I3
	for submit <at> debbugs.gnu.org; Thu, 30 Sep 2021 02:57:15 -0400
Received: from lists.gnu.org ([209.51.188.17]:51400)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andrew@HIDDEN>) id 1mVq0F-0001hX-BL
 for submit <at> debbugs.gnu.org; Thu, 30 Sep 2021 02:57:14 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:60478)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <andrew@HIDDEN>) id 1mVq0F-0000TA-1o
 for guix-patches@HIDDEN; Thu, 30 Sep 2021 02:57:11 -0400
Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:46679)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <andrew@HIDDEN>) id 1mVq0C-0004gq-Sy
 for guix-patches@HIDDEN; Thu, 30 Sep 2021 02:57:10 -0400
Received: by mail-lf1-x132.google.com with SMTP id z24so20995811lfu.13
 for <guix-patches@HIDDEN>; Wed, 29 Sep 2021 23:57:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=trop-in.20210112.gappssmtp.com; s=20210112;
 h=from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version; bh=knE39MCeFiiUGOvsYGGRObXer3WkZyv2PNXQLsGtVcM=;
 b=4lVcg1ABVIlaCqxNNf80lYqIY/N2zvcigjP753GA0hCKy7wYeDpLZmuIr9NI9WIslo
 vvH/hgY5YxwBn02O4itEWvjwAUmDLBcHIJW2MW/DG/n3ruFvT7puInXDFAHucyCb7O8G
 VgXOi9COv05+dQzctdm0mb60VtzAMaxLuzPqTNKMImt3dzjwlzcKkh0DGWNIsc4S4d5t
 ztarEW1Fi9k1ijuM3yrkF6Fzxbwk7F2Ade82E3sRkVSDRgdESBYmnuOstGggwma3Pa77
 GhhM5T2JCcQuWow+tyYZ2kijuOD+kgiBrJLElN0HOtHwJMqeJAqlfLBsWDg+2cSuI8UL
 Okag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date
 :message-id:mime-version;
 bh=knE39MCeFiiUGOvsYGGRObXer3WkZyv2PNXQLsGtVcM=;
 b=fsv9JHNN0Zw/qeqvJkJPwh4QSc0pV27o/nPKuari+nj2qbXkEhK/QBtc5XmzNeZvBE
 M4WX8pc1D9WDPecLd83ZXk4uoQfsYHQqKhvMq1C3PngsK3FWxNmzPV/WtI82WNh9MU01
 lkTReHaficFmuef1iRr0bvhDQHbN7aPs4gzqFKU6f7RlYyr62Rf4bmNfWqoOPNjNMkwJ
 uXWJv+NfjQhyO+RdVAY273EiyOxpf5Z1EM7U/0QOWL+tuqGH3hBGHUrXlP/bz9cziB0D
 VyjoXi0mxGTVvt8pQiFNe9GXcnOi5XW6q+qNlYtgqrRKILRDOxvZXgbyIlMtBRTFZ4cY
 hhIQ==
X-Gm-Message-State: AOAM530X2n2tha3kISLUOA/CKeN3OgshgYemNpt7+F6tEHfyU3bM2IzB
 m/TjfdCoYOSzTl7mw23clBxvP9jIG5XqgQ==
X-Google-Smtp-Source: ABdhPJzDHvdUzGBe4wypbQk6nshoobFJxBB/8pYI9tY/puPBM7r8HHnKjsPEBrUbYvTKFSds60VAUQ==
X-Received: by 2002:a2e:3518:: with SMTP id z24mr4278442ljz.312.1632985026553; 
 Wed, 29 Sep 2021 23:57:06 -0700 (PDT)
Received: from localhost (109-252-140-132.dynamic.spd-mgts.ru.
 [109.252.140.132])
 by smtp.gmail.com with ESMTPSA id t6sm230686lji.109.2021.09.29.23.57.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 29 Sep 2021 23:57:05 -0700 (PDT)
From: Andrew Tropin <andrew@HIDDEN>
To: guix-patches@HIDDEN
Subject: Re: [PATCH] tests: Add tests for guix home cli.
In-Reply-To: <87lf3e4l26.fsf@HIDDEN>
References: <87lf3e4l26.fsf@HIDDEN>
Date: Thu, 30 Sep 2021 09:57:02 +0300
Message-ID: <87lf3eo8jl.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
Received-SPF: none client-ip=2a00:1450:4864:20::132;
 envelope-from=andrew@HIDDEN; helo=mail-lf1-x132.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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
Cc: Oleg Pykhalov <go.wigust@HIDDEN>,
 Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 Xinglu Chen <public@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain


Added a few checks very similar to what I found in tests/guix-system.sh,
just to be sure that cli at least works somehow.  I think it will be
enough for beginnig and propose to add new test cases, when we face any
issues to prevent regressions or when new functionality is added.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmFVX74ACgkQIgjSCVjB
3rAUBhAAiJv3w/YFBZc3DPFMiWPPYFAydhQD2GkKunDEb3novI15tJ0tmKKC7+AV
l+IOsRsLWuP51zquerm9ooqvSsAvqB1J8agvpx0PZ/cFy2itXToBdkGv9kL7eovd
0YYJJN7/DdLtaZZzRb5hwWzGTiTd3HkS/3m969OHeFZk5BEHIWixYabhHx6+jvfN
oJvFabCz471Arh5Sy/uFdrgK8tyllJyH76g3zN1WqAnZXGywBfd83ecWjvnUavH1
mR6D5w+5D/KLCJoaXMj2C42f/HRujndOXvpD2DH7AlkXaMth0do8TpSremZy0aut
MMiocKnLI2iOXuhLsR3GZfxQvRNT1VUoBi/amdubGSdtAZPNSrw73V1BX/L5WAJ2
VkdWPidEsJ1Y7px3OebvdMcgX50dKh64avHbEIQa9YaUNZTCHe8/I+cGJbWvrexs
8As0j7WEMCkvws88xS5aqiCNYNhBsAhXv1GdoVGMqsqDDXMcdNaoKrFEXhPB0RlJ
loaMwptrZdHJctkEizo2Tasb1Mn8h2ZCpcSQGctosVAe6JLEZ+G9iEANTHnd+orz
aHMmeUZ02QJB3XXEQiMJZFh8o5vTGV5GZUOL9ID0UUUa3TF4CqyT1sJTAOnnJ1cp
VLKpeBACb9TRFDoLNyMMMNhjfZgB5P6XY4JQcwoEN0B4m3TOiPI=
=5r6x
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#50912; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Sep 2021 06:47:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 30 02:47:23 2021
Received: from localhost ([127.0.0.1]:51215 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mVpqa-0001On-St
	for submit <at> 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 <andrew@HIDDEN>) id 1mVpqX-0001Oa-Iy
 for submit <at> 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 <andrew@HIDDEN>) id 1mVpqV-0001jA-DG
 for guix-patches@HIDDEN; 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 <andrew@HIDDEN>) id 1mVpqT-0004XO-3H
 for guix-patches@HIDDEN; Thu, 30 Sep 2021 02:47:07 -0400
Received: by mail-lf1-x133.google.com with SMTP id e15so20983886lfr.10
 for <guix-patches@HIDDEN>; 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 <guix-patches@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 29 Sep 2021 23:47:00 -0700 (PDT)
From: Andrew Tropin <andrew@HIDDEN>
To: guix-patches@HIDDEN
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
Subject: [PATCH] tests: Add tests for guix home cli.
Date: Thu, 30 Sep 2021 09:43:10 +0300
Message-ID: <87lf3e4l26.fsf@HIDDEN>
Received-SPF: none client-ip=2a00:1450:4864:20::133;
 envelope-from=andrew@HIDDEN; 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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
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 <andrew@HIDDEN>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+#
+# 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"<<EOF
+;; This is line 1, and the next one is line 2.
+   (home-environment
+    (packages))
+;; The 'T' is at column 3.
+EOF
+
+if guix home build "$tmpfile" 2> "$errorfile"
+then
+    # This must not succeed.
+    exit 1
+else
+    grep "$tmpfile:3:4: error: (packages): invalid field specifier" "$erro=
rfile"
+fi
+
+
+cat > "$tmpfile"<<EOF
+;; This is line 1, and the next one is line 2.
+   (home-environment
+;; This is line 3, and there is no closing paren!
+EOF
+
+if guix home build "$tmpfile" 2> "$errorfile"
+then
+    # This must not succeed.
+    exit 1
+else
+    # Guile 3.0.6 gets line/column numbers for 'read-error' wrong
+    # (zero-indexed): <https://bugs.gnu.org/48089>.
+    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" <<EOF
+(use-modules (gnu))
+(use-modules (gnu home-services shepherd))
+
+(home-environment
+  (services (list (service home-shepherd-service-type)
+                  (simple-service 'test-shepherd-extension
+                   home-shepherd-service-type '())
+                  (service home-shepherd-service-type)
+                  (service home-shepherd-service-type))))
+EOF
+
+if guix home build "$tmpfile" 2> "$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-----
--=-=-=--




Acknowledgement sent to Andrew Tropin <andrew@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#50912; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 19 Oct 2021 14:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.