Remove phase vocabulary from Lazaret interfaces
This commit is contained in:
parent
3f9b1b3543
commit
e7dd95aea6
3 changed files with 547 additions and 579 deletions
|
|
@ -128,12 +128,12 @@ impl fmt::Debug for SandboxLayoutV1 {
|
|||
}
|
||||
|
||||
impl SandboxLayoutV1 {
|
||||
/// Builds the closed destination set supplied by production sandbox-layout construction.
|
||||
/// Builds the closed destination set supplied by default sandbox-layout construction.
|
||||
///
|
||||
/// # Errors
|
||||
/// Every destination must be a normalized absolute non-root sandbox path and the set must
|
||||
/// include `/workspace`.
|
||||
pub fn from_production_layout(
|
||||
pub fn from_protected_destinations(
|
||||
destinations: impl IntoIterator<Item = String>,
|
||||
) -> Result<Self, ConfigurationError> {
|
||||
let mut protected_destinations = BTreeSet::new();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#![doc = "Shared production interfaces for Lazaret processes."]
|
||||
#![doc = "Shared interfaces for Lazaret processes."]
|
||||
|
||||
pub mod codec;
|
||||
pub mod configuration;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ fn write_configuration(tree: &TestTree, body: &str) -> PathBuf {
|
|||
}
|
||||
|
||||
fn layout() -> SandboxLayoutV1 {
|
||||
SandboxLayoutV1::from_production_layout([
|
||||
SandboxLayoutV1::from_protected_destinations([
|
||||
"/workspace".to_owned(),
|
||||
"/proc".to_owned(),
|
||||
"/sys".to_owned(),
|
||||
|
|
@ -187,14 +187,14 @@ volumes = [{ host = "/source", container = "/root/source", kind = "socket" }]
|
|||
|
||||
#[test]
|
||||
fn sandbox_layout_is_closed_normalized_and_requires_workspace() {
|
||||
assert!(SandboxLayoutV1::from_production_layout(["/proc".into()]).is_err());
|
||||
assert!(SandboxLayoutV1::from_protected_destinations(["/proc".into()]).is_err());
|
||||
assert!(
|
||||
SandboxLayoutV1::from_production_layout(["/workspace".into(), "/workspace".into()])
|
||||
SandboxLayoutV1::from_protected_destinations(["/workspace".into(), "/workspace".into()])
|
||||
.is_err()
|
||||
);
|
||||
for invalid in ["workspace", "/", "/workspace/", "/workspace/../control"] {
|
||||
assert!(
|
||||
SandboxLayoutV1::from_production_layout(["/workspace".into(), invalid.into(),])
|
||||
SandboxLayoutV1::from_protected_destinations(["/workspace".into(), invalid.into(),])
|
||||
.is_err()
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue