[edge] Tests first: a Domi device cert is accepted for mTLS, a self-signed one with the same subject, an unlisted one and none are not (red)

This commit is contained in:
2026-11-07 22:46:08 +01:00
parent 18da3f5d5a
commit 4054427b62
5 changed files with 293 additions and 0 deletions
+6
View File
@@ -108,6 +108,8 @@ pub struct EdgeSpec<'a> {
pub extra_args: Vec<String>,
/// Fixed HTTP port (e.g. one Pebble was told to validate against).
pub http_port: Option<u16>,
/// Extra files written into the edge directory before it starts (path relative to it).
pub files: Vec<(String, Vec<u8>)>,
}
impl Default for EdgeSpec<'_> {
@@ -119,6 +121,7 @@ impl Default for EdgeSpec<'_> {
log_level: "info",
extra_args: Vec::new(),
http_port: None,
files: Vec::new(),
}
}
}
@@ -165,6 +168,9 @@ pub fn spawn(spec: EdgeSpec<'_>) -> Edge {
}
let ca = TestCa::new("Ianitor Test CA");
std::fs::write(dir.join("creds/share-link-key"), SHARE_KEY).unwrap();
for (path, value) in &spec.files {
std::fs::write(dir.join(path), value).unwrap();
}
for (name, value) in &spec.secrets {
std::fs::write(dir.join(&format!("creds/{name}")), value).unwrap();
}