diff --git a/tests/config-includes-array/README.md b/tests/config-includes-array/README.md new file mode 100644 index 000000000..76be123db --- /dev/null +++ b/tests/config-includes-array/README.md @@ -0,0 +1,6 @@ +# Configure Include Array Test + +Test that files included as part of array are included into the +corrent location. + +Issue: https://redmine.openinfosecfoundation.org/issues/6300 diff --git a/tests/config-includes-array/af-packet.yaml b/tests/config-includes-array/af-packet.yaml new file mode 100644 index 000000000..0c47d8323 --- /dev/null +++ b/tests/config-includes-array/af-packet.yaml @@ -0,0 +1,8 @@ +%YAML 1.1 +--- + +af-packet: + - interface: enp10s0 + cluster-id: 99 + cluster-type: cluster_flow + defrag: yes diff --git a/tests/config-includes-array/suricata.yaml b/tests/config-includes-array/suricata.yaml new file mode 100644 index 000000000..257004254 --- /dev/null +++ b/tests/config-includes-array/suricata.yaml @@ -0,0 +1,14 @@ +%YAML 1.1 +--- + +classification-file: /etc/suricata/classification.config +reference-config-file: /etc/suricata/reference.config + +# These will be included into the root of the configuration tree. +include: + - ./af-packet.yaml + +foobar: + include: + # This should be included under foobar. + - ./af-packet.yaml diff --git a/tests/config-includes-array/test.yaml b/tests/config-includes-array/test.yaml new file mode 100644 index 000000000..cd291fd08 --- /dev/null +++ b/tests/config-includes-array/test.yaml @@ -0,0 +1,24 @@ +requires: + min-version: 7 + +pcap: false + +args: + - --dump-config + +checks: + - shell: + args: grep '^af-packet.0 = interface' stdout | wc -l + expect: 1 + + - shell: + args: grep '^af-packet.0.interface = enp10s0' stdout | wc -l + expect: 1 + + - shell: + args: grep 'foobar.af-packet.0 = interface' stdout | wc -l + expect: 1 + + - shell: + args: grep 'foobar.af-packet.0.interface = enp10s0' stdout | wc -l + expect: 1