]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
config/ftp: Test behavior w/invalid values 2322/head
authorJeff Lucovsky <jlucovsky@oisf.net>
Tue, 4 Feb 2025 13:28:34 +0000 (08:28 -0500)
committerVictor Julien <victor@inliniac.net>
Tue, 25 Feb 2025 14:49:29 +0000 (15:49 +0100)
Issue: 4082

Test the FTP config logic when there are invalid values for
- memcap
- max-tx
- max-line-len

Ensure that a warning message is displayed

tests/ftp/ftp-invalid-config/README.md [new file with mode: 0644]
tests/ftp/ftp-invalid-config/test.yaml [new file with mode: 0644]

diff --git a/tests/ftp/ftp-invalid-config/README.md b/tests/ftp/ftp-invalid-config/README.md
new file mode 100644 (file)
index 0000000..0ade37c
--- /dev/null
@@ -0,0 +1,4 @@
+# Description
+
+Test FTP config parsing warning messages when there are invalid values.
+Cf https://redmine.openinfosecfoundation.org/issues/4082
diff --git a/tests/ftp/ftp-invalid-config/test.yaml b/tests/ftp/ftp-invalid-config/test.yaml
new file mode 100644 (file)
index 0000000..e2d8de4
--- /dev/null
@@ -0,0 +1,20 @@
+requires:
+  min-version: 8
+pcap: false
+
+args:
+  - -T
+  - --set app-layer.protocols.ftp.memcap=suricata
+  - --set app-layer.protocols.ftp.max-tx=suricata
+  - --set app-layer.protocols.ftp.max-line-length=suricata
+
+checks:
+    - shell:
+        args: grep "Warning.*ftp.*Invalid value.*ftp.memcap" suricata.log | wc -l | xargs
+        expect: 1
+    - shell:
+        args: grep "Warning.*ftp.*Invalid value.*ftp.max-tx" suricata.log | wc -l | xargs
+        expect: 1
+    - shell:
+        args: grep "Warning.*ftp.*Invalid value.*ftp.max-line-length" suricata.log | wc -l | xargs
+        expect: 1