ci: check-doc-rules copies data(sets) files into tmpdir

Allows to use datasets load
pull/15610/head
Philippe Antoine 5 months ago committed by Victor Julien
parent d154484cc6
commit 762b725e1f

@ -111,9 +111,11 @@ def check_rule_with_suricata(
rule: str, rule: str,
suricata_bin: Path, suricata_bin: Path,
suricata_yaml: Path, suricata_yaml: Path,
data_dir: Path,
) -> Tuple[bool, str]: ) -> Tuple[bool, str]:
with tempfile.TemporaryDirectory(prefix="doc-rule-check-") as tmpdir: with tempfile.TemporaryDirectory(prefix="doc-rule-check-") as tmpdir:
rule_file = Path(tmpdir) / "rule.rules" rule_file = Path(tmpdir) / "rule.rules"
shutil.copytree(data_dir, tmpdir, dirs_exist_ok=True)
rule_file.write_text(rule + "\n", encoding="utf-8") rule_file.write_text(rule + "\n", encoding="utf-8")
cmd = [ cmd = [
@ -185,6 +187,7 @@ def main() -> int:
rule, rule,
suricata_bin, suricata_bin,
suricata_yaml, suricata_yaml,
repo_root / "scripts" / "docrules" / "data",
) )
if not is_valid: if not is_valid:
print( print(

Loading…
Cancel
Save