all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer] low level: testmode: take path to disk image instead of using /dev/null
Date: Tue,  3 Oct 2023 12:21:46 +0200	[thread overview]
Message-ID: <20231003102147.685374-1-c.heiss@proxmox.com> (raw)

.. in exactly the same way `proxinstall` does, streamlining them both.

Up until now, testing the TUI installer often involved hand-editing the
`run-env-info.json` to put some proper disk sizes > 0 in place. This
makes this process just a lot easier.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
 Makefile                    | 15 ++++++++++-----
 proxmox-low-level-installer |  8 ++++----
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index dc180b2..2875d2a 100644
--- a/Makefile
+++ b/Makefile
@@ -135,26 +135,31 @@ cd-info.test:
 
 check-pve: prepare-check-env test.img
 	rm -f cd-info.test; $(MAKE) cd-info.test
-	./proxmox-low-level-installer dump-env -t
+	./proxmox-low-level-installer dump-env -t test.img
 	G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
 
 check-pve-multidisks: prepare-check-env test.img test2.img test3.img test4.img test5.big.img
 	rm -f cd-info.test; $(MAKE) cd-info.test
-	./proxmox-low-level-installer dump-env -t
+	./proxmox-low-level-installer dump-env -t test.img,test2.img,test3.img,test4.img,test5.big.img
 	G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img,test2.img,test3.img,test4.img,test5.big.img
 
 check-pve-tui: prepare-check-env test.img
 	rm -f cd-info.test; $(MAKE) cd-info.test
-	./proxmox-low-level-installer dump-env -t
+	./proxmox-low-level-installer dump-env -t test.img
 	testdir/usr/bin/proxmox-tui-installer -t test.img
 
+check-pve-tui-multidisks: prepare-check-env test.img test2.img test3.img test4.img test5.big.img
+	rm -f cd-info.test; $(MAKE) cd-info.test
+	./proxmox-low-level-installer dump-env -t test.img,test2.img,test3.img,test4.img,test5.big.img
+	testdir/usr/bin/proxmox-tui-installer -t test.img,test2.img,test3.img,test4.img,test5.big.img
+
 prepare-check-pmg: prepare-check-env test.img
 	rm -f cd-info.test; $(MAKE) \
 	    PRODUCT=pmg \
 	    PRODUCTLONG="Proxmox Mail Gateway" \
 	    ISONAME='proxmox-mail-gateway' \
 	    cd-info.test
-	./proxmox-low-level-installer dump-env -t
+	./proxmox-low-level-installer dump-env -t test.img
 
 check-pmg: prepare-check-pmg
 	G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
@@ -168,7 +173,7 @@ prepare-check-pbs: prepare-check-env test.img
 	    PRODUCTLONG='Proxmox Backup Server' \
 	    ISONAME='proxmox-backup-server' \
 	    cd-info.test
-	./proxmox-low-level-installer dump-env -t
+	./proxmox-low-level-installer dump-env -t test.img
 
 check-pbs: prepare-check-pbs
 	G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
diff --git a/proxmox-low-level-installer b/proxmox-low-level-installer
index 814961e..0f2bf4f 100755
--- a/proxmox-low-level-installer
+++ b/proxmox-low-level-installer
@@ -11,14 +11,14 @@ use JSON;
 use Time::HiRes qw(usleep);
 
 {
-    my $test_mode;
+    my $test_image;
     GetOptions(
-	'test-mode|t' => \$test_mode
+	'test-image|t=s' => \$test_image
     ) or die "usage error\n";
 
-    # FIXME: use cleaner approach for setting tet mode?
-    Proxmox::Install::ISOEnv::set_test_image('/dev/null') if $test_mode;
+    Proxmox::Install::ISOEnv::set_test_image($test_image) if $test_image;
 }
+
 use Proxmox::Install::ISOEnv;
 use Proxmox::Install::RunEnv;
 
-- 
2.41.0





                 reply	other threads:[~2023-10-03 10:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20231003102147.685374-1-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pve-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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal