nvx-rs: replace the golden launch-profile and sandbox-option fixtures with specification tests
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reading the listed sandbox tests and src/host/sandbox/{golden.rs,mod.rs,layer.rs,mount.rs,options.rs}, plus the OpenVMM and guest contracts; this is step 4 of #722 and depends on #726. Replace fixture checks with the named specification tests and map each fixture section to a test. Done means both fixtures are removed, the new tests pass on Linux and Windows, every section is covered, and accepted launches retain their OpenVMM arguments and kernel tokens.
Written by the indexing model from the issue text.
Description
Part of #722. Step 4. Its gate needs #726. Related: #723.
Goal
Replace tests/fixtures/sandbox.json, tests/fixtures/sandbox_options.json, and src/host/sandbox/golden.rs with table-driven and property tests derived from the documented options and from the contracts with OpenVMM and the guest. Then make the checks Rust-native.
Background
sandbox.jsonholds 1,412 cases in POSIX and Windows path flavors: 213 identities, 320 layers, 212 mount values, 228 mount targets, 53 child names, 210 mounts, and 176 launches. Since #556 removed the runtime and custom block roles, 130 of the launches end in the same error.sandbox_options.jsonholds 885 cases: 128 share targets ofrun, 250 sandbox mounts, 80 exec environments, 109 environment files, and 318 distro manifests.- Six tests check them:
identities_and_layers_parse_as_python_parses_them,mount_values_targets_and_child_names_match_python,mounts_lower_to_the_arguments_that_python_gives,launches_give_the_arguments_and_command_lines_that_python_gives,sandbox_option_helpers_match_nvx_py, andenvironment_files_and_distro_manifests_read_as_python_reads_them. - Contracts that the new tests keep: OpenVMM's arguments, the guest's kernel tokens and their 1024-byte budget, the reserved targets and tokens, and the names of an aggregate's children,
INDEX-HEX, whereHEXis the first 16 bytes of the SHA-256 of the target, on which restores depend. - Python behavior that goes: Python's messages and
reprquoting,int()'s Unicode digits and underscores, the other spellings thatuuid.UUIDaccepts, the leniency ofjson.loads, and checking both path flavors on every host.
Tasks
Replacement tests, in a pull request that doesn't change behavior:
-
workload_identity_grammar:UID:GIDfrom 1 to 4294967295, root refused, and malformed values. -
layer_values_are_role_path_uuid: onlydistro; a canonical UUID reaches the guest token unchanged; a configuration of a retired role is refused. -
mount_value_grammar:TARGET,HOST, optionally followed by,roor,rw, commas in host paths, and empty parts. -
reserved_mount_targets_are_refused: a property over the reserved trees and exact targets. -
aggregate_child_names_follow_the_restore_contract: a property that computes the names withsha2, and known answers such as0-c52ddf65534b7b46035084358ab7902bfor/workspaceat index 0. -
launch_arguments_follow_the_openvmm_contract -
kernel_command_line_stays_within_1024_bytes: a property that a launch's command line either fits and holds every token or is refused, and that reserved tokens are always refused. -
policy_paths_attach_to_their_shares: a property over sequences of options, forsandbox, where they apply to the--mountbefore them, and forrun, where they apply to the share that holds them. -
exec_environment_limitsandenvironment_files_hold_a_json_array_of_strings. -
distro_manifest_binds_the_layerandsystemd_entrypoint_needs_systemd_in_the_manifest. -
host_paths_become_absolute: a property on each OS's own filesystem, and a table of Windows drive-relative and UNC paths. - A temporary table that maps every section of the two fixtures to tests.
Retirement, in the next pull request:
- Integers are ASCII decimal within documented ranges, UUIDs are canonical, environment files and distro manifests are strict JSON, and messages quote values as Rust does.
- Values that become kernel tokens refuse the separators of #723, if it hasn't landed yet.
- Each host checks its own path flavor only.
- Replace
nvx::host::sandbox::{Int, IntError}, which re-export Python's integers, and note the API change in the README. - Delete the two fixtures and
src/host/sandbox/golden.rs. - Docs: the README's module table and "Python parity", and
doc/usage.mdanddoc/run.mdwhere accepted input changes.
Gate
- The lines and branches that only these fixtures reach, on Windows and Linux (#726), are reached by the new tests or deleted.
-
cargo mutantsonsrc/host/sandbox/mod.rs,layer.rs,mount.rs, andoptions.rsmisses no mutant with the new tests that the fixtures catch. - Every section maps to a test.
- The OpenVMM arguments and kernel tokens of every launch that the fixtures accept are unchanged.
Acceptance criteria
- The two fixtures are gone, and the new tests pass on Linux and Windows.
- Dominant language
- Python
- Stars
- 408
- Forks
- 28
- Avg merge
- 16h 18m
- Merged PRs (30d)
- 332
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/nvx
-
Track guest managed agent bugs: output limit forwards later output after a dropped chunkPossibly taken @akhil9tiet claimed this 1 day ago. Openbug-hunt confirmed good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/nvx#737 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Track nvx-rs host VMM supervisor bugs: a non-UTF-8 process name at a reused PID blocks reconcile, reattach, and stopPossibly taken @56steve claimed this 1 day ago. Openbug-hunt confirmed good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/nvx#720 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
ci: track azure-mshv-1's intermittent H4 failures after a live migration to a host with an unstable clockPossibly taken @ppenna claimed this today. Openconfirmed
microsoft/nvx#768 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
Similar issues
-
style: article/section 📝 system: cloud.rc ☁️ system: security 🔐
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
uabrc/uabrc.github.io#1262 ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NCAR/miles-credit#526 ·
-
documentation
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
conda/conda-lock#957 ·
Maintainers usually reply within 1 day
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
aws-samples/sample-per-model-bedrock#464 ·
Maintainers usually reply within 1 day