From 2917d8fd17ebd14534bbf6e7255ad3d81d1328e7 Mon Sep 17 00:00:00 2001 From: ejc3 Date: Tue, 27 Oct 2026 01:26:31 +0000 Subject: [PATCH] test_reclaim: a drive-override restore makes no mountpoint at the source directory Since #1318 the pinned Firecracker overrides every source path at snapshot load, so a restore no longer recreates the source VM's directory as a mountpoint. a_sigkilled_restore_leaves_its_mountpoint_and_runtime_dir_to_the_next_launch still required that directory while the restore was parked, and failed in every Host-Root and Container lane on main since 09914374 ("the parked restore has not made and "). The test, renamed a_sigkilled_restore_leaves_its_runtime_dir_to_the_next_launch, now requires the parked restore to have made its own runtime directory and NOT the source directory, and the next launch to remove the runtime directory. Reclaiming a mountpoint an older binary made stays covered by the unit tests in src/reclaim.rs. Tested: make test-root FILTER="-E 'binary(test_reclaim) & test(/a_sigkilled_restore/)'" (1 passed); the previous form fails on main CI run 40411315700. --- tests/test_reclaim.rs | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/tests/test_reclaim.rs b/tests/test_reclaim.rs index 97a8c9356..1f9c8d067 100644 --- a/tests/test_reclaim.rs +++ b/tests/test_reclaim.rs @@ -179,14 +179,13 @@ fn parked(dir: &Path) -> Option { None } -/// #1181: a restore of a snapshot whose source VM is gone recreates the source's -/// directory as a mountpoint, and the last lease on it removes it (#1304). After a -/// SIGKILL of a restore that made it, with the clone's own runtime directory (#1183), the -/// next launch removes both. +/// #1183: after a SIGKILL of a restore that made its own runtime directory, the next +/// launch removes it. The Firecracker fcvm builds overrides every source path at load +/// (#1318), so the restore makes no mountpoint at the source VM's directory (#1181); the +/// reclaim of one an older binary made is covered by the unit tests in `src/reclaim.rs`. #[cfg(feature = "integration-slow")] #[tokio::test] -async fn a_sigkilled_restore_leaves_its_mountpoint_and_runtime_dir_to_the_next_launch() -> Result<()> -{ +async fn a_sigkilled_restore_leaves_its_runtime_dir_to_the_next_launch() -> Result<()> { let (source_name, _, snapshot, _) = common::unique_names("reclaim-mount"); let (mut source, source_pid) = common::spawn_fcvm(&[ @@ -217,8 +216,8 @@ async fn a_sigkilled_restore_leaves_its_mountpoint_and_runtime_dir_to_the_next_l ); let result = async { - // A restore killed after it made the mountpoint and its own directory, before - // its VMM loaded the snapshot. + // A restore killed after it made its own directory, before its VMM loaded the + // snapshot. let park = tempfile::tempdir()?; let spec = format!("restore.pre_load:park:{}", park.path().display()); let (killed_name, _, _, _) = common::unique_names("reclaim-mount-killed"); @@ -243,11 +242,16 @@ async fn a_sigkilled_restore_leaves_its_mountpoint_and_runtime_dir_to_the_next_l .await?; let killed_dir = vm_disks(&vm_id_of(killed_pid).await?); anyhow::ensure!( - source_dir.is_dir() && killed_dir.join("disks").is_dir(), - "the parked restore has not made {} and {}", - source_dir.display(), + killed_dir.join("disks").is_dir(), + "the parked restore has not made {}", killed_dir.display() ); + anyhow::ensure!( + !source_dir.exists(), + "the parked restore recreated the source VM's directory {}, which a load \ + that overrides every source path does not need", + source_dir.display() + ); Ok(killed_dir) } .await; @@ -255,11 +259,6 @@ async fn a_sigkilled_restore_leaves_its_mountpoint_and_runtime_dir_to_the_next_l let killed_dir = observed?; next_launch().await?; - anyhow::ensure!( - !source_dir.exists(), - "the killed restore's mountpoint survived the next launch: {}", - source_dir.display() - ); anyhow::ensure!( !killed_dir.exists(), "the killed restore's runtime directory survived the next launch: {}",