From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iKa6EeTQbWG9iAAAgWs5BA (envelope-from ) for ; Mon, 18 Oct 2021 21:54:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WEd7DeTQbWFhDAAA1q6Kng (envelope-from ) for ; Mon, 18 Oct 2021 19:54:12 +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 F088B36650 for ; Mon, 18 Oct 2021 21:54:11 +0200 (CEST) Received: from localhost ([::1]:35428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcYi3-0008P3-29 for larch@yhetil.org; Mon, 18 Oct 2021 15:54:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcYhv-0008No-TB for guix-patches@gnu.org; Mon, 18 Oct 2021 15:54:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mcYhu-0003xx-4T for guix-patches@gnu.org; Mon, 18 Oct 2021 15:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mcYhu-0000Qn-27 for guix-patches@gnu.org; Mon, 18 Oct 2021 15:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50960] [PATCH v3 05/10] environment: Add tests for '--profile'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 18 Oct 2021 19:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50960 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50960@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 50960-submit@debbugs.gnu.org id=B50960.16345867841537 (code B ref 50960); Mon, 18 Oct 2021 19:54:02 +0000 Received: (at 50960) by debbugs.gnu.org; 18 Oct 2021 19:53:04 +0000 Received: from localhost ([127.0.0.1]:48666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcYgx-0000Oi-Eo for submit@debbugs.gnu.org; Mon, 18 Oct 2021 15:53:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcYgj-0000Me-IP for 50960@debbugs.gnu.org; Mon, 18 Oct 2021 15:52:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51634) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcYge-0002lz-9j; Mon, 18 Oct 2021 15:52:44 -0400 Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:60778 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 1mcYge-0007lj-09; Mon, 18 Oct 2021 15:52:44 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 18 Oct 2021 21:52:14 +0200 Message-Id: <20211018195219.13898-6-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018195219.13898-1-ludo@gnu.org> References: <20211011213809.17482-1-ludo@gnu.org> <20211018195219.13898-1-ludo@gnu.org> MIME-Version: 1.0 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=1634586852; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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; bh=2u/7htT/wTvSmeVRVwhBU84UBeFgmHlGxq72qGOEtco=; b=MSXx9fgrkOJNRyqWm7Sv2+DJ2YTa5VxDYUvd28MOyvOxYQnBn9pO1xnEi3m2nLmArpxgwq Fc5h2uYdq2+J2iItUGm9LUh/YkdLCrMSfzognKn1rmJeElepHJrioBC0qq0E50JqZiYMra wZwtyG0qcO/86VKNOcgOUTkL5+OnaXtNo7PxZAAfmIIoJUvroFOnOpLmGu7sJyMx/dm0+s lD2VRnGYXJsYgkOUwT0JS8jibhX7peqXQ4A4kOApqF77dPu8SWlKvZZvL/yptVtplZFPZm G7SJ2Qz3UHTQmKVrACtcw7VrRcjo9H66bSDqu9jz/DE7jx6gjF5E08+/nH9qCg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634586852; a=rsa-sha256; cv=none; b=GS0n5UyGvcWmapvmNRVg9mTH+v8CxLHKUOHVzi5Z49VyMRKk7w88wd1wfn7fvfDcauMBs6 6l/gVyCr/ev0XBSkDnYBjpKsNQsZh14O/HfsyzFgn/HvSNuyCBlnH5J3z7q+mkR6wQC9Hw 4JkdiKTUGlH4vXWmDc4s+pTjh0BtTDh8MRiwbjcX44YwXDjPCf531j2e01rMwvKX8jdXra BD9rSm1xGOuBQnEqFDShGg3ewYDEH5Q0o7o/oIUzLv3m8yy6cwAe07QPC6V7hJ8ngS8HZ7 W1LZd/pnZw7YnTHdQJZclqL80aawKvaEuC94Ilc0w+9L/KurL48E89PeJmKWpQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: 2.77 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: F088B36650 X-Spam-Score: 2.77 X-Migadu-Scanner: scn1.migadu.com X-TUID: 16YL+F9PEMhy This is a followup to a643deac2de81755a1843a3b41dd53857678bebc. * tests/guix-environment-container.sh, tests/guix-environment.sh: Add tests for '--profile'. --- tests/guix-environment-container.sh | 8 ++++++++ tests/guix-environment.sh | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh index f2d15c8d0c..2e238c501d 100644 --- a/tests/guix-environment-container.sh +++ b/tests/guix-environment-container.sh @@ -44,6 +44,14 @@ else test $? = 42 fi +# Try '--root' and '--profile'. +root="$tmpdir/root" +guix environment -C --ad-hoc --bootstrap guile-bootstrap -r "$root" -- guile --version +guix environment -C -p "$root" --bootstrap -- guile --version +path1=$(guix environment -C -p "$root" --bootstrap -- guile -c '(display (getenv "PATH"))') +path2=$(guix environment -C --ad-hoc --bootstrap guile-bootstrap -- guile -c '(display (getenv "PATH"))') +test "$path1" = "$path2" + # Make sure "localhost" resolves. guix environment --container --ad-hoc --bootstrap guile-bootstrap \ -- guile -c '(exit (pair? (getaddrinfo "localhost" "80")))' diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh index afadcbe195..f4fc2e39ed 100644 --- a/tests/guix-environment.sh +++ b/tests/guix-environment.sh @@ -119,6 +119,13 @@ test `readlink "$gcroot"` = "$expected" guix environment --bootstrap -r "$gcroot" --ad-hoc guile-bootstrap \ -- guile -c 1 test `readlink "$gcroot"` = "$expected" + +# Make sure '-p' works as expected. +test $(guix environment -p "$gcroot" -- "$SHELL" -c 'echo $GUIX_ENVIRONMENT') = "$expected" +paths1="$(guix environment -p "$gcroot" --search-paths)" +paths2="$(guix environment --bootstrap --ad-hoc guile-bootstrap --search-paths)" +test "$paths1" = "$paths2" + rm "$gcroot" # Try '-r' with a relative file name. -- 2.33.0