From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#30505: marionette/virtio-console issues lead to test failures Date: Sun, 18 Feb 2018 01:01:31 +0100 Message-ID: <87vaevi2sk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enCQg-0001IJ-Sn for bug-guix@gnu.org; Sat, 17 Feb 2018 19:02:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enCQc-00047I-JM for bug-guix@gnu.org; Sat, 17 Feb 2018 19:02:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:40858) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enCQc-00047C-Ey for bug-guix@gnu.org; Sat, 17 Feb 2018 19:02:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1enCQc-00036n-4t for bug-guix@gnu.org; Sat, 17 Feb 2018 19:02:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enCQF-00010g-9w for bug-guix@gnu.org; Sat, 17 Feb 2018 19:01:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enCQB-00042E-7v for bug-guix@gnu.org; Sat, 17 Feb 2018 19:01:39 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:39546) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1enCQA-000422-Tm for bug-guix@gnu.org; Sat, 17 Feb 2018 19:01:35 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 70600108A8 for ; Sun, 18 Feb 2018 01:01:33 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FgiCa4l58itz for ; Sun, 18 Feb 2018 01:01:31 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 9ACFF105E8 for ; Sun, 18 Feb 2018 01:01:31 +0100 (CET) List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 30505@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, On core-updates (or is it master now?), =E2=80=9Cmake check-system TESTS=3D= basic=E2=80=9D fails with: --8<---------------cut here---------------start------------->8--- Test begin: test-name: "/run/current-system is a GC root" source-file: "/gnu/store/irm2375f5p7nzyqqllwjfaby3ywhi5wq-basic-builder" source-line: 2 source-form: (test-eq "/run/current-system is a GC root" (quote success!)= (marionette-eval (quote (begin (add-to-load-path "/gnu/store/pn333fnrdazad= mzvkbyzby8cfr176yrh-guix-0.14.0-8.bc880f9/share/guile/site/2.2") (use-modul= es (srfi srfi-34) (guix store)) (let ((system (readlink "/run/current-syste= m"))) (guard (c ((nix-protocol-error? c) (and (file-exists? system) (quote = success!)))) (with-store store (delete-paths store (list system)) #f))))) m= arionette)) Test end: result-kind: fail actual-value: #{\x1b;%G\x1b;%G\x1b;%G\x1b;%G\x1b;%G\x1b;%Gsuccess!}# expected-value: success! --8<---------------cut here---------------end--------------->8--- We see similar issues with other system tests. The =E2=80=9C\x1b;%G=E2=80=9D sequences correspond to the =E2=80=9Cselect U= TF-8=E2=80=9D console code (see console_codes(4)). We=E2=80=99re receiving this as if we were a conso= le, but in fact all we want is to exchange raw bytes between the host and the guest; we don=E2=80=99t want to be a full-fledged console. I thought that using virtserialport instead of virtio-console might help (see patch below), but the problem persists. I=E2=80=99m not sure if it=E2= =80=99s the kernel that decides to send these codes or what. Also unclear as to why this happens on =E2=80=98core-updates=E2=80=99 and not =E2=80=98master=E2= =80=99. What am I missing? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index 7554a710a..173a67cef 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright =C2=A9 2016, 2017 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2016, 2017, 2018 Ludovic Court=C3=A8s ;;; ;;; This file is part of GNU Guix. ;;; @@ -97,8 +97,11 @@ QEMU monitor and to the guest's backdoor REPL." "-monitor" (string-append "unix:" socket-directory "/monitor") "-chardev" (string-append "socket,id=3Drepl,path=3D" socket-dire= ctory "/repl") + + ;; See + ;; . "-device" "virtio-serial" - "-device" "virtconsole,chardev=3Drepl")) + "-device" "virtserialport,chardev=3Drepl,name=3Dorg.gnu.guix.por= t.0")) =20 (define (accept* port) (match (select (list port) '() (list port) timeout) diff --git a/gnu/tests.scm b/gnu/tests.scm index 3e4c3d4e3..31249f0be 100644 --- a/gnu/tests.scm +++ b/gnu/tests.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright =C2=A9 2016, 2017 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2016, 2017, 2018 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2017 Mathieu Othacehe ;;; Copyright =C2=A9 2017 Tobias Geerinckx-Rice ;;; @@ -69,7 +69,7 @@ marionette-configuration make-marionette-configuration marionette-configuration? (device marionette-configuration-device ;string - (default "/dev/hvc0")) + (default "/dev/virtio-ports/org.gnu.guix.port.0")) (imported-modules marionette-configuration-imported-modules (default '())) (requirements marionette-configuration-requirements ;list of symbols @@ -87,17 +87,10 @@ =20 (modules '((ice-9 match) (srfi srfi-9 gnu) - (guix build syscalls) (rnrs bytevectors))) (start - (with-imported-modules `((guix build syscalls) - ,@imported-modules) + (with-imported-modules imported-modules #~(lambda () - (define (clear-echo termios) - (set-field termios (termios-local-flags) - (logand (lognot (local-flags ECHO)) - (termios-local-flags termios)))) - (define (self-quoting? x) (letrec-syntax ((one-of (syntax-rules () ((_) #f) @@ -112,20 +105,7 @@ (dynamic-wind (const #t) (lambda () - (let* ((repl (open-file #$device "r+0")) - (termios (tcgetattr (fileno repl))) - (console (open-file "/dev/console" "r+0")= )) - ;; Don't echo input back. - (tcsetattr (fileno repl) (tcsetattr-action TCS= ANOW) - (clear-echo termios)) - - ;; Redirect output to the console. - (close-fdes 1) - (close-fdes 2) - (dup2 (fileno console) 1) - (dup2 (fileno console) 2) - (close-port console) - + (let ((repl (open-file #$device "r+0"))) (display 'ready repl) (let loop () (newline repl) diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 1bc7a7027..64332000a 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -323,11 +323,6 @@ info --version") 'success! (marionette-eval '(begin ;; Make sure the (guix =E2=80=A6) modules = are found. - ;; - ;; XXX: Currently shepherd and marionette = run - ;; on Guile 2.0 whereas Guix is on 2.2. Y= et - ;; we should be able to load the 2.0 Scheme - ;; files since it's pure Scheme. (add-to-load-path #+(file-append guix "/share/guile/site/2.= 2")) =20 @@ -337,9 +332,12 @@ info --version") (guard (c ((nix-protocol-error? c) (and (file-exists? system) 'success!))) - (with-store store - (delete-paths store (list system)) - #f)))) + (parameterize ((current-build-output-p= ort + (open-file "/dev/conso= le" + "r+0"))) + (with-store store + (delete-paths store (list system)) + #f))))) marionette)) =20 ;; This symlink is currently unused, but better have it point to= the --=-=-=--