Skip to content

Commit

Permalink
config/ftp: Test behavior w/invalid values
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jlucovsky authored and victorjulien committed Feb 25, 2025
1 parent 661733b commit fedfcf2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/ftp/ftp-invalid-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Description

Test FTP config parsing warning messages when there are invalid values.
Cf https://redmine.openinfosecfoundation.org/issues/4082
20 changes: 20 additions & 0 deletions tests/ftp/ftp-invalid-config/test.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fedfcf2

Please sign in to comment.