Skip to content

Commit 2d7e51f

Browse files
committed
test(fleet): ignored end-to-end VM round-trip against a live daemon
Provision, ssh-exec /usr/bin/true, observe exit 0, destroy — the manual verification harness for the VM backend. The guest command becomes an internal parameter of start() to make the cycle exercisable without a real runner invocation.
1 parent 83037bc commit 2d7e51f

1 file changed

Lines changed: 37 additions & 7 deletions

File tree

  • fleet/arcbox-fleet-agent/src

fleet/arcbox-fleet-agent/src/vm.rs

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,17 @@ impl VmRunner {
177177
if spec.encoded_jit_config.contains('\'') {
178178
bail!("encoded JIT config contains a quote — not a base64 payload");
179179
}
180+
let command = format!(
181+
"{GUEST_RUNNER_SCRIPT} --jitconfig '{}'",
182+
spec.encoded_jit_config
183+
);
184+
self.start_with_command(&spec, &command).await
185+
}
180186

187+
/// [`start`](Self::start) with the guest command explicit, so the
188+
/// daemon-backed integration test below can exercise the full
189+
/// provision→ssh→exec→destroy cycle without a real runner invocation.
190+
async fn start_with_command(&self, spec: &RunSpec<'_>, command: &str) -> Result<RunningVm> {
181191
let name = machine_name(spec.job_id);
182192
let mut client = self.client.clone();
183193

@@ -213,13 +223,7 @@ impl VmRunner {
213223
.await
214224
.context("opening SSH session channel")?;
215225
channel
216-
.exec(
217-
true,
218-
format!(
219-
"{GUEST_RUNNER_SCRIPT} --jitconfig '{}'",
220-
spec.encoded_jit_config
221-
),
222-
)
226+
.exec(true, command)
223227
.await
224228
.context("starting the runner over SSH")?;
225229
info!(job_id = spec.job_id, guest = %name, ip, "runner started (vm)");
@@ -475,6 +479,32 @@ mod tests {
475479
assert_eq!(stream_name("tahoe-base@2026.07.02"), "tahoe-base");
476480
}
477481

482+
/// Full provision→ssh→exec→destroy cycle against a live daemon.
483+
/// Requires `arcbox-daemon` running with the default image pulled
484+
/// (`arcbox macos image pull tahoe-base`); run manually:
485+
/// `cargo test -p arcbox-fleet-agent vm_round_trip -- --ignored`.
486+
#[tokio::test]
487+
#[ignore = "needs a live arcbox-daemon with the tahoe-base image installed"]
488+
async fn vm_round_trip_boots_and_execs_over_ssh() {
489+
let socket = arcbox_constants::paths::HostLayout::from_env_or_default().grpc_socket;
490+
let runner = VmRunner::new(&socket, "tahoe-base")
491+
.await
492+
.expect("daemon probe");
493+
let mut running = runner
494+
.start_with_command(
495+
&RunSpec {
496+
job_id: "itest",
497+
encoded_jit_config: "",
498+
runner_image: "tahoe-base",
499+
},
500+
"/usr/bin/true",
501+
)
502+
.await
503+
.expect("provision guest and exec");
504+
assert_eq!(running.wait().await, Some(0));
505+
running.destroy().await;
506+
}
507+
478508
#[test]
479509
fn guest_size_floors_to_image_minimums() {
480510
let image = MacosImageSummary {

0 commit comments

Comments
 (0)