aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-02-19 12:10:47 +0100
committerLudovic Courtès <ludo@gnu.org>2020-03-05 23:40:22 +0100
commitf901f5d2bc7ed37235ea8b4c51fde80c227234bb (patch)
tree29663396bae9434445a2dd4e93082f081ffb6dc2 /gnu
parent63b8c089c1596cd3e814ac13e1a8b3fa45bb2b54 (diff)
downloadpatches-f901f5d2bc7ed37235ea8b4c51fde80c227234bb.tar
patches-f901f5d2bc7ed37235ea8b4c51fde80c227234bb.tar.gz
installer: Bypass connectivity check when /tmp/installer-assume-online exists.
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?'.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/installer/newt/network.scm10
1 files 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 <m.othacehe@gmail.com>
-;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;;
;;; 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.")