From: jason taylor Date: Wed, 15 May 2019 15:19:48 +0000 (-0400) Subject: tests: add invalid depth and depth usage X-Git-Tag: suricata-6.0.4~450 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=697a0d8f800721a1c6c97788367f7c42fb058c5f;p=thirdparty%2Fsuricata-verify.git tests: add invalid depth and depth usage Signed-off-by: jason taylor --- diff --git a/tests/test-bad-depth-depth-rule-1/suricata.yaml b/tests/test-bad-depth-depth-rule-1/suricata.yaml new file mode 100644 index 000000000..dcaae57fe --- /dev/null +++ b/tests/test-bad-depth-depth-rule-1/suricata.yaml @@ -0,0 +1,10 @@ +%YAML 1.1 +--- + +logging: + default-log-level: info + outputs: + - file: + enabled: yes + filename: eve.json + type: json diff --git a/tests/test-bad-depth-depth-rule-1/test.rules b/tests/test-bad-depth-depth-rule-1/test.rules new file mode 100644 index 000000000..e76095256 --- /dev/null +++ b/tests/test-bad-depth-depth-rule-1/test.rules @@ -0,0 +1 @@ +alert udp any any -> any any (msg:"TEST SUCCESFULL - Depth/Depth INVALID combination "; content:"AA"; depth:50; depth:20; sid:5555554; rev:1;) diff --git a/tests/test-bad-depth-depth-rule-1/test.yaml b/tests/test-bad-depth-depth-rule-1/test.yaml new file mode 100644 index 000000000..7a94d3565 --- /dev/null +++ b/tests/test-bad-depth-depth-rule-1/test.yaml @@ -0,0 +1,21 @@ +requires: + features: + - HAVE_LIBJANSSON + +command: | + ${SRCDIR}/src/suricata --set classification-file="${SRCDIR}/classification.config" --set reference-config-file="${SRCDIR}/reference.config" -l ${OUTPUT_DIR} -c ${TEST_DIR}/suricata.yaml -r ${TEST_DIR}/ -S ${TEST_DIR}/test.rules + +checks: + # check that we have the following entres in eve.json + # match 1 specific rule load failure reason + - filter: + count: 1 + match: + event_type: engine + engine.message: "can't use multiple depths for the same content." + + - filter: + count: 1 + match: + event_type: engine + engine.error: "SC_ERR_NO_RULES_LOADED"