unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan <stefan-guix@vodafonemail.de>
To: Mathieu Othacehe <othacehe@gnu.org>
Cc: Danny Milosavljevic <dannym@scratchpost.org>, 41820@debbugs.gnu.org
Subject: [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
Date: Wed, 1 Jul 2020 20:48:42 +0200	[thread overview]
Message-ID: <39F7973C-8A64-4B6D-9A26-D98AA7F37475@vodafonemail.de> (raw)
In-Reply-To: <87tuz44v7k.fsf@gnu.org>

Hi Mathieu!

> * As you probably noticed the bootloading & system part of Guix is
> moving a lot recently. This patch does not apply on master, so it would
> be nice if you could rebase it and pass "--base=auto" option to "git
> format-patch" so that it's easier to apply it.

OK.

> * It would be nice to have tests for this functionality. There's already
> a (gnu tests nfs) module, testing the NFS service. Maybe you could add a
> test case of a marionette booting from a local NFS share.

I tried. Unfortunately on my little aarch64 SBC compiling the necessary packages takes days – there are no substitutes available – and in the end qemu-5 has a failing test. I retried and rebased and retried and wasted days in the end. I’m a bit frustrated. :-(

  TEST    iotest-qcow2: 244 [fail]
QEMU          -- "/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../aarch64-softmmu/qemu-system-aarch64" -nodefaults -display none -machine
 virt -accel qtest
QEMU_IMG      -- "/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../qemu-img"
QEMU_IO       -- "/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../qemu-io"  --cache writeback --aio threads -f qcow2
QEMU_NBD      -- "/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../qemu-nbd"
IMGFMT        -- qcow2 (compat=1.1)
IMGPROTO      -- file
PLATFORM      -- Linux/aarch64  5.5.9
TEST_DIR      -- /tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/scratch
SOCK_DIR      -- /tmp/guix-build-qemu-5.0.0.drv-0/tmp.qUme9gv2Jy
SOCKET_SCM_HELPER -- /tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/socket_scm_helper

--- /tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/244.out      2020-04-28 16:49:25.000000000 +0000
+++ /tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/244.out.bad  2020-06-29 10:27:02.036147483 +0000
@@ -74,6 +74,7 @@
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 1048576/1048576 bytes at offset 1048576
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Pattern verification failed at offset 2097152, 2097152 bytes
 read 2097152/2097152 bytes at offset 2097152
 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 1048576/1048576 bytes at offset 4194304
@@ -108,7 +109,7 @@
 read 4194304/4194304 bytes at offset 2097152
 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)

-Images are identical.
+Content mismatch at offset 2097152!
 qcow2 file size after I/O: 327680

 === bdrv_co_block_status test for file and offset=0 ===



This is the test that I wrote and wanted to try. Maybe you can pick it up and give it a try.


(define (run-nfs-root-fs-test)
  "Run a test of an OS mounting its root file system via NFS."
  (define nfs-root-server-os
    (marionette-operating-system
     (operating-system
       (inherit %nfs-os)
       (file-systems %base-file-systems)
       (services
         (modify-services (operating-system-user-services %nfs-os)
           (nfs-service-type
            config
            =>
            (nfs-configuration
             (debug '(nfs nfsd mountd))
             (exports '(("/export"
                         "*(rw,insecure,no_subtree_check,crossmnt,fsid=root,no_root_squash,insecure,async)"))))))))
     #:requirements '(nscd)
     #:imported-modules '((gnu services herd)
                          (guix combinators))))

  (define nfs-root-client-os
    (marionette-operating-system
     (operating-system
       (inherit %nfs-os)
       (kernel-arguments '("ip=dhcp"))
       (file-systems (cons
                      (file-system
                        (type "nfs")
                        (mount-point "/")
                        (device (nfs-share ":/export"))
                        (options "addr=0.0.0.0,vers=4.2"))
                     %base-file-systems)))
     #:requirements '(nscd)
     #:imported-modules '((gnu services herd)
                          (guix combinators))))

  (define test
    (with-imported-modules '((gnu build marionette))
      #~(begin
          (use-modules (gnu build marionette)
                       (srfi srfi-64))

          (define server-marionette
            (make-marionette (list #$(virtual-machine nfs-root-server-os))))
          (define client-marionette
            (make-marionette (list #$(virtual-machine nfs-root-client-os))))

          (mkdir #$output)
          (chdir #$output)

          (test-begin "start-nfs-root-server")
          (marionette-eval
           '(begin
              (use-modules (gnu services herd))

              (current-output-port
               (open-file "/dev/console" "w0"))
              (chmod "/export" #o777)
              (symlink "/gnu" "/export/gnu")
              (start-service 'nscd))
              (start-service 'networking)
              (start-service 'nfs)
          server-marionette)

          ;; Wait for the NFS services to be up and running.
          (test-assert "nfs services are running"
           (wait-for-file "/var/run/rpc.statd.pid" server-marionette))

          (test-begin "boot-nfs-root-client")
          (marionette-eval
           '(begin
              (use-modules (gnu services herd))

              (current-output-port
               (open-file "/dev/console" "w0"))
               (with-output-to-file "/var/run/mounts"
                (lambda () (system* "mount")))
               (chmod "/var/run/mounts" #o777))
          client-marionette)

          (test-assert "nfs-root-client booted")
          (marionelle-eval
           '(begin
              (and (file-exists? "/export/var/run/mounts")
                   (system* "cat" "/export/var/run/mounts")))
          server-marionette)

          (test-end)
          (exit (= (test-runner-fail-count (test-runner-current)) 0)))))

  (gexp->derivation "nfs-server-test" test))

(define %test-nfs-root-fs
  (system-test
   (name "nfs-root-fs")
   (description "Test that an NFS server can be started and exported
directories can be mounted.")
   (value (run-nfs-root-fs-test))))


Bye

Stefan





  reply	other threads:[~2020-07-01 18:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 23:37 [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device Stefan
2020-06-21  9:35 ` Mathieu Othacehe
2020-07-01 18:48   ` Stefan [this message]
2020-07-01 18:48   ` Stefan
2020-07-18 13:55     ` Stefan
2020-07-21 14:33       ` Danny Milosavljevic
  -- strict thread matches above, loose matches on Subject: below --
2020-05-01 20:32 [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs Stefan
2020-05-10  8:20 ` Mathieu Othacehe
2020-05-10 21:13   ` Stefan
2020-05-23  8:02     ` Mathieu Othacehe
2020-05-24 10:18       ` Stefan
2020-06-06 13:30         ` Stefan
2020-06-06 13:33           ` Stefan
2020-06-06 17:37             ` Danny Milosavljevic
     [not found]               ` <46CD97B3-9994-4AB7-AA7D-4DE39AB7A238@vodafonemail.de>
2020-06-09 13:44                 ` Danny Milosavljevic
2020-06-11  4:21                   ` Maxim Cournoyer
2020-06-11 23:43                     ` [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device Stefan
2020-06-20 13:52                       ` Stefan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39F7973C-8A64-4B6D-9A26-D98AA7F37475@vodafonemail.de \
    --to=stefan-guix@vodafonemail.de \
    --cc=41820@debbugs.gnu.org \
    --cc=dannym@scratchpost.org \
    --cc=othacehe@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).