fix(worker): V1-2.3 hostile corpus through verify, verdict and memory caps aligned
This commit is contained in:
1 parent
7043d39ae0
commit
6aa85fe7e4
7 files changed
+67
-10
No files matched your search
@@ -252,6 +252,34 @@ fn a_sheet_at_every_cap_is_verified_within_the_limits() {
|
||||
);
|
||||
}
|
||||
|
||||
/// The core's hostile SVG corpus as the drawing of a submitted sheet: each one is judged by
|
||||
/// the core inside the full sandbox (an integrity failure), never a crash or a signal.
|
||||
#[test]
|
||||
fn the_hostile_svg_corpus_fails_verification_inside_the_sandbox() {
|
||||
let dir = concat!(
|
||||
env!("CARGO_MANIFEST_DIR"),
|
||||
"/../core/tests/fixtures/svg/hostile"
|
||||
);
|
||||
let mut seen = 0;
|
||||
for entry in std::fs::read_dir(dir).unwrap() {
|
||||
let path = entry.unwrap().path();
|
||||
let drawing = std::fs::read(&path).unwrap();
|
||||
let verdict = expect_verdict(&fixtures::sheet_frame_on(
|
||||
&fixtures::sheet_document(),
|
||||
&drawing,
|
||||
));
|
||||
let code = verdict["failure_code"].as_str().unwrap_or_default();
|
||||
assert_eq!(verdict["outcome"], "failed", "{}", path.display());
|
||||
assert!(
|
||||
code.starts_with("verification.integrity.svg_"),
|
||||
"{}: {code}",
|
||||
path.display()
|
||||
);
|
||||
seen += 1;
|
||||
}
|
||||
assert!(seen >= 40, "hostile corpus read: {seen} files");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_verify_child_refuses_a_non_empty_environment() {
|
||||
let status = Command::new(env!("CARGO_BIN_EXE_faunosteo-worker"))
|
||||
|
||||
Reference in new issue
Block a user