Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
4cd9a54
feat(n-vm): absorb in-VM test infrastructure from the testn repository
daniel-noland Jul 30, 2026
fcd69b1
refactor(n-vm): make #[n_vm::test] the test attribute and route body …
daniel-noland Jul 30, 2026
e878bbf
feat(n-vm): share the cargo workspace with the guest so bolero can run
daniel-noland Jul 30, 2026
2e0cc72
feat(n-vm): narrow the guest's write access to an opt-in corpus direc…
daniel-noland Jul 30, 2026
0bd40e0
refactor(n-vm): resolve the guest kernel through a manifest
daniel-noland Aug 7, 2026
660f4dd
feat(n-vm): record each kernel's own config beside its image
daniel-noland Aug 7, 2026
f375c09
feat(n-vm): make VmConfig a const with compile-time validation
daniel-noland Aug 8, 2026
75398fc
refactor(n-vm): configure tests with a const instead of attributes
daniel-noland Aug 8, 2026
f03d2de
feat(n-vm): let tests declare the kernel features they depend on
daniel-noland Aug 8, 2026
9c9371c
fix(n-vm): enable the dependency chain the mlx5 fragment needs
daniel-noland Aug 8, 2026
b7673cc
feat(n-vm): make the hypervisor a property of the kernel profile
daniel-noland Aug 8, 2026
3c6d258
feat(n-vm): select the kernel profile for a run, and skip mismatches
daniel-noland Aug 8, 2026
68bc60c
feat(n-vm): build a deliberately modular guest kernel
daniel-noland Aug 8, 2026
afc0547
feat(n-vm): build the initramfs for a modular guest kernel
daniel-noland Aug 8, 2026
5a1fe14
feat(n-preinit): add the static pre-init for initramfs boot
daniel-noland Aug 8, 2026
e3cf199
feat(n-vm): wire the modular kernel profile and its initramfs
daniel-noland Aug 8, 2026
4a705ff
feat(n-vm): boot a modular kernel through the initramfs
daniel-noland Aug 8, 2026
c8612f1
feat(n-vm): make vsock a module in the modular profile too
daniel-noland Aug 8, 2026
a1b9234
feat(n-vm): ship the modular profile's modules xz-compressed
daniel-noland Aug 8, 2026
93fe51d
feat(n-vm): run tests on the pinned Flatcar kernel
daniel-noland Aug 8, 2026
9da21ab
feat(n-vm): make a skipped test visible instead of counting as a pass
daniel-noland Aug 8, 2026
206a305
fix(n-vm): let an unpinned test run on the selected profile's hypervisor
daniel-noland Aug 8, 2026
7cba5b2
fix(n-vm): make QEMU honour the requested host page size
daniel-noland Aug 8, 2026
432c08a
fix(n-vm): omit the Flatcar profile on a non-x86_64 guest
daniel-noland Aug 8, 2026
4b69c6e
fix(n-vm): link the pre-init statically for a cross target too
daniel-noland Aug 8, 2026
ee5310e
fix(n-vm): resolve the qemu-user interpreter to its store path
daniel-noland Aug 8, 2026
759c44c
feat(n-vm): report guest userspace faults on the console
daniel-noland Aug 8, 2026
033a720
fix(n-vm): serve the guest's read-only share with cache=always
daniel-noland Aug 8, 2026
e4beac3
fix(n-vm): do not default an emulated guest to a hypervisor that cann…
daniel-noland Aug 8, 2026
666c943
fix(n-vm): derive the corpus directory from a remapped file!()
daniel-noland Aug 8, 2026
792a9aa
test(n-vm): run the suite against a pinned Ubuntu kernel
daniel-noland Aug 8, 2026
82b86b5
docs(n-vm): record that cache=always is the only policy that works
daniel-noland Aug 8, 2026
bb47c10
test(n-vm): assert the guest's view of the read-only share survives a…
daniel-noland Aug 8, 2026
8b384e9
feat(n-vm): carry the host tier's environment into the guest
daniel-noland Aug 13, 2026
448ecf9
fix(n-vm): clean up the container when the host tier is signalled
daniel-noland Aug 14, 2026
285cda8
feat(n-vm): add n-vm-reap for containers a SIGKILL left behind
daniel-noland Aug 14, 2026
e0430a2
fix(n-vm): print emergency cleanup notices where they can be seen
daniel-noland Aug 14, 2026
1870194
build(n-vm): add a just recipe for n-vm-reap, behind a feature
daniel-noland Aug 14, 2026
34e9924
fix(n-vm-macros): route body attributes onto a synchronous wrapper
daniel-noland Aug 18, 2026
a031814
test(n-vm): run every guest-booting test in the serialised group
daniel-noland Aug 23, 2026
3351d46
fix(n-vm): stop reporting a clean guest run as a hypervisor failure
daniel-noland Aug 23, 2026
8be1ee1
fix(n-vm): stop the default asking for memory nothing needs or can get
daniel-noland Aug 23, 2026
84eec9a
feat(n-vm): let a guest fuzz target answer bolero's discovery
daniel-noland Aug 23, 2026
ab90934
fix(n-vm): rewrite host paths in the environment carried into the guest
daniel-noland Aug 23, 2026
e9d78cc
fix(n-vm): tag each captured line with the channel it came from
daniel-noland Aug 23, 2026
6839536
fix(n-vm): stop the guest fuzzer trying to supervise copies of itself
daniel-noland Aug 24, 2026
a4f9df5
feat(n-vm): let a test describe its VM in its own body
daniel-noland Aug 24, 2026
32e13e7
refactor(n-vm): require the placeholder type on an inline config
daniel-noland Aug 24, 2026
a2e1020
refactor(n-vm): make the backend and the guest runtime part of the ma…
daniel-noland Aug 24, 2026
566d0f3
fix(n-vm): let a VM outlive the work it was given
daniel-noland Aug 24, 2026
217ebed
feat(n-vm): stop reserving guest memory a fuzzer cannot use
daniel-noland Aug 24, 2026
e28af31
feat(n-vm): give a fuzz target somewhere to put what it finds
daniel-noland Aug 24, 2026
d105979
fix(n-vm): find the scratch roots from wherever cargo started the test
daniel-noland Aug 24, 2026
7b09147
feat(n-vm): make the VM's memory and vCPU count configurable
daniel-noland Aug 24, 2026
5a5182b
feat(n-vm): make the number of fabric interfaces configurable
daniel-noland Aug 24, 2026
eef6b25
feat(n-vm): let a test name the kernel it needs
daniel-noland Aug 24, 2026
ddf6999
feat(n-vm): bound a guest fuzz engine by the memory it can reach
daniel-noland Aug 24, 2026
f50db44
feat(n-vm): let one VM present several NIC models at once
daniel-noland Aug 24, 2026
6e22b72
test(n-vm): assert each lever from inside the booted guest
daniel-noland Aug 24, 2026
2a445d1
build(n-vm): Ask for the bolero feature target discovery calls
daniel-noland Aug 26, 2026
7f67c66
style(n-vm): Format two files the dev shell's rustfmt disagrees with
daniel-noland Sep 3, 2026
2a95494
style(nix): Format default.nix with the dev shell's nixfmt
daniel-noland Sep 3, 2026
66284a1
chore(lint): Exempt the in-VM harness from the concurrency facade rule
daniel-noland Sep 3, 2026
25bd25e
chore(deps): Ignore the safemem advisory the harness drags in
daniel-noland Sep 3, 2026
5cbd89e
build(nix): Drop the vendor hash for the git dependency n-vm replaced
daniel-noland Sep 3, 2026
0d13000
build(n-vm): Give every test-running recipe the scratch roots
daniel-noland Sep 3, 2026
52a3cdf
build(n-vm): Populate the registry cache trybuild resolves against
daniel-noland Sep 3, 2026
67dc02a
fix(n-vm): Resolve bind sources for the daemon, not for this process
daniel-noland Sep 3, 2026
2595609
fix(n-vm): Follow a symlinked testroot entry to what it points at
daniel-noland Sep 3, 2026
58fb697
ci(dev): Reserve the 1 GiB hugepages the VM tests need
daniel-noland Sep 3, 2026
fad34fd
ci(dev): Compact memory before giving up on the 1 GiB pool
daniel-noland Sep 3, 2026
3527f72
test(n-vm): Cover the host hugepage path at a page size CI can supply
daniel-noland Sep 3, 2026
3bacee2
fix(n-vm): Document the imported crates' links, and time a coverage g…
daniel-noland Sep 3, 2026
89b4b54
fix(n-vm): Carry the overhead scale to the tier that uses it
daniel-noland Sep 3, 2026
6328cb1
ci(dev): Say why a hugepage reservation came up short
daniel-noland Sep 3, 2026
8164c18
fix(n-vm): Scale the post-shutdown drain with the VM allowance
daniel-noland Sep 3, 2026
0de4d6f
test(n-vm): Gate the host-hugepage tests instead of reserving pages i…
daniel-noland Sep 3, 2026
8146ddd
ci(dev): Probe whether a user namespace can replace the container tier
daniel-noland Sep 3, 2026
77890ed
revert(ci): Drop the user namespace probe now that it has answered
daniel-noland Sep 3, 2026
7bb420a
ci(dev): Probe what refuses the uid_map write, for a specific ask
daniel-noland Sep 3, 2026
c6b414d
revert(ci): Drop the uid_map probe now that it has answered
daniel-noland Sep 3, 2026
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
23 changes: 22 additions & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,29 @@ store-failure-output = true
# filter = 'test(flaky test name here)'
# retries = 3

# Every package that boots a guest, not just the one that owns the harness.
#
# A VM claims a 1GiB hugepage for its guest memory and the host pool is small -- two pages on the
# machine this was found on. Nothing arbitrates that pool, so tests that boot concurrently race for
# it and the losers fail with "the 1073741824-byte hugepage pool has 0 free page(s)". That is a
# resource conflict wearing the costume of a flaky test, and it made ten of `dataplane-n-vm`'s
# eighteen integration tests fail in a whole-workspace run while all eighteen passed with
# `--test-threads 1`.
#
# The list is `#[n_vm::test]`'s users. It has to be maintained by hand, which is the weakness of
# fixing this here: a package that starts booting guests and is not added to it fails in a way that
# looks like its own bug. The durable fix is for `n-vm` to acquire the pool itself and wait rather
# than fail -- a test harness that only works when the consuming repo's runner config is right is
# not one that can be handed to another repo.
[[profile.default.overrides]]
filter = 'package(dataplane)'
filter = '''
package(dataplane)
+ package(dataplane-n-vm)
+ package(dataplane-n-it)
+ package(dataplane-hardware)
+ package(dataplane-interface-manager)
+ package(dataplane-mgmt)
'''
platform = 'cfg(unix)'
test-group = 'vm'

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,22 @@ jobs:
USER: "runner"
# The `just` action runs under `set -u`, so this stays defined.
JUST_VARS: ""
# These runners are containers on bare metal talking to the host's
# Docker daemon, so the daemon cannot see this container's /nix. Measured
# on a runner: /nix/store holds 7386 entries here and 0 as the daemon
# sees it, while `_work` is the same block device at the same path in
# both namespaces. So the closure the container mounts is exported to a
# directory under `_work`, where the two agree. `setup-roots` fills it;
# `n-vm` reads the same variable and rewrites its bind mount sources,
# leaving the targets alone. See `n_vm_host_share` in the justfile.
#
# Beside the checkout rather than inside it. Two reasons: the workspace
# is served to the guest over virtiofs, and -- the one that actually
# bites -- `default.nix` filters `./.` as its source, and the markdown
# and C-header filters would sweep a few GiB of copied store into every
# build. `runner.temp` would be the natural home but the `runner`
# context is not available to a job-level `env`.
N_VM_HOST_SHARE_DIR: "${{ github.workspace }}/../n-vm-share"
strategy:
fail-fast: false
# Each entry gets its own runner; this limits shared-pool occupancy.
Expand Down Expand Up @@ -541,6 +557,14 @@ jobs:

- name: "coverage-archive"
uses: *just
env:
# Headroom on the VM kill deadline for an instrumented guest, which
# is slower than a plain one and writes its coverage profile on the
# way out. Cheap insurance rather than a measured requirement: this
# is when a hung guest is shot, not a delay anything waits out, and
# overrunning it surfaces as "no parseable test verdict from guest"
# -- a passing test reported as a broken harness.
N_VM_OVERHEAD_SCALE: "3"
with:
recipe: "ci::coverage"
recipe_args: "${{ matrix.profile }}"
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ result*/**
/bin
sysroot
devroot
testroot
vmroot

# n-vm host share (see `n_vm_host_share` in the justfile)
.n-vm-share
11 changes: 11 additions & 0 deletions .semgrep/rules/no-std-sync-direct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ rules:
- concurrency/src/quiescent.rs
- concurrency/src/slot.rs
- concurrency/tests/
# The in-VM test harness is workspace-independent by design: it
# depends on no dataplane crate, so that it can go back to
# `githedgehog/testn` without a decoupling project first. Taking the
# `concurrency` facade would be exactly that coupling, and would buy
# nothing -- none of this code is under loom or shuttle, and it is
# host-side test infrastructure rather than dataplane.
- n-vm/
- n-vm-macros/
- n-vm-protocol/
- n-it/
- n-preinit/
pattern-either:
- pattern: use std::sync::Arc;
- pattern: use std::sync::Weak;
Expand Down
Loading
Loading