From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SJziKZ7jwWGHUAAAgWs5BA (envelope-from ) for ; Tue, 21 Dec 2021 15:24:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AJSqJZ7jwWE1ZAAA1q6Kng (envelope-from ) for ; Tue, 21 Dec 2021 14:24:30 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6DBBF35548 for ; Tue, 21 Dec 2021 15:24:30 +0100 (CET) Received: from localhost ([::1]:46850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzg45-0003DN-LD for larch@yhetil.org; Tue, 21 Dec 2021 09:24:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzg3s-00037w-3R for guix-patches@gnu.org; Tue, 21 Dec 2021 09:24:17 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41263) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzg3e-0000cc-KQ for guix-patches@gnu.org; Tue, 21 Dec 2021 09:24:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mzg3e-0005eS-Hf for guix-patches@gnu.org; Tue, 21 Dec 2021 09:24:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52703] [PATCH 2/2] tests: rsync: Define several modules. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Dec 2021 14:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52703 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52703@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52703-submit@debbugs.gnu.org id=B52703.164009663921708 (code B ref 52703); Tue, 21 Dec 2021 14:24:02 +0000 Received: (at 52703) by debbugs.gnu.org; 21 Dec 2021 14:23:59 +0000 Received: from localhost ([127.0.0.1]:52807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzg3b-0005e3-5g for submit@debbugs.gnu.org; Tue, 21 Dec 2021 09:23:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzg3Z-0005dg-J3 for 52703@debbugs.gnu.org; Tue, 21 Dec 2021 09:23:58 -0500 Received: from [2001:470:142:3::e] (port=50924 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzg3O-0000bK-Ug; Tue, 21 Dec 2021 09:23:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=pWJMfJJ2A6WOmuIGTv0vCLWwEYHMzg/AOLAvZUQ2Raw=; b=lSs+Ti1U202ee9fOAce5 qTAFj4u0BHsLM1eBoabZgrcCdl8rCnH2YlqOMr+93EjT1ByVBS933mb0y3V7x/pGAJjhMa0pPmtQs SElUXUcu4ewllL/YA9othirHePxt5yxjTCWO28/SxyUTL3Msc4085Vq4R5TSY6sMyokpx/wNcfpyS Rvy9GoOPix1N4GOJvqzglGuRPxkTAwTphewuSj3zVpQorDB4Tdsi+CNll6s9ksKcZXG1R+vmCVBpF s7ydr7ttNv1FrWpOCkc5+CRrms7n4Rk6IhD6bOQBDD0hoxXNfHf9WgDhfOzbkor8eDlLkkIPZdXXz s+3kNItfSZ+IeQ==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=35168 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzg3O-00066P-6h; Tue, 21 Dec 2021 09:23:46 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 21 Dec 2021 15:23:37 +0100 Message-Id: <20211221142337.3811-2-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211221142337.3811-1-ludo@gnu.org> References: <20211221142337.3811-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640096670; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=pWJMfJJ2A6WOmuIGTv0vCLWwEYHMzg/AOLAvZUQ2Raw=; b=Bk4bq1+u6rpWLaI+a+Lvnxz7u1JjETXlVVuzQVh198LQfbJ67cBAvuq+9ZJ36Aq8fqlwQX eA5700cQFKKLX9qUr/g9BsHYNKl3vwRpGZYCAGKdgNBG8kn0ssJcA9cZM72m6yhY5pGeyo vr5UsQxlNjxJxPD54EpJHQgjud2mMrCZNSiODe7vFP15Do2txYsjVgKZ+Yq8eKOBTHaEZO hIigpNhQ5kuOH40OKRLLSFb3MsIGm/i5XGulRz4H2xTd/E+SfDd516SfcClEUnzafKeRvO KI+bV3TXNGX/8EAEO3/t2FiHAVqKqKHdPsatqZbEpi2NIOh0/VjEWayGZ6V0BA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640096670; a=rsa-sha256; cv=none; b=gbHEevXjjWUJUlSsZQxgNSulKtV8bqqhMeucMrdI0y58e7ON3JQhz5eP+Q6ilPzrKCSAXJ 3t6GKGjFA6HUxchnQ5vINkW44zNiXA8u9/JA8U/qQKR5X2emOsrPYgUOO1p+yvoNEHRTX5 29NV9Y0iLbQekYfFV+jyXKuJL7ZAwhKwmcBON5tjkiwAA2uVWT+zDjfNK0s6w60EFt78MS IZloJ5vJR8tbHXNJPBfSCrT/fmE8O4BDnuGOVG12nwQAzb0ec2v9ZWXdKuuUBr/GAPy3IL KoZF8FgbJ1hq4nIkrfhI+J0cpZH5w3uXhxXvivQsdGER0PYpYU7pOlue2e8XiA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=lSs+Ti1U; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=lSs+Ti1U; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 6DBBF35548 X-Spam-Score: -3.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: H2czzHkYLF1I * gnu/tests/rsync.scm (run-rsync-test)["Test file not copied to read-only share", "Test file correctly received from read-only share"]: New tests. (%rsync-os): Define two modules. --- gnu/tests/rsync.scm | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/gnu/tests/rsync.scm b/gnu/tests/rsync.scm index 91f2b41cec..079a898cdc 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 ;;; Copyright © 2018 Clément Lassieur +;;; Copyright © 2021 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -104,6 +105,35 @@ (define marionette (read-line port)))) marionette)) + (test-equal "Test file not copied to read-only share" + 10 ;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 @@ (define* %rsync-os (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 -- 2.33.0