From unknown Fri Jun 20 18:14:38 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#71665 <71665@debbugs.gnu.org> To: bug#71665 <71665@debbugs.gnu.org> Subject: Status: [PATCH v2 5/5] tests: Add restic system test. Reply-To: bug#71665 <71665@debbugs.gnu.org> Date: Sat, 21 Jun 2025 01:14:38 +0000 retitle 71665 [PATCH v2 5/5] tests: Add restic system test. reassign 71665 guix-patches submitter 71665 Richard Sent severity 71665 normal tag 71665 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 23:45:47 2024 Received: (at submit) by debbugs.gnu.org; 20 Jun 2024 03:45:47 +0000 Received: from localhost ([127.0.0.1]:41542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK8k6-0006Yr-QN for submit@debbugs.gnu.org; Wed, 19 Jun 2024 23:45:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:39478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK8k0-0006YL-Nc for submit@debbugs.gnu.org; Wed, 19 Jun 2024 23:45:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sK8jw-0006lp-Rc for guix-patches@gnu.org; Wed, 19 Jun 2024 23:45:36 -0400 Received: from mail-108-mta146.mxroute.com ([136.175.108.146]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sK8ju-0007I8-Pq for guix-patches@gnu.org; Wed, 19 Jun 2024 23:45:36 -0400 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta146.mxroute.com (ZoneMTA) with ESMTPSA id 19033bfc8c300017a3.002 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 20 Jun 2024 03:45:25 +0000 X-Zone-Loop: 3c6e924dc0902687f6a669b936b4546a22748b27af01 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ID4dv26EDja7geOt5SQBFDdNXc/hjEVNkcddZN2hvx0=; b=F+HHUaRzWlrilLBq2mvVYqJyez Aa1mZO6dxkkO+9/5bWjiHa0nWWKgo79NqdOW19SKrarDA2Qzb8j+1+YptHFfBnDJgDpjDByX5eveD 6/S2k3w0Q30tnL3rVPe0ADWv6fewPyJuwnMQo1Za6pKbZ/XpEz3iKx1z9yj5cbm37uJhUtP5SvQ93 qk2HKGUMAAax3gmcRqyVe/p5W7WH1MlmuOjY7X26nkOLXu9fOFBFkumPAGfum1vyVXzmw9/PK54hk 8DTuRs+pOqKJRSGcTEOFpOWD08Jq//gwViD/MYtvXkhXS2N9cJL1U/24d+kXTfDm2FZB1vyfJqPK2 64dAlfiw==; From: Richard Sent To: guix-patches@gnu.org, 71639@debbugs.gnu.org Subject: [PATCH v2 5/5] tests: Add restic system test. Date: Wed, 19 Jun 2024 23:44:16 -0400 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.146; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta146.mxroute.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: Richard Sent X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) * gnu/tests/restic.scm: Create. Change-Id: Iad5472414c140b133d9b402855bb2f01e96bb0cc --- gnu/tests/restic.scm | 119 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 gnu/tests/restic.scm diff --git a/gnu/tests/restic.scm b/gnu/tests/restic.scm new file mode 100644 index 0000000000..8d29ff441b --- /dev/null +++ b/gnu/tests/restic.scm @@ -0,0 +1,119 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Richard Sent . +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu tests restic) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader grub) + #:use-module (gnu packages) + #:use-module (gnu packages sync) ;rclone + #:use-module (gnu services) + #:use-module (gnu services backup) ;restic + #:use-module (gnu system) + #:use-module (gnu system vm) + #:use-module (gnu tests) + #:use-module (guix gexp) + #:use-module (guix modules) + #:use-module (srfi srfi-1) + #:export (%test-restic)) + +(define password "password") + +(define password-file + (plain-file "password-file" password)) + +(define password-command + (program-file "password-command" #~(display #$password))) + +(define (run-restic-test) + "Run tests in %restic-os." + + (define os + (marionette-operating-system + (simple-operating-system (extra-special-file "/root/.restic-test" + (plain-file "restic-test" + "Hello world!")) + ;; restic-backup-service only takes a string to avoid putting + ;; plaintext entries in the store. Ergo, symlink it. + (extra-special-file "/root/password-file" + password-file) + (service restic-backup-service-type + (restic-backup-configuration + (jobs + (list (restic-backup-job + (name "password-file-backup") + (repository "/root/restic-password-file-repo") + (schedule #~'(next-second '(0 15 30 45))) + (password-file "/root/password-file") + (files '("/root/.restic-test")) + (init? #t)) + (restic-backup-job + (name "password-command-backup") + (repository "/root/restic-password-command-repo") + (schedule #~'(next-second '(0 15 30 45))) + (password-command password-command) + (files '("/root/.restic-test")) + (init? #t))))))) + #:imported-modules '((gnu services herd) + (guix combinators)))) + + (define vm (virtual-machine + (operating-system os) + (memory-size 512))) + + (define test + (with-imported-modules (source-module-closure + '((gnu build marionette))) + #~(begin + (use-modules (gnu build marionette) + (srfi srfi-26) + (srfi srfi-64)) + + (let ((marionette (make-marionette (list #$vm)))) + + (test-runner-current (system-test-runner #$output)) + (test-begin "restic") + + (test-assert "backup-file-created" + (wait-for-file "/root/.restic-test" marionette)) + + (test-assert "mcron running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'mcron)) + marionette)) + + (test-assert "password-file backup completed" + (wait-for-file "/root/restic-password-file-repo/config" marionette + ;; Restic takes a second to run, give it a bit + ;; more time. + #:timeout 20)) + + (test-assert "password-comand backup completed" + (wait-for-file "/root/restic-password-file-repo/config" marionette + #:timeout 20)) + + (test-end))))) + + (gexp->derivation "restic-test" test)) + +(define %test-restic + (system-test + (name "restic") + (description "Basic tests for the restic service.") + (value (run-restic-test)))) -- 2.45.1 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 20 16:58:46 2024 Received: (at control) by debbugs.gnu.org; 20 Jun 2024 20:58:47 +0000 Received: from localhost ([127.0.0.1]:43949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKOrm-0004Zc-JA for submit@debbugs.gnu.org; Thu, 20 Jun 2024 16:58:46 -0400 Received: from mail-108-mta33.mxroute.com ([136.175.108.33]:35007) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKOrl-0004ZT-03 for control@debbugs.gnu.org; Thu, 20 Jun 2024 16:58:45 -0400 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta33.mxroute.com (ZoneMTA) with ESMTPSA id 1903771ae0100017a3.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 20 Jun 2024 20:58:35 +0000 X-Zone-Loop: 1922a3149cad8170f8fe0eabf9e36fd89ede882415d3 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Subject:From:To:Message-Id:Date:Sender:Reply-To :Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=micYQhsT3XQar3eSpITiku2ZWASzDgNsjfviFr8HOiw=; b=SdxDZ2UulCDTIHX7RELDuk0K/9 /+2NfMbtqETaQr7Z2Em4no+MAWsgEXD9fJvt/ujB6aL+q66ZSlxhOfjkgETBZlA+fBoZLrlk62Q9L hyfVqzShxqXCvnKz8v9Y5lvdaArJyY4bnA8hiKEK2sk8AkqnQkq8Oi4Gv3Rvpwv6lRsUEpsDzJTY9 vQJ5DYVhuJnP/kmQDYv5kyX/gRrmWAGin6FkdBh85NBRPmmnLgshFEgEmSA4N9RCZ521MToOW2iVh Fd+mLWLaWDiUCAsVNToBhmcFhwG2cKKcroCGVlmNQnUjZEJ6Gnpn5TGr17MSRAwIBcPedG+qahVok W/AIVN6w==; Date: Thu, 20 Jun 2024 16:58:32 -0400 Message-Id: <877cejqqkn.fsf@freakingpenguin.com> To: control@debbugs.gnu.org From: Richard Sent Subject: control message for bug #71665 X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 71665 quit From unknown Fri Jun 20 18:14:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 20 Jul 2024 11:24:12 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator