From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 0E7941FF187 for ; Fri, 19 Dec 2025 17:19:07 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DCE6E115B1; Fri, 19 Dec 2025 17:19:56 +0100 (CET) From: Robert Obkircher To: pbs-devel@lists.proxmox.com Date: Fri, 19 Dec 2025 17:18:32 +0100 Message-ID: <20251219161850.244154-6-r.obkircher@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251219161850.244154-1-r.obkircher@proxmox.com> References: <20251219161850.244154-1-r.obkircher@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1766161151399 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.053 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH v2 proxmox-backup 5/5] DO NOT MERGE: test script for reference X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" Signed-off-by: Robert Obkircher --- test-pipes.sh | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 test-pipes.sh diff --git a/test-pipes.sh b/test-pipes.sh new file mode 100755 index 00000000..f58d0ab4 --- /dev/null +++ b/test-pipes.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +# expects env variables: PBS_REPOSITORY PBS_PASSWORD PBS_FINGERPRINT + +# big is a random 524288001 bytes file (not divisible by block size) +F="${1:-big}" +du --bytes "$F" + +sep() { + sleep 2 + echo +} +title() { + sep + echo "$1" + echo +} +cmp-restored() { + rm -f restored + proxmox-backup-client restore "host/$HOSTNAME" "$1" restored + cmp --silent restored "$2" || echo "INVALID RESTORED FILE" +} + +# modify the first block to test incremental backups +M=modified +cp "$F" "$M" +printf 'modified' | dd of="$M" bs=1 conv=notrunc + +# links to /proc/self/fd/0 which links to something like /dev/pts/2 +title fifo +cat "$F" | proxmox-backup-client backup fifo.img:/dev/stdin +cmp-restored "fifo.img" "$F" +sep +cat "$M" | proxmox-backup-client backup fifo.img:/dev/stdin +cmp-restored "fifo.img" "$M" + +# note: this version already worked before because it doesn't actually use a pipe +title redirect +< "$F" proxmox-backup-client backup redirect.img:/dev/stdin +cmp-restored "redirect.img" "$F" +sep +< "$M" proxmox-backup-client backup redirect.img:/dev/stdin +cmp-restored "redirect.img" "$M" + +# the client aliases - to /dev/stdin +title catminus +cat "$F" | proxmox-backup-client backup catminus.img:- +cmp-restored "catminus.img" "$F" +sep +cat "$M" | proxmox-backup-client backup catminus.img:- +cmp-restored "catminus.img" "$M" + +# substitutes something like "/dev/fd/63" +title psubst +proxmox-backup-client backup psubst.img:<(cat "$F") +cmp-restored "psubst.img" "$F" +sep +proxmox-backup-client backup psubst.img:<(cat "$M") +cmp-restored "psubst.img" "$M" + +# normal file based backup +title normal +proxmox-backup-client backup "normal.img:$F" +cmp-restored "normal.img" "$F" +sep +proxmox-backup-client backup "normal.img:$M" +cmp-restored "normal.img" "$M" + -- 2.47.3 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel