1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! The VM self-test's Hyper-V elevation hook: an injection point, not an implementation.
//!
//! Hyper-V takes management commands from an administrator only (or a member of "Hyper-V
//! Administrators"), and Vagrant's Hyper-V provider refuses to run otherwise. The launcher boots
//! the test VM and probes it as one elevated batch (one UAC prompt for both `vagrant up` and
//! `vagrant ssh`) through its own `unsafe` Win32 job-object code. That `unsafe` is exactly what
//! this crate forbids, so isothrum-machine never elevates itself: the VM self-test takes an
//! optional [`ElevatedBoot`] a caller supplies. `None` (the desktop app, and the default) runs the
//! two commands as plain [`ProcessRunner`](isothrum_runner::ProcessRunner) calls — today's path,
//! one prompt each on Hyper-V. `Some` routes the whole boot-and-probe through the caller's hook, so
//! both commands share one prompt, matching the launcher.
use Path;
use BoxFuture;
use crateResult;
/// A caller-supplied way to boot the test VM and probe it as one elevated batch.
///
/// The launcher implements this over its elevated Vagrant batch (its `platform::exec::elevate`
/// script: `up` as step 0, `ssh` as step 1, both under one UAC prompt), mapping that batch's two
/// outcomes onto [`BootProbe`]. The desktop app never passes an implementation, so its VM
/// self-test stays on the unelevated two-call path.
/// The outcome of an elevated [`ElevatedBoot::boot_and_probe`] batch: whether the VM booted, and
/// the probe command's output when it ran.