From patchwork Thu Jan 10 21:58:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danny Milosavljevic X-Patchwork-Id: 716 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 2C5B016A58; Thu, 10 Jan 2019 22:08:02 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 12DFC16A54 for ; Thu, 10 Jan 2019 22:08:01 +0000 (GMT) Received: from localhost ([127.0.0.1]:51159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghiUa-0001Io-7P for patchwork@mira.cbaines.net; Thu, 10 Jan 2019 17:08:00 -0500 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 X-Loop: help-debbugs@gnu.org Subject: [bug#34039] [WIP] tests: Make docker system test more comprehensive. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 10 Jan 2019 22:05:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34039 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 34039@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15471578799098 (code B ref -1); Thu, 10 Jan 2019 22:05:03 +0000 Received: (at submit) by debbugs.gnu.org; 10 Jan 2019 22:04:39 +0000 Received: from localhost ([127.0.0.1]:54358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghiRL-0002Mg-A2 for submit@debbugs.gnu.org; Thu, 10 Jan 2019 17:04:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghiRJ-0002MT-0D for submit@debbugs.gnu.org; Thu, 10 Jan 2019 17:04:37 -0500 Received: from lists.gnu.org ([209.51.188.17]:40685) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghiR7-0005Fv-2G for submit@debbugs.gnu.org; Thu, 10 Jan 2019 17:04:25 -0500 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 Received: from dayas.3.home (77.116.226.247.wireless.dyn.drei.com [77.116.226.247]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 7C24F336062A; Thu, 10 Jan 2019 22:58:53 +0100 (CET) From: Danny Milosavljevic Date: Thu, 10 Jan 2019 22:58:32 +0100 Message-Id: <20190110215832.31676-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Tags: patch X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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 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 © 2019 Danny Milosavljevic ;;; Copyright © 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)) - (test-eq "fetch version" + (test-eq "fetch docker version" 0 (marionette-eval `(begin @@ -87,6 +89,35 @@ "version")) marionette)) + (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/guix") + "system" "docker-image" + ,(string-append #$guix + ; MISSING "/share/guile/site/2.2/gnu/system/examples/docker-image.tmpl" + "/share/guile/site/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=/var/guix/profiles/system" + "--entrypoint" + "/var/guix/profiles/system/profile/bin/guile" + image-id + "/var/guix/profiles/system/boot"))) + marionette)) + (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) @@ -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))))