pin state as the first data dir with a comment and a test
This commit is contained in:
parent
76f5ede645
commit
cd1b77b078
1 changed files with 8 additions and 1 deletions
|
|
@ -44,7 +44,8 @@ const MARKER_ROOT: &str = "/var/lib/hive-priv/userns";
|
||||||
const MIN_AGENT_UID: u32 = 1000;
|
const MIN_AGENT_UID: u32 = 1000;
|
||||||
|
|
||||||
/// The dirs under `<AGENT_STATE_ROOT>/<agent>` the agent writes into. `config`
|
/// The dirs under `<AGENT_STATE_ROOT>/<agent>` the agent writes into. `config`
|
||||||
/// is not one of them: hive-core writes it and the agent only reads it.
|
/// is not one of them: hive-core writes it and the agent only reads it. `state`
|
||||||
|
/// stays first: [`move_data`] opens it by name and opens the rest from `[1..]`.
|
||||||
const DATA_DIRS: [&str; 4] = ["state", "harness", "work", "claude"];
|
const DATA_DIRS: [&str; 4] = ["state", "harness", "work", "claude"];
|
||||||
|
|
||||||
/// Where one call looks and writes, and what it was told.
|
/// Where one call looks and writes, and what it was told.
|
||||||
|
|
@ -729,6 +730,12 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// `move_data` opens `state` by name and takes the other dirs from `DATA_DIRS[1..]`.
|
||||||
|
#[test]
|
||||||
|
fn state_is_the_first_data_dir() {
|
||||||
|
assert_eq!(super::DATA_DIRS[0], "state");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn a_path_is_not_an_agent_name() {
|
fn a_path_is_not_an_agent_name() {
|
||||||
let root = tree();
|
let root = tree();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue