mirror of
https://github.com/FuzzingLabs/fuzzforge_ai.git
synced 2026-07-08 21:37:48 +02:00
test: Update fuzzer tests to use new create_finding signature
Fixed failing unit tests that were using the old create_finding() signature. The native findings format refactoring added two new required parameters: - rule_id: Identifier for the rule/pattern that detected the finding - found_by: FoundBy object with module, tool, and detection type info Updated tests: - test_cargo_fuzzer.py::test_create_finding_from_crash - test_atheris_fuzzer.py::test_create_crash_finding Both tests now properly instantiate FoundBy objects with appropriate fuzzer metadata (module name, tool name, version, and type="fuzzer").
This commit is contained in:
@@ -159,11 +159,20 @@ class TestAtherisFuzzerFindingGeneration:
|
|||||||
|
|
||||||
async def test_create_crash_finding(self, atheris_fuzzer):
|
async def test_create_crash_finding(self, atheris_fuzzer):
|
||||||
"""Test crash finding creation"""
|
"""Test crash finding creation"""
|
||||||
|
from models.finding_schema import FoundBy
|
||||||
|
|
||||||
finding = atheris_fuzzer.create_finding(
|
finding = atheris_fuzzer.create_finding(
|
||||||
|
rule_id="atheris-crash",
|
||||||
title="Crash: Exception in TestOneInput",
|
title="Crash: Exception in TestOneInput",
|
||||||
description="IndexError: list index out of range",
|
description="IndexError: list index out of range",
|
||||||
severity="high",
|
severity="high",
|
||||||
category="crash",
|
category="crash",
|
||||||
|
found_by=FoundBy(
|
||||||
|
module="atheris_fuzzer",
|
||||||
|
tool_name="Atheris",
|
||||||
|
tool_version="2.3.0",
|
||||||
|
type="fuzzer"
|
||||||
|
),
|
||||||
file_path="fuzz_target.py",
|
file_path="fuzz_target.py",
|
||||||
metadata={
|
metadata={
|
||||||
"crash_type": "IndexError",
|
"crash_type": "IndexError",
|
||||||
|
|||||||
@@ -161,11 +161,20 @@ class TestCargoFuzzerFindingGeneration:
|
|||||||
|
|
||||||
async def test_create_finding_from_crash(self, cargo_fuzzer):
|
async def test_create_finding_from_crash(self, cargo_fuzzer):
|
||||||
"""Test finding creation"""
|
"""Test finding creation"""
|
||||||
|
from models.finding_schema import FoundBy
|
||||||
|
|
||||||
finding = cargo_fuzzer.create_finding(
|
finding = cargo_fuzzer.create_finding(
|
||||||
|
rule_id="cargo-fuzz-crash",
|
||||||
title="Crash: Segmentation Fault",
|
title="Crash: Segmentation Fault",
|
||||||
description="Test crash",
|
description="Test crash",
|
||||||
severity="critical",
|
severity="critical",
|
||||||
category="crash",
|
category="crash",
|
||||||
|
found_by=FoundBy(
|
||||||
|
module="cargo_fuzz",
|
||||||
|
tool_name="cargo-fuzz",
|
||||||
|
tool_version="0.11.2",
|
||||||
|
type="fuzzer"
|
||||||
|
),
|
||||||
file_path="fuzz/fuzz_targets/fuzz_target_1.rs",
|
file_path="fuzz/fuzz_targets/fuzz_target_1.rs",
|
||||||
metadata={"crash_type": "SIGSEGV"}
|
metadata={"crash_type": "SIGSEGV"}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user