From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 9fZ9JItjWGFyAwEAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 15:50:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0HSWH4tjWGEXWAAA1q6Kng (envelope-from ) for ; Sat, 02 Oct 2021 13:50:03 +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 1573830373 for ; Sat, 2 Oct 2021 15:50:03 +0200 (CEST) Received: from localhost ([::1]:57406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWfOs-00030s-9g for larch@yhetil.org; Sat, 02 Oct 2021 09:50:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWfMw-0007zn-EG for guix-patches@gnu.org; Sat, 02 Oct 2021 09:48:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46816) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWfMw-0002nE-77 for guix-patches@gnu.org; Sat, 02 Oct 2021 09:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWfMw-0002uf-5D for guix-patches@gnu.org; Sat, 02 Oct 2021 09:48:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50967] [PATCH 01/12] tests: Add tests for guix home cli. References: <20211002134352.5735-1-go.wigust@gmail.com> In-Reply-To: <20211002134352.5735-1-go.wigust@gmail.com> Resent-From: Oleg Pykhalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Oct 2021 13:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50967 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50967@debbugs.gnu.org Cc: Oleg Pykhalov , Andrew Tropin Received: via spool by 50967-submit@debbugs.gnu.org id=B50967.163318244910994 (code B ref 50967); Sat, 02 Oct 2021 13:48:02 +0000 Received: (at 50967) by debbugs.gnu.org; 2 Oct 2021 13:47:29 +0000 Received: from localhost ([127.0.0.1]:58331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWfME-0002pb-V6 for submit@debbugs.gnu.org; Sat, 02 Oct 2021 09:47:28 -0400 Received: from mail-lf1-f52.google.com ([209.85.167.52]:40731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWfMD-0002pD-NX for 50967@debbugs.gnu.org; Sat, 02 Oct 2021 09:47:18 -0400 Received: by mail-lf1-f52.google.com with SMTP id y23so15366154lfj.7 for <50967@debbugs.gnu.org>; Sat, 02 Oct 2021 06:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UkdCoo77p/t5vQjaQv+R/Tz/mjqWKuFuIBNUJn+AnCU=; b=HQXr2XNvSA6gFD58mW5o2UjOcrH7rkXKHDCwZiEJSs7bXWr7iiCGiM177IQ7yslC9o ys3KcIzBKaZLH+ys25CYeASRLxMXXPjVyKRKwJ/EBnwj6o3mxz94hLq8rJqPlxxXk8Z2 rXlFDhM3upyNoNkOCVmjKUgXWYrSMAwZ2VayXh4BGdOrR4/9tnYzhuEFlrMi3h7OGAZF 3jg9BxzRiSltBUXgjuwqIy+MaqhZmJz6lBD8H7AEMU65fseEevjIO47wMLiLP0MCAdH6 j24sbt9DQ1cztLGLKaEe9EU9ivH8rjPW+QYvAVV2DyDYKMcQkoBwgo/51LzOmXjoDXW4 uQCg== 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:date:message-id:mime-version :content-transfer-encoding; bh=UkdCoo77p/t5vQjaQv+R/Tz/mjqWKuFuIBNUJn+AnCU=; b=X5k4YqanWvFz8WjgQUzZ589zyuxKZwnbGR2RaedoaCenM6DvJZjj9/Oh3D/kRtqnFQ 07TKY7FAwDYDNSRdC1Umj+sGKGS43IDxqZmPyTfkgLAixB4G4/QiL6pqPTtZzdR+hezK OH7LTZEaSjKYH6cfLmII+m3Y/8d63x/bEzhvFxt/U/8t+Xgaar7ToT/2DzQLB5dHt2w5 4cJai4lSXUi0OHqgWAhiyGAzAV8oclDEdjgm8zWx+63YNUMUUSawaP9jn++3TkW1msj5 2GCmDIX2TwZ+nWpDE1xfL7hjTbwkupywgmrOdqkLFIzJRJOPBs0MS3khjxhCAHmliZMf 9/Gw== X-Gm-Message-State: AOAM531K9pYY3sDQAszi9gUfepMtDY6JxqYrcgL+9OUwv7FbSK6YTX4C Q7GddQ5xM1QdGt1G+kfS2PQxhOBrqOs= X-Google-Smtp-Source: ABdhPJx7KevhlJzgjshfBPdn3Q0uUJdI4nECwess1WApMUfa+1e/xPntqNa00tLxjFuF3obTV2a4TQ== X-Received: by 2002:a05:6512:3dac:: with SMTP id k44mr4224234lfv.359.1633182431134; Sat, 02 Oct 2021 06:47:11 -0700 (PDT) Received: from localhost.localdomain ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id e5sm952648ljj.129.2021.10.02.06.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 06:47:10 -0700 (PDT) From: Oleg Pykhalov Date: Sat, 2 Oct 2021 16:45:52 +0300 Message-Id: <20211002134603.6229-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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=1633182603; 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=UkdCoo77p/t5vQjaQv+R/Tz/mjqWKuFuIBNUJn+AnCU=; b=W3Q3vna1WdISSpyOx39FrQDBVlFPz8Phfv83RyXDypC6HztiC1Bwh0vAUm7z+zD9i22pfC 7uqmDT5pq/f0XhutbGsNj3mJ3ZjKqjEzqHgUogYv1ZYWPz/piL//ZfdQGZUXSK6lCoPmjw ovxPoFDsQV3jcAAcOAD6Z5qeMoTqDtQmqqS6qCfw1Ve7zryr4CtHLSjvltMBflvCHCXi/v GNItjAEr34nyHyehrm6pKCEPYwYXtHvPUG1Vhn6iYI66ncm9LimPaKF1GgMms1xoQmaMJk Stnm76NXU1m+gtChyRF59UUyRn2HAPJ2WJ0P7y1C7qvchkGRF6XQsB6sW2Yjvg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633182603; a=rsa-sha256; cv=none; b=NakqOlM2DoZqxSRGRGac9rrBB7iP/70NQO7QB067R3wy976gnHOtwk8pIWU27NMseIKwdj HcwSs1/in/6cpi8iN1nCcTJdMSufjaxM8WuBtrgxSOxqyaOOuQrCAD43C+q2rbaFuLhtCt pECELuC+5+JgdnGoLlMEa5NB9mHCgMpqLK245ChG6NscK1r9j98Z3NOGDf8ZfiIbL8aU0n cP25teV07yIZLoYOxOs6FgMYerpENSlTxlGKF0U2JF8/dfYMFbIbPG+xfKJ34WZR5IK3rD CIQ3SmouzOJCZqdtukrmBBoK2GecdvNlILiKxKEMO8oIZV3Vrw5Btm3Jwd4ImQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=HQXr2XNv; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: -1.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=HQXr2XNv; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 1573830373 X-Spam-Score: -1.70 X-Migadu-Scanner: scn1.migadu.com X-TUID: SmgjTJUfFtJQ From: Andrew Tropin * tests/guix-home.sh: New file. * Makefile.am (SH_TESTS): Add tests/guix-home.sh. Signed-off-by: Oleg Pykhalov --- 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 = \ 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 © 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="t-guix-home-$$" +errorfile="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="${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" "$errorfile" +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-shepherd'" "$errorfile" +fi + +# Searching. + +guix home search mcron | grep "^name: home-mcron" +guix home search job manager | grep "^name: home-mcron" -- 2.33.0