[pve-devel] [PATCH installer v2 2/2] add ability to test multiple disks

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Dec 13 11:13:33 CET 2018


to allow easier testing of ZFS modes requiring more than one disk.
Also add a target which defaults to 4 disks.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

v1 -> v2:
* remove all test*.img files in clean target
* split returns the whole $value if it did not contained any separator patter,
  so no need for special handling this.
* removed some left over changes, e.g., unnecessarily touching the check-pve
  target

 Makefile    | 11 ++++++++---
 proxinstall |  6 +++++-
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 09cf0a8..c72df6c 100644
--- a/Makefile
+++ b/Makefile
@@ -64,14 +64,19 @@ upload-pmg: ${PMG_DEB}
 upload-pve: ${PVE_DEB}
 	tar cf - ${PVE_DEB} | ssh -X repoman at repo.proxmox.com -- upload --product pve --dist stretch
 
-test.img:
-	truncate -s 2G test.img
+%.img:
+	truncate -s 2G $@
 
 check-pve: ${PVE_DEB} test.img
 	rm -rf testdir
 	dpkg -X ${PVE_DEB} testdir
 	G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
 
+check-pve-multidisks: ${PVE_DEB} test.img test2.img test3.img test4.img
+	rm -rf testdir
+	dpkg -X ${PVE_DEB} testdir
+	G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img,test2.img,test3.img,test4.img
+
 check-pmg: ${PMG_DEB} test.img
 	rm -rf testdir
 	dpkg -X ${PMG_DEB} testdir
@@ -80,5 +85,5 @@ check-pmg: ${PMG_DEB} test.img
 .phony: clean
 clean:
 	make -C html-common clean
-	rm -rf *~ *.deb target build packages packages.tmp testdir test.img pve-final.pkglist *.buildinfo *.changes country.dat final.pkglist
+	rm -rf *~ *.deb target build packages packages.tmp testdir test*.img pve-final.pkglist *.buildinfo *.changes country.dat final.pkglist
 	find . -name '*~' -exec rm {} ';'
diff --git a/proxinstall b/proxinstall
index 5ef12cb..1a1d2f6 100755
--- a/proxinstall
+++ b/proxinstall
@@ -559,7 +559,11 @@ sub hd_list {
     my $res = ();
 
     if ($opt_testmode) {
-	push @$res, [-1, $opt_testmode, int((-s $opt_testmode)/512), "TESTDISK"];
+	my @disks = split /,/, $opt_testmode;
+
+	for my $disk (@disks) {
+	    push @$res, [-1, $disk, int((-s $disk)/512), "TESTDISK"];
+	}
 	return $res;
     }
 
-- 
2.19.2





More information about the pve-devel mailing list