public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Michael Köppl" <m.koeppl@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH test-instance 1/1] instance: skip the GRUB menu when booting installed instances
Date: Tue,  3 Nov 2026 16:18:41 +0100	[thread overview]
Message-ID: <20261103151841.1779365-1-m.koeppl@proxmox.com> (raw)

Rollbacks between test cases restore offline snapshots, so the
instances boot again before every test case. Each of these boots
waits in the GRUB menu for Debian's default timeout of five seconds,
which means multiple minutes of waiting for a regular test run. In a
tested example run of 47 test cases, this timeout resulted in roughly
4 minutes across all instances used.

Set the timeout to zero in the firstboot script, skipping over the
waiting time and saving a lot time during test runs.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 .../src/instance_manager/helpers.rs           | 21 ++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/proxmox-test-instance/src/instance_manager/helpers.rs b/proxmox-test-instance/src/instance_manager/helpers.rs
index f461286f..0e52d899 100644
--- a/proxmox-test-instance/src/instance_manager/helpers.rs
+++ b/proxmox-test-instance/src/instance_manager/helpers.rs
@@ -28,10 +28,25 @@ pub fn get_remote_run_script(cmd: &str) -> String {
     )
 }
 
-/// Constructs the shell script used after the first boot. At the moment contains networking
-/// configuration for additional NICs.
+/// Skips the boot menu. Each rollback between test cases restores a powered-off instance that has
+/// to boot again for the next test case, so the timeout adds up over a run.
+const SKIP_BOOT_MENU: &str = "echo 'GRUB_TIMEOUT=0' > /etc/default/grub.d/proxmox-test-tools.cfg
+update-grub";
+
+/// Constructs the shell script used after the first boot of an installed instance. It skips the
+/// boot menu and configures additional NICs.
 pub fn construct_first_boot_script(instance: &SetupInstance) -> Option<String> {
-    get_network_setup(instance).map(|nss| get_remote_run_script(&nss))
+    if !matches!(instance.kind, InstanceKind::Vm(_)) {
+        return None;
+    }
+
+    let mut script = SKIP_BOOT_MENU.to_string();
+    if let Some(network_setup) = get_network_setup(instance) {
+        script.push('\n');
+        script.push_str(&network_setup);
+    }
+
+    Some(get_remote_run_script(&script))
 }
 
 fn get_network_setup(instance: &SetupInstance) -> Option<String> {
-- 
2.47.3





                 reply	other threads:[~2026-11-03 15:18 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=20261103151841.1779365-1-m.koeppl@proxmox.com \
    --to=m.koeppl@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal