24 lines
910 B
Python
24 lines
910 B
Python
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def test_entrypoint_folds_mutable_suricata_state_under_data():
|
|
script = (ROOT / "scripts" / "entrypoint.sh").read_text()
|
|
assert '${PERSIST_ROOT}/logs/suricata' in script
|
|
assert '${PERSIST_ROOT}/lib/suricata' in script
|
|
assert 'ln -s "$PERSIST_LOG_DIR" /var/log/suricata' not in script
|
|
assert 'ln -s "$PERSIST_LIB_DIR" /var/lib/suricata' not in script
|
|
|
|
|
|
def test_eve_default_is_persistent():
|
|
config = (ROOT / "app" / "config.py").read_text()
|
|
assert '/data/logs/suricata/eve.json' in config
|
|
|
|
|
|
def test_rule_updater_uses_persistent_suricata_data_dir():
|
|
script = (ROOT / "scripts" / "update-rules.sh").read_text()
|
|
assert 'PERSIST_LIB_DIR="${SURICATA_PERSIST_LIB_DIR:-/data/lib/suricata}"' in script
|
|
assert '-D "$PERSIST_LIB_DIR"' in script
|
|
assert 'default-rule-path=$PERSIST_LIB_DIR/rules' in script
|