From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:48105) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5HbU-0004F4-7g for guix-patches@gnu.org; Fri, 21 Feb 2020 18:21:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j5HbT-00004q-6h for guix-patches@gnu.org; Fri, 21 Feb 2020 18:21:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j5HbT-0008WP-3x for guix-patches@gnu.org; Fri, 21 Feb 2020 18:21:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j5HbT-0000Ww-01 for guix-patches@gnu.org; Fri, 21 Feb 2020 18:21:03 -0500 Subject: [bug#39729] [PATCH 4/7] installer: Bypass connectivity check when /tmp/installer-assume-online exists. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 22 Feb 2020 00:20:27 +0100 Message-Id: <20200221232030.27752-4-ludo@gnu.org> In-Reply-To: <20200221232030.27752-1-ludo@gnu.org> References: <20200221232030.27752-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 39729@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= This is useful for automated tests. * gnu/installer/newt/network.scm (wait-service-online)[online?]: New procedure. Check for /tmp/installer-assume-online. Use it instead of 'connman-online?'. --- gnu/installer/newt/network.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm index 40d85817b6..461d5d99c0 100644 --- a/gnu/installer/newt/network.scm +++ b/gnu/installer/newt/network.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe -;;; Copyright © 2019 Ludovic Courtès +;;; Copyright © 2019, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -119,6 +119,10 @@ network devices were found. Do you want to continue anyway?")) (define (wait-service-online) "Display a newt scale until connman detects an Internet access. Do FULL-VALUE tentatives, spaced by 1 second." + (define (online?) + (or (connman-online?) + (file-exists? "/tmp/installer-assume-online"))) + (let* ((full-value 5)) (run-scale-page #:title (G_ "Checking connectivity") @@ -127,10 +131,10 @@ FULL-VALUE tentatives, spaced by 1 second." #:scale-update-proc (lambda (value) (sleep 1) - (if (connman-online?) + (if (online?) full-value (+ value 1)))) - (unless (connman-online?) + (unless (online?) (run-error-page (G_ "The selected network does not provide access to the \ Internet, please try again.") -- 2.25.1