Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ test-loom:
test-isolated target=default-target features="" :
{{ cargo-cmd }} test {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" { "dev" } else { target } }} {{ target-triple-flag }} -p hyperlight-host --lib -- sandbox::uninitialized::tests::test_log_trace --exact --ignored
{{ cargo-cmd }} test {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" { "dev" } else { target } }} {{ target-triple-flag }} -p hyperlight-host --lib -- sandbox::outb::tests::test_log_outb_log --exact --ignored
{{ cargo-cmd }} test {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" { "dev" } else { target } }} {{ target-triple-flag }} -p hyperlight-host --lib -- sandbox::initialized_multi_use::tests::from_snapshot::max_guest_log_level_is_honored_from_snapshot --exact --ignored
{{ cargo-cmd }} test {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" { "dev" } else { target } }} {{ target-triple-flag }} -p hyperlight-host --test integration_test -- log_message --exact --ignored
@# CPU vendor check, gated to known CI runner hardware
{{ cargo-cmd }} test {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" { "dev" } else { target } }} {{ target-triple-flag }} -p hyperlight-host --lib -- sandbox::snapshot::file::config::tests::cpu_vendor_current_is_recognized --exact --ignored
Expand Down Expand Up @@ -525,6 +526,7 @@ coverage-run hypervisor="kvm": ensure-cargo-llvm-cov
# isolated tests (require running separately due to global state)
cargo +nightly test -p hyperlight-host --lib -- sandbox::uninitialized::tests::test_log_trace --exact --ignored
cargo +nightly test -p hyperlight-host --lib -- sandbox::outb::tests::test_log_outb_log --exact --ignored
cargo +nightly test -p hyperlight-host --lib -- sandbox::initialized_multi_use::tests::from_snapshot::max_guest_log_level_is_honored_from_snapshot --exact --ignored
cargo +nightly test -p hyperlight-host --test integration_test -- log_message --exact --ignored
cargo +nightly test -p hyperlight-host --no-default-features -F function_call_metrics,{{ if hypervisor == "mshv3" { "mshv3" } else { "kvm" } }} --lib -- metrics::tests::test_metrics_are_emitted --exact

Expand Down
7 changes: 6 additions & 1 deletion src/hyperlight_host/benches/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,10 @@ fn bench_sandbox_from_snapshot(b: &mut criterion::Bencher, size: SandboxSize) {
// Drop is not included.
b.iter_batched(
|| (),
|_| MultiUseSandbox::from_snapshot(loaded.clone(), HostFunctions::default(), None).unwrap(),
|_| {
MultiUseSandbox::from_snapshot(loaded.clone(), HostFunctions::default(), None, None)
.unwrap()
},
criterion::BatchSize::PerIteration,
);
}
Expand Down Expand Up @@ -678,6 +681,7 @@ fn snapshot_file_benchmark(c: &mut Criterion) {
std::sync::Arc::new(loaded),
HostFunctions::default(),
None,
None,
)
.unwrap();
sbox.call::<String>("Echo", "hello\n".to_string()).unwrap();
Expand All @@ -703,6 +707,7 @@ fn snapshot_file_benchmark(c: &mut Criterion) {
std::sync::Arc::new(loaded),
HostFunctions::default(),
None,
None,
)
.unwrap();
sbox.call::<String>("Echo", "hello\n".to_string()).unwrap();
Expand Down
3 changes: 2 additions & 1 deletion src/hyperlight_host/examples/crashdump/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,8 @@ mod tests {
let mut cfg2 = SandboxConfiguration::default();
cfg2.set_guest_core_dump(true);
let mut sbox2 =
MultiUseSandbox::from_snapshot(snapshot, HostFunctions::default(), Some(cfg2)).unwrap();
MultiUseSandbox::from_snapshot(snapshot, HostFunctions::default(), Some(cfg2), None)
.unwrap();

let result = sbox2.call::<()>("TriggerException", ());
assert!(result.is_err(), "TriggerException should return an error");
Expand Down
8 changes: 6 additions & 2 deletions src/hyperlight_host/examples/guest-debugging/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,12 @@ mod tests {
let mut cfg = SandboxConfiguration::default();
cfg.set_guest_debug_info(DebugInfo { port: PORT });

let mut sbox =
MultiUseSandbox::from_snapshot(snap_thread, HostFunctions::default(), Some(cfg))?;
let mut sbox = MultiUseSandbox::from_snapshot(
snap_thread,
HostFunctions::default(),
Some(cfg),
None,
)?;
sbox.call::<i32>(
"PrintOutput",
"Hello from a from_snapshot sandbox\n".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion src/hyperlight_host/src/sandbox/host_funcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl Default for HostFunctions {
/// This matches the default registry installed by
/// `UninitializedSandbox::new()`, so a snapshot taken from a
/// regular sandbox can be loaded with
/// `MultiUseSandbox::from_snapshot(snap, HostFunctions::default(), None)`
/// `MultiUseSandbox::from_snapshot(snap, HostFunctions::default(), None, None)`
/// without registering anything else.
///
/// Use [`HostFunctions::empty`] for an empty registry.
Expand Down
Loading