From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:33457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghiRn-0007vN-6S for guix-patches@gnu.org; Thu, 10 Jan 2019 17:05:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghiRl-0005bM-54 for guix-patches@gnu.org; Thu, 10 Jan 2019 17:05:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55078) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ghiRk-0005aZ-57 for guix-patches@gnu.org; Thu, 10 Jan 2019 17:05:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ghiRj-0002NW-Ur for guix-patches@gnu.org; Thu, 10 Jan 2019 17:05:03 -0500 Subject: [bug#34039] [WIP] tests: Make docker system test more comprehensive. Resent-Message-ID: Received: from eggs.gnu.org ([209.51.188.92]:32976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghiR5-0007Ch-NP for guix-patches@gnu.org; Thu, 10 Jan 2019 17:04:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghiLp-0002jy-Q4 for guix-patches@gnu.org; Thu, 10 Jan 2019 16:58:58 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:58814) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghiLp-0002hM-JK for guix-patches@gnu.org; Thu, 10 Jan 2019 16:58:57 -0500 From: Danny Milosavljevic Date: Thu, 10 Jan 2019 22:58:32 +0100 Message-Id: <20190110215832.31676-1-dannym@scratchpost.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 34039@debbugs.gnu.org This system test fails with the error message "Read-only store". * gnu/tests/docker.scm (run-docker-test): Add test "pack guest OS as docker image, load it and run it". (%test-docker)[description]: Modify. --- gnu/tests/docker.scm | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/gnu/tests/docker.scm b/gnu/tests/docker.scm index 973a84c55..32fae82a8 100644 --- a/gnu/tests/docker.scm +++ b/gnu/tests/docker.scm @@ -1,4 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2019 Danny Milosavljevic ;;; Copyright =C2=A9 2017 Christopher Baines ;;; ;;; This file is part of GNU Guix. @@ -27,6 +28,7 @@ #:use-module (gnu services docker) #:use-module (gnu services desktop) #:use-module (gnu packages docker) + #:use-module (gnu packages package-management) #:use-module (guix gexp) #:use-module (guix store) #:export (%test-docker)) @@ -79,7 +81,7 @@ ((pid) (number? pid)))))) marionette)) =20 - (test-eq "fetch version" + (test-eq "fetch docker version" 0 (marionette-eval `(begin @@ -87,6 +89,35 @@ "version")) marionette)) =20 + (test-eq "pack guest OS as docker image, load it and run it" + 0 + (marionette-eval + `(begin + (define slurp + (lambda args + (let* ((port (apply open-pipe* OPEN_READ args)) + (output (read-line port)) + (status (close-pipe port))) + output))) + (let* ((tar-name (slurp ,(string-append #$guix "/bin/gui= x") + "system" "docker-image" + ,(string-append #$guix + ; MISSING "/shar= e/guile/site/2.2/gnu/system/examples/docker-image.tmpl" + "/share/guile/si= te/2.2/gnu/system/examples/bare-bones.tmpl"))) + (_ (write tar-name)) + (image-id (slurp ,(string-append #$docker-cli + "/bin/docker") + "load" "-i" tar-name)) + (_ (write image-id))) + (system* ,(string-append #$docker-cli "/bin/docker") + "run" "-e" + "GUIX_NEW_SYSTEM=3D/var/guix/profiles/system" + "--entrypoint" + "/var/guix/profiles/system/profile/bin/guile" + image-id + "/var/guix/profiles/system/boot"))) + marionette)) + (test-end) (exit (=3D (test-runner-fail-count (test-runner-current)) 0)))= )) =20 @@ -95,5 +126,5 @@ (define %test-docker (system-test (name "docker") - (description "Connect to the running Docker service.") + (description "Test the Docker service.") (value (run-docker-test))))