public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH test-instance 1/1] instance: skip the GRUB menu when booting installed instances
@ 2026-11-03 15:18 Michael Köppl
  0 siblings, 0 replies; only message in thread
From: Michael Köppl @ 2026-11-03 15:18 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-03 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03 15:18 [PATCH test-instance 1/1] instance: skip the GRUB menu when booting installed instances Michael Köppl

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