Bound and configure the per-Domain runsc dcache
This commit is contained in:
parent
503f090121
commit
db9a561d0c
1 changed files with 157 additions and 11 deletions
|
|
@ -373,6 +373,7 @@ fn assert_runtime_command(bundle: &SandboxBundle, fixture: &Fixture) {
|
|||
format!("-root={runtime_domain}/runsc"),
|
||||
"-network=host".to_owned(),
|
||||
"-ignore-cgroups".to_owned(),
|
||||
"-dcache=50000".to_owned(),
|
||||
format!(
|
||||
"-overlay2=root:dir={runtime_domain}/runsc-overlay/{}",
|
||||
"11".repeat(32)
|
||||
|
|
@ -402,6 +403,39 @@ fn assert_runtime_command(bundle: &SandboxBundle, fixture: &Fixture) {
|
|||
}));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn configured_dcache_is_fingerprinted_and_passed_to_runsc() {
|
||||
let fixture = Fixture::new();
|
||||
let configuration_path = fixture.tree.path().join("configuration/lazaret.toml");
|
||||
let source = fs::read_to_string(&configuration_path).unwrap();
|
||||
fs::write(
|
||||
&configuration_path,
|
||||
source.replace("[network]", "[runtime]\nrunsc_dcache = 12345\n\n[network]"),
|
||||
)
|
||||
.unwrap();
|
||||
let configuration = fixture.reload_configuration();
|
||||
assert_eq!(configuration.runsc_dcache(), 12_345);
|
||||
assert_ne!(
|
||||
configuration.configuration_fingerprint(),
|
||||
fixture.configuration.configuration_fingerprint()
|
||||
);
|
||||
let bundle = build_sandbox_bundle(SandboxBuildRequest {
|
||||
configuration: &configuration,
|
||||
container_id: ContainerId::new([0x11; 32]),
|
||||
expected_network_namespace: current_network_namespace(),
|
||||
root_process: root_process([]),
|
||||
terminal: None,
|
||||
prepared_root: fixture.tree.path().join("prepared-root"),
|
||||
})
|
||||
.unwrap();
|
||||
assert!(
|
||||
bundle
|
||||
.command()
|
||||
.arguments()
|
||||
.contains(&"-dcache=12345".into())
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn product_init_role_has_exact_terminal_neutral_rootless_bundle_shape() {
|
||||
let fixture = Fixture::new();
|
||||
|
|
|
|||
Loading…
Reference in a new issue