From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AMmqJ/256WEdYgAAgWs5BA (envelope-from ) for ; Thu, 20 Jan 2022 20:37:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MEd9JP256WEoxQAAauVa8A (envelope-from ) for ; Thu, 20 Jan 2022 20:37:33 +0100 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 4002D46220 for ; Thu, 20 Jan 2022 20:37:33 +0100 (CET) Received: from localhost ([::1]:47442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAdFU-00041w-CI for larch@yhetil.org; Thu, 20 Jan 2022 14:37:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAXBb-00042T-3F for guix-patches@gnu.org; Thu, 20 Jan 2022 08:09:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAXBW-0004Kq-O9 for guix-patches@gnu.org; Thu, 20 Jan 2022 08:09:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nAXBW-0004qT-KA for guix-patches@gnu.org; Thu, 20 Jan 2022 08:09:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53389] [PATCH 2/9] tests: Generalise %local-url. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 20 Jan 2022 13:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53389 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53389@debbugs.gnu.org Cc: ludo@gnu.org, Maxime Devos Received: via spool by 53389-submit@debbugs.gnu.org id=B53389.164268413718608 (code B ref 53389); Thu, 20 Jan 2022 13:09:02 +0000 Received: (at 53389) by debbugs.gnu.org; 20 Jan 2022 13:08:57 +0000 Received: from localhost ([127.0.0.1]:56690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAXBR-0004q2-IG for submit@debbugs.gnu.org; Thu, 20 Jan 2022 08:08:57 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:41992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAXBM-0004oq-06 for 53389@debbugs.gnu.org; Thu, 20 Jan 2022 08:08:53 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id l18q2600H4UW6Th0118qNC; Thu, 20 Jan 2022 14:08:51 +0100 From: Maxime Devos Date: Thu, 20 Jan 2022 13:08:42 +0000 Message-Id: <20220120130849.292178-2-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220120130849.292178-1-maximedevos@telenet.be> References: <20220120130849.292178-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1642684131; bh=LLNXnyxA1ztljqORkcELY3W31H0beEK/duEXvgn61Iw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E0uoBdnbuyrhKj5k9590w7uC/piTTB2xW82ykvNLASd9MNqenjI7pB1Zt1fpyfIUh TFPAW1XTrHTfNOTl1jk7BuUQrH6pFvZqQdLBCC0cX4OYNhMVUa1pnMQAfKBP23/ypY PBc1J5V35m/QR3daA+Cj3Qyoc8muDceZWEz5sj/QeaIdK+XfYcYMV7FdTfowrPEYgX aUMCLpsVzkKmfiUhXHh0y6WQvLS4SDjDco+AZJkelp88OpRhnaCPalr3sYprf0Bp+O HKAJhgFKUDj4Lh+238ZFFRF9K23ZHDB4MrD8akLrNSVkKJ6rBhf+XcT7WjnbtTBA/3 tcM8LWdv2jRJg== 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 X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642707453; 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:dkim-signature; bh=LLNXnyxA1ztljqORkcELY3W31H0beEK/duEXvgn61Iw=; b=FRbwrxYyFOj38dFWOZHv37IwHAvMb0CjInp2798DANjrFqMipYVp3H9a+mk31OUrZmV9qe 0iiYS7xqL78QMI/kR1DAs0kGJ5u3hEl5eVpYSLYGyktGs2I0qCVoSh/BRol+dM2i0ETxqV PGHFOozv8eeOhiiK5ELau2cDhdvUGfWXJhgedAmhhXQ6W0CubOp7VnfxV+6Ub2n/NMErc0 0x3B+FRYdLIzOnORoLn/6/W3/bs9RoJrYdUNvM5yV/yyhs1uoM1lBZHlpR7kbhHH5ufdz/ 6fwg0lT1mSXnCSUF5Cy5d/m7yqq52NsRrE4yw1JMd+j3alBJct9uf5zL4jyTkA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642707453; a=rsa-sha256; cv=none; b=bRLaQFkroMabZeAHTzVOLQWX4dOXkFQikIVJNQDKzV4EJ7K6/t0ZS5FdYiyE9u47nyV9BA sbGRGvbP0PWV29qFmdp6+36JtMuvj5xZjob774/5yUZ143FpsyFJih+ngwijjFOjQogcLF 5EwFTHgay7l/sdZTyj2lLMEejPNWtP+jP9yX+7vMHg/iAqd3EJ8CxR0pSyny3B2B54Kx8o voAFbhsrPbvU+EqS80QSp7nNFDUrLD7QLSLO7yMOTe4tvpc/SJL/4Ogi3Ef2wBK8ovh51n 9F+mtTRarTgdfZSSxElh/58iMOdhWrFEfJuz1XbBQ3gCuK79xprn2ArSue0eyw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=E0uoBdnb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.62 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=E0uoBdnb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4002D46220 X-Spam-Score: -0.62 X-Migadu-Scanner: scn1.migadu.com X-TUID: EilqOg8ja47y * guix/tests/http.scm (%local-url): Extract most functionality to ... (%local-url*): ... here and don't hardcode "/foo/bar". --- guix/tests/http.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/guix/tests/http.scm b/guix/tests/http.scm index c42b4b8176..2f65df4029 100644 --- a/guix/tests/http.scm +++ b/guix/tests/http.scm @@ -31,6 +31,7 @@ call-with-http-server call-with-http-server* %http-server-port + %local-url* %local-url)) ;;; Commentary: @@ -64,12 +65,14 @@ actually listened at (in case %http-server-port was 0)." (strerror err)) (values #f #f))))) -(define* (%local-url #:optional (port (%http-server-port))) +(define* (%local-url* resource #:optional (port (%http-server-port))) + ;; The URL to the resource named RESOURCE on the current HTTP server. (when (= port 0) (error "no web server is running!")) + (string-append "http://localhost:" (number->string port) resource)) +(define* (%local-url #:optional (port (%http-server-port))) ;; URL to use for 'home-page' tests. - (string-append "http://localhost:" (number->string port) - "/foo/bar")) + (%local-url* "/foo/bar" port)) (define* (call-with-http-server* handle thunk #:key (keep-lingering? #false) (last-response? (const #false))) -- 2.30.2