Skip to content

Commit 91807f9

Browse files
committed
test(driver-mxc): add Tier-0 mapper coverage matrix with schema drift guard
Three-quadrant, table-driven matrix (38 tests): mappable fields assert exact MXC output; every OpenShell field MXC cannot express asserts a loss item with the expected severity (and seam rejection on error); an empty policy asserts the restrictive default-deny posture for every MXC knob OpenShell does not control. The handled_fields_inventory drift guard serializes a fully-populated policy and compares its YAML keys against the mapper-handled field lists, so a new openshell-policy field fails the suite until consciously mapped, delegated, or reported as loss. Re-exports the policy seam types for integration tests; adds serde_yml, base64, serde_json as dev-dependencies. Signed-off-by: Giedrius Burachas <[email protected]>
1 parent edde8d5 commit 91807f9

4 files changed

Lines changed: 1317 additions & 0 deletions

File tree

‎Cargo.lock‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎crates/openshell-driver-mxc/Cargo.toml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ tempfile = "3"
3535
openshell-policy = { path = "../openshell-policy" }
3636
clap = { workspace = true }
3737
anyhow = { workspace = true }
38+
# Needed by the real-wxc integration test (wxc_exec_real.rs) which builds
39+
# --config-base64 payloads without going through the async WxcExecInvoker.
40+
# base64 and serde_json are already [dependencies] but dev-dependency resolution
41+
# is independent; explicit entries make them visible to integration tests.
42+
base64 = { workspace = true }
43+
serde_json = { workspace = true }
44+
# Used by the drift guard test (handled_fields_inventory) to parse YAML into a
45+
# generic serde_json::Value for key enumeration.
46+
serde_yml = { workspace = true }
3847

3948
[lints]
4049
workspace = true

‎crates/openshell-driver-mxc/src/lib.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ pub use grpc::ComputeDriverService;
3535
// Re-export the embedded mapper API so the windows-only example and integration
3636
// test can reach it without making `policy_map` a public module.
3737
#[cfg(target_os = "windows")]
38+
pub use policy::{EmbeddedPolicyMapper, MapCtx, MapError, MappedConfig, PolicyMapper};
39+
#[cfg(target_os = "windows")]
3840
pub use policy_map::{
3941
DEFAULT_COMMAND, DEFAULT_CONTAINMENT, DEFAULT_MXC_VERSION, LossItem, MxcMappingOptions,
4042
MxcMappingResult, OPEN_SHELL_SUPERSET_GAPS, SplitPolicyResult, build_loss_report, map_to_mxc,

0 commit comments

Comments
 (0)