From: Robert Obkircher <r.obkircher@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH v2 proxmox-backup 5/5] DO NOT MERGE: test script for reference
Date: Fri, 19 Dec 2025 17:18:32 +0100 [thread overview]
Message-ID: <20251219161850.244154-6-r.obkircher@proxmox.com> (raw)
In-Reply-To: <20251219161850.244154-1-r.obkircher@proxmox.com>
Signed-off-by: Robert Obkircher <r.obkircher@proxmox.com>
---
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
prev parent reply other threads:[~2025-12-19 16:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 16:18 [pbs-devel] [PATCH v2 proxmox-backup 0/5] fix: #3847 pipe from STDIN to proxmox-backup-client Robert Obkircher
2025-12-19 16:18 ` [pbs-devel] [PATCH v2 proxmox-backup 1/5] fix #3847: datastore: support writing fidx files of unknown size Robert Obkircher
2025-12-19 16:18 ` [pbs-devel] [PATCH v2 proxmox-backup 2/5] fix #3847: api: backup: make fixed index file size optional Robert Obkircher
2025-12-19 16:18 ` [pbs-devel] [PATCH v2 proxmox-backup 3/5] fix #3847: client: support fifo pipe inputs for images Robert Obkircher
2025-12-19 16:18 ` [pbs-devel] [PATCH v2 proxmox-backup 4/5] fix #3847: client: treat minus sign as stdin Robert Obkircher
2025-12-19 16:18 ` Robert Obkircher [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251219161850.244154-6-r.obkircher@proxmox.com \
--to=r.obkircher@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.