From: Juliana Fajardini Date: Wed, 2 Apr 2025 23:48:09 +0000 (-0700) Subject: pgsql: add tests for copy-out mode X-Git-Tag: suricata-7.0.11~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efed1efe07cbe68aa83e11dca160372057f9cdce;p=thirdparty%2Fsuricata-verify.git pgsql: add tests for copy-out mode Task #4854 --- diff --git a/tests/pgsql/pgsql-copy-data-out/input.pcap b/tests/pgsql/pgsql-copy-data-out/input.pcap new file mode 100644 index 000000000..9618ef90d Binary files /dev/null and b/tests/pgsql/pgsql-copy-data-out/input.pcap differ diff --git a/tests/pgsql/pgsql-copy-data-out/suricata.yaml b/tests/pgsql/pgsql-copy-data-out/suricata.yaml new file mode 100644 index 000000000..bade98943 --- /dev/null +++ b/tests/pgsql/pgsql-copy-data-out/suricata.yaml @@ -0,0 +1,18 @@ +%YAML 1.1 +--- + +outputs: + - eve-log: + enabled: yes + filetype: regular + filename: eve.json + types: + - pgsql: + passwords: false + +app-layer: + protocols: + pgsql: + enabled: yes + stream-depth: 0 + diff --git a/tests/pgsql/pgsql-copy-data-out/test.yaml b/tests/pgsql/pgsql-copy-data-out/test.yaml new file mode 100644 index 000000000..7bb7d63af --- /dev/null +++ b/tests/pgsql/pgsql-copy-data-out/test.yaml @@ -0,0 +1,21 @@ +requires: + min-version: 8 + +args: +- -k none + +checks: +- filter: + count: 5 + match: + event_type: pgsql +- filter: + count: 1 + match: + event_type: pgsql + pgsql.request.simple_query: "COPY (SELECT * FROM rules WHERE source = 'tgreen/hunting' LIMIT 5) TO STDOUT" + pgsql.response.command_completed: COPY 5 + pgsql.response.copy_data_out.row_count: 5 + pgsql.response.copy_data_out.data_size: 2779 + pgsql.tx_id: 4 + proto: TCP