[pbs-devel] [PATCH v8 proxmox-backup 60/69] test-suite: Makefile: add debian package and related files

Christian Ebner c.ebner at proxmox.com
Tue May 28 11:42:54 CEST 2024


Adds the required Makefile and debian packaging entries to package
the test suite binary as standalone debian package.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 7:
- no changes

changes since version 6:
- move binary into its own debian package

 Makefile                                       | 18 +++++++++++-------
 debian/control                                 |  7 +++++++
 debian/proxmox-backup-client.bash-completion   |  1 +
 debian/proxmox-backup-test-suite.bc            |  8 ++++++++
 debian/proxmox-backup-test-suite.install       |  3 +++
 docs/Makefile                                  |  2 ++
 docs/command-line-tools.rst                    |  5 +++++
 docs/command-syntax.rst                        |  4 ++++
 docs/conf.py                                   |  1 +
 docs/proxmox-backup-test-suite/description.rst |  2 ++
 docs/proxmox-backup-test-suite/man1.rst        | 17 +++++++++++++++++
 zsh-completions/_proxmox-backup-test-suite     | 13 +++++++++++++
 12 files changed, 74 insertions(+), 7 deletions(-)
 create mode 100644 debian/proxmox-backup-test-suite.bc
 create mode 100644 debian/proxmox-backup-test-suite.install
 create mode 100644 docs/proxmox-backup-test-suite/description.rst
 create mode 100644 docs/proxmox-backup-test-suite/man1.rst
 create mode 100644 zsh-completions/_proxmox-backup-test-suite

diff --git a/Makefile b/Makefile
index 03e938767..8529363ce 100644
--- a/Makefile
+++ b/Makefile
@@ -8,11 +8,12 @@ SUBDIRS := etc www docs templates
 
 # Binaries usable by users
 USR_BIN := \
-	proxmox-backup-client 	\
-	proxmox-file-restore	\
-	pxar			\
-	proxmox-tape		\
-	pmtx			\
+	proxmox-backup-client 		\
+	proxmox-backup-test-suite	\
+	proxmox-file-restore		\
+	pxar				\
+	proxmox-tape			\
+	pmtx				\
 	pmt
 
 # Binaries usable by admins
@@ -60,9 +61,10 @@ CLIENT_DBG_DEB=$(PACKAGE)-client-dbgsym_$(DEB_VERSION)_$(ARCH).deb
 RESTORE_DEB=proxmox-backup-file-restore_$(DEB_VERSION)_$(ARCH).deb
 RESTORE_DBG_DEB=proxmox-backup-file-restore-dbgsym_$(DEB_VERSION)_$(ARCH).deb
 DOC_DEB=$(PACKAGE)-docs_$(DEB_VERSION)_all.deb
+TEST_SUITE_DEB=$(PACKAGE)-test-suite_$(DEB_VERSION)_$(ARCH).deb
 
 DEBS=$(SERVER_DEB) $(SERVER_DBG_DEB) $(CLIENT_DEB) $(CLIENT_DBG_DEB) \
-     $(RESTORE_DEB) $(RESTORE_DBG_DEB)
+     $(RESTORE_DEB) $(RESTORE_DBG_DEB) $(TEST_SUITE_DEB)
 
 DSC = rust-$(PACKAGE)_$(DEB_VERSION).dsc
 
@@ -165,6 +167,8 @@ $(COMPILED_BINS) $(COMPILEDIR)/dump-catalog-shell-cli $(COMPILEDIR)/docgen: .do-
 	    --bin proxmox-backup-client \
 	    --bin dump-catalog-shell-cli \
 	    --bin proxmox-backup-debug \
+	    --package proxmox-backup-test-suite \
+	    --bin proxmox-backup-test-suite \
 	    --package proxmox-file-restore \
 	    --bin proxmox-file-restore \
 	    --package pxar-bin \
@@ -218,7 +222,7 @@ upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
 upload: $(SERVER_DEB) $(CLIENT_DEB) $(RESTORE_DEB) $(DOC_DEB)
 	# check if working directory is clean
 	git diff --exit-code --stat && git diff --exit-code --stat --staged
-	tar cf - $(SERVER_DEB) $(SERVER_DBG_DEB) $(DOC_DEB) $(CLIENT_DEB) $(CLIENT_DBG_DEB) \
+	tar cf - $(SERVER_DEB) $(SERVER_DBG_DEB) $(DOC_DEB) $(CLIENT_DEB) $(CLIENT_DBG_DEB) $(TEST_SUIT_DEB) \
 	  | ssh -X repoman at repo.proxmox.com upload --product pbs --dist $(UPLOAD_DIST)
 	tar cf - $(CLIENT_DEB) $(CLIENT_DBG_DEB) | ssh -X repoman at repo.proxmox.com upload --product "pve,pmg,pbs-client" --dist $(UPLOAD_DIST)
 	tar cf - $(RESTORE_DEB) $(RESTORE_DBG_DEB) | ssh -X repoman at repo.proxmox.com upload --product "pve" --dist $(UPLOAD_DIST)
diff --git a/debian/control b/debian/control
index a7f8f327b..38720b983 100644
--- a/debian/control
+++ b/debian/control
@@ -216,3 +216,10 @@ Description: Proxmox Backup single file restore tools for pxar and block device
  This package contains the Proxmox Backup single file restore client for
  restoring individual files and folders from both host/container and VM/block
  device backups. It includes a block device restore driver using QEMU.
+
+Package: proxmox-backup-test-suite
+Architecture: any
+Depends: proxmox-backup-client, ${shlibs:Depends}
+Description: Proxmox Backup Test Suite tool
+ This package contains the Proxmox Backup Test Suite, which provides a cli tool
+ to run performance tests.
diff --git a/debian/proxmox-backup-client.bash-completion b/debian/proxmox-backup-client.bash-completion
index 437360175..c4ff02ae6 100644
--- a/debian/proxmox-backup-client.bash-completion
+++ b/debian/proxmox-backup-client.bash-completion
@@ -1,2 +1,3 @@
 debian/proxmox-backup-client.bc proxmox-backup-client
+debian/proxmox-backup-test-suite.bc proxmox-backup-test-suite
 debian/pxar.bc pxar
diff --git a/debian/proxmox-backup-test-suite.bc b/debian/proxmox-backup-test-suite.bc
new file mode 100644
index 000000000..2686d7eaa
--- /dev/null
+++ b/debian/proxmox-backup-test-suite.bc
@@ -0,0 +1,8 @@
+# proxmox-backup-test-suite bash completion
+
+# see http://tiswww.case.edu/php/chet/bash/FAQ
+# and __ltrim_colon_completions() in /usr/share/bash-completion/bash_completion
+# this modifies global var, but I found no better way
+COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
+
+complete -C 'proxmox-backup-test-suite bashcomplete' proxmox-backup-test-suite
diff --git a/debian/proxmox-backup-test-suite.install b/debian/proxmox-backup-test-suite.install
new file mode 100644
index 000000000..e0cb31ac6
--- /dev/null
+++ b/debian/proxmox-backup-test-suite.install
@@ -0,0 +1,3 @@
+usr/bin/proxmox-backup-test-suite
+usr/share/man/man1/proxmox-backup-test-suite.1
+usr/share/zsh/vendor-completions/_proxmox-backup-test-suite
diff --git a/docs/Makefile b/docs/Makefile
index d6c61c86e..014739f69 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -7,6 +7,7 @@ GENERATED_SYNOPSIS := 						\
 	proxmox-backup-manager/synopsis.rst			\
 	proxmox-backup-debug/synopsis.rst			\
 	proxmox-file-restore/synopsis.rst			\
+	proxmox-backup-test-suite/synopsis.rst			\
 	pxar/synopsis.rst					\
 	pmtx/synopsis.rst					\
 	pmt/synopsis.rst					\
@@ -33,6 +34,7 @@ MAN1_PAGES := 				\
 	proxmox-backup-manager.1	\
 	proxmox-file-restore.1		\
 	proxmox-backup-debug.1		\
+	proxmox-backup-test-suite.1	\
 	pbs2to3.1			\
 
 MAN5_PAGES :=				\
diff --git a/docs/command-line-tools.rst b/docs/command-line-tools.rst
index 0cac17c8b..3655b7c8c 100644
--- a/docs/command-line-tools.rst
+++ b/docs/command-line-tools.rst
@@ -40,3 +40,8 @@ Command-line Tools
 ~~~~~~~~~~~~~~~~~~~~~~~~
 
 .. include:: proxmox-backup-debug/description.rst
+
+``proxmox-backup-test-suite``
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. include:: proxmox-backup-test-suite/description.rst
diff --git a/docs/command-syntax.rst b/docs/command-syntax.rst
index 9657557d1..bfaf635a1 100644
--- a/docs/command-syntax.rst
+++ b/docs/command-syntax.rst
@@ -65,3 +65,7 @@ The following commands are available in an interactive restore shell:
 ``proxmox-backup-debug``
 ------------------------
 .. include:: proxmox-backup-debug/synopsis.rst
+
+``proxmox-backup-test-suite``
+------------------------
+.. include:: proxmox-backup-test-suite/synopsis.rst
diff --git a/docs/conf.py b/docs/conf.py
index fba726295..876e53479 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -98,6 +98,7 @@ man_pages = [
     ('proxmox-backup-proxy/man1', 'proxmox-backup-proxy', 'Proxmox Backup Public API Server', [author], 1),
     ('proxmox-backup/man1', 'proxmox-backup', 'Proxmox Backup Local API Server', [author], 1),
     ('proxmox-file-restore/man1', 'proxmox-file-restore', 'CLI tool for restoring files and directories from Proxmox Backup Server archives', [author], 1),
+    ('proxmox-backup-test-suite/man1', 'proxmox-backup-test-suite', 'CLI tool for performing performance benchmarks', [author], 1),
     ('proxmox-tape/man1', 'proxmox-tape', 'Proxmox Tape Backup CLI Tool', [author], 1),
     ('pxar/man1', 'pxar', 'Proxmox File Archive CLI Tool', [author], 1),
     ('pmt/man1', 'pmt', 'Control Linux Tape Devices', [author], 1),
diff --git a/docs/proxmox-backup-test-suite/description.rst b/docs/proxmox-backup-test-suite/description.rst
new file mode 100644
index 000000000..b99c29adf
--- /dev/null
+++ b/docs/proxmox-backup-test-suite/description.rst
@@ -0,0 +1,2 @@
+Command-line tool for running performance benchmarks.
+
diff --git a/docs/proxmox-backup-test-suite/man1.rst b/docs/proxmox-backup-test-suite/man1.rst
new file mode 100644
index 000000000..2e57423c0
--- /dev/null
+++ b/docs/proxmox-backup-test-suite/man1.rst
@@ -0,0 +1,17 @@
+:orphan:
+
+====================
+proxmox-backup-test-suite
+====================
+
+Synopsis
+========
+
+.. include:: synopsis.rst
+
+Description
+============
+
+.. include:: description.rst
+
+.. include:: ../pbs-copyright.rst
diff --git a/zsh-completions/_proxmox-backup-test-suite b/zsh-completions/_proxmox-backup-test-suite
new file mode 100644
index 000000000..72ebcea5f
--- /dev/null
+++ b/zsh-completions/_proxmox-backup-test-suite
@@ -0,0 +1,13 @@
+#compdef _proxmox-backup-test-suite() proxmox-backup-test-suite
+
+function _proxmox-backup-test-suite() {
+    local cwords line point cmd curr prev
+    cwords=${#words[@]}
+    line=$words
+    point=${#line}
+    cmd=${words[1]}
+    curr=${words[cwords]}
+    prev=${words[cwords-1]}
+    compadd -- $(COMP_CWORD="$cwords" COMP_LINE="$line" COMP_POINT="$point" \
+        proxmox-backup-test-suite bashcomplete "$cmd" "$curr" "$prev")
+}
-- 
2.39.2





More information about the pbs-devel mailing list