From 72fc91b113564f8006094c0118f06af0f414d21b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 27 Sep 2023 23:34:15 +0200 Subject: [PATCH] =?UTF-8?q?tests:=20=E2=80=98rewrite-url=E2=80=99=20test?= =?UTF-8?q?=20no=20longer=20depends=20on=20network=20access.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . Previously, this test would actually need to access dist.libuv.org. * tests/gnu-maintenance.scm ("rewrite-url, without to-version"): Change URLs from https to http, and from libuv.org to libuv.example.org. Parameterize ‘current-http-proxy’. Reported-by: Janneke Nieuwenhuizen --- tests/gnu-maintenance.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/gnu-maintenance.scm b/tests/gnu-maintenance.scm index 61ae295b96..6fde1eb8b1 100644 --- a/tests/gnu-maintenance.scm +++ b/tests/gnu-maintenance.scm @@ -25,6 +25,7 @@ (define-module (test-gnu-maintenance) #:use-module (guix utils) #:use-module (srfi srfi-1) #:use-module (srfi srfi-64) + #:use-module ((web client) #:select (current-http-proxy)) #:use-module (ice-9 match)) (test-begin "gnu-maintenance") @@ -157,9 +158,9 @@ (define expected-signature-url submodules/qtbase-everywhere-src-6.3.2.tar.xz" "6.3.2" #:to-version "6.5.2")) (test-equal "rewrite-url, without to-version" - "https://dist.libuv.org/dist/v1.46.0/libuv-v1.46.0.tar.gz" + "http://dist.libuv.example.org/dist/v1.46.0/libuv-v1.46.0.tar.gz" (with-http-server - ;; First reply, crawling https://dist.libuv.org/dist/. + ;; First reply, crawling http://dist.libuv.example.org/dist/. `((200 "\ @@ -173,7 +174,7 @@ (define expected-signature-url v1.46.0/ ") - ;; Second reply, crawling https://dist.libuv.org/dist/v1.46.0/. + ;; Second reply, crawling http://dist.libuv.example.org/dist/v1.46.0/. (200 "\ @@ -190,7 +191,8 @@ (define expected-signature-url libuv-v1.46.0.tar.gz.sign ")) - (rewrite-url "https://dist.libuv.org/dist/v1.45.0/libuv-v1.45.0.tar.gz" - "1.45.0"))) + (parameterize ((current-http-proxy (%local-url))) + (rewrite-url "http://dist.libuv.example.org/dist/v1.45.0/libuv-v1.45.0.tar.gz" + "1.45.0")))) (test-end)