diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-01-25 23:36:11 -0500 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-01-25 23:48:37 -0500 |
commit | 0d41fe4855588fb659b8adafe215d5573517a79b (patch) | |
tree | 38b274bd03375f4fa5b7d3a9fb3f64a19786bef2 /gnu/tests/rsync.scm | |
parent | 7c57821c68d199ad56a8ed750b36eccc7ef238dd (diff) | |
parent | 1a5302435ff0d2822b823f5a6fe01faa7a85c629 (diff) | |
download | guix-0d41fe4855588fb659b8adafe215d5573517a79b.tar.gz |
Merge branch 'staging' into core-updates.
With "conflicts" resolved in (mostly in favor of master/staging): gnu/packages/admin.scm gnu/packages/gnuzilla.scm gnu/packages/gtk.scm gnu/packages/kerberos.scm gnu/packages/linux.scm guix/lint.scm
Diffstat (limited to 'gnu/tests/rsync.scm')
-rw-r--r-- | gnu/tests/rsync.scm | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/gnu/tests/rsync.scm b/gnu/tests/rsync.scm index 91f2b41cec..ea53a157bb 100644 --- a/gnu/tests/rsync.scm +++ b/gnu/tests/rsync.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Christopher Baines <mail@cbaines.net> ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org> +;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -104,6 +105,35 @@ PORT." (read-line port)))) marionette)) + (test-equal "Test file not copied to read-only share" + 1 ;see "EXIT VALUES" in rsync(1) + (marionette-eval + '(status:exit-val + (system* "rsync" "/tmp/input" + (string-append "rsync://localhost:" + (number->string #$rsync-port) + "/read-only/input"))) + marionette)) + + (test-equal "Test file correctly received from read-only share" + "\"Hi!\" from the read-only share." + (marionette-eval + '(begin + (use-modules (ice-9 rdelim)) + + (call-with-output-file "/srv/read-only/the-file" + (lambda (port) + (display "\"Hi!\" from the read-only share." port))) + + (zero? + (system* "rsync" + (string-append "rsync://localhost:" + (number->string #$rsync-port) + "/read-only/the-file") + "/tmp/output")) + (call-with-input-file "/tmp/output" read-line)) + marionette)) + (test-end)))) (gexp->derivation "rsync-test" test)) @@ -113,7 +143,15 @@ PORT." (let ((base-os (simple-operating-system (service dhcp-client-service-type) - (service rsync-service-type)))) + (service rsync-service-type + (rsync-configuration + (modules (list (rsync-module + (name "read-only") + (file-name "/srv/read-only")) + (rsync-module + (name "files") + (file-name "/srv/read-write") + (read-only? #f))))))))) (operating-system (inherit base-os) (packages (cons* rsync |