From patchwork Fri Feb 21 23:20:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 20352 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8B52727BBE4; Fri, 21 Feb 2020 23:21:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 4ECF327BBE4 for ; Fri, 21 Feb 2020 23:21:13 +0000 (GMT) Received: from localhost ([::1]:37174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5Hbc-0004HB-QK for patchwork@mira.cbaines.net; Fri, 21 Feb 2020 18:21:12 -0500 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 X-Loop: help-debbugs@gnu.org Subject: [bug#39729] [PATCH 4/7] installer: Bypass connectivity check when /tmp/installer-assume-online exists. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 21 Feb 2020 23:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39729 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39729@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 39729-submit@debbugs.gnu.org id=B39729.15823272541956 (code B ref 39729); Fri, 21 Feb 2020 23:21:02 +0000 Received: (at 39729) by debbugs.gnu.org; 21 Feb 2020 23:20:54 +0000 Received: from localhost ([127.0.0.1]:48395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j5HbK-0000VO-Ad for submit@debbugs.gnu.org; Fri, 21 Feb 2020 18:20:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:32929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j5HbI-0000Ue-Gt for 39729@debbugs.gnu.org; Fri, 21 Feb 2020 18:20:52 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j5HbD-0008Fb-Dd; Fri, 21 Feb 2020 18:20:47 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=40974 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j5HbC-0000vc-U7; Fri, 21 Feb 2020 18:20:47 -0500 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> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221232030.27752-1-ludo@gnu.org> References: <20200221232030.27752-1-ludo@gnu.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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.")