From fedfcf24b8e220f186846f8a450b993c0ac48df2 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Tue, 4 Feb 2025 08:28:34 -0500 Subject: [PATCH] config/ftp: Test behavior w/invalid values 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 | 4 ++++ tests/ftp/ftp-invalid-config/test.yaml | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/ftp/ftp-invalid-config/README.md create mode 100644 tests/ftp/ftp-invalid-config/test.yaml diff --git a/tests/ftp/ftp-invalid-config/README.md b/tests/ftp/ftp-invalid-config/README.md new file mode 100644 index 000000000..0ade37c4a --- /dev/null +++ b/tests/ftp/ftp-invalid-config/README.md @@ -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 index 000000000..e2d8de474 --- /dev/null +++ b/tests/ftp/ftp-invalid-config/test.yaml @@ -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 -- 2.47.2