me
/
guix
Archived
1
0
Fork 0

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?'.
master
Ludovic Courtès 2020-02-19 12:10:47 +01:00
parent 63b8c089c1
commit f901f5d2bc
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com> ;;; 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. ;;; 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) (define (wait-service-online)
"Display a newt scale until connman detects an Internet access. Do "Display a newt scale until connman detects an Internet access. Do
FULL-VALUE tentatives, spaced by 1 second." FULL-VALUE tentatives, spaced by 1 second."
(define (online?)
(or (connman-online?)
(file-exists? "/tmp/installer-assume-online")))
(let* ((full-value 5)) (let* ((full-value 5))
(run-scale-page (run-scale-page
#:title (G_ "Checking connectivity") #:title (G_ "Checking connectivity")
@ -127,10 +131,10 @@ FULL-VALUE tentatives, spaced by 1 second."
#:scale-update-proc #:scale-update-proc
(lambda (value) (lambda (value)
(sleep 1) (sleep 1)
(if (connman-online?) (if (online?)
full-value full-value
(+ value 1)))) (+ value 1))))
(unless (connman-online?) (unless (online?)
(run-error-page (run-error-page
(G_ "The selected network does not provide access to the \ (G_ "The selected network does not provide access to the \
Internet, please try again.") Internet, please try again.")