]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/content: add negated endswith test
authorVictor Julien <vjulien@oisf.net>
Fri, 14 Apr 2023 12:17:53 +0000 (14:17 +0200)
committerVictor Julien <vjulien@oisf.net>
Fri, 14 Apr 2023 12:49:09 +0000 (14:49 +0200)
src/tests/detect-engine-content-inspection.c

index 43cf0b805eb08d086ce7d1b63b629e658977500b..ee1b605f2c0d7254ab62dbed025963f307570b3b 100644 (file)
@@ -255,6 +255,8 @@ static int DetectEngineContentInspectionTest12(void) {
     TEST_RUN("abcXYZ", 6, "content:\"abc\"; content:\"XYZ\"; distance:0; within:3; endswith;", true, 2);
     TEST_RUN("abcXYZ", 6, "content:\"XYZ\"; distance:3; within:3; endswith;", true, 1);
     TEST_RUN("abcXYZ", 6, "content:\"cXY\"; distance:2; within:3; endswith;", false, 1);
+    TEST_RUN("abcXYZ", 6, "content:!\"cXY\"; endswith;", true, 1);
+    TEST_RUN("abcXYZ", 6, "content:!\"XYZ\"; endswith;", false, 1);
 
     TEST_RUN("xxxxxxxxxxxxxxxxxyYYYYYYYYYYYYYYYY", 34, "content:\"yYYYYYYYYYYYYYYYY\"; distance:9; within:29; endswith;", true, 1);
     TEST_FOOTER;