Test for configuration include arrays being loaded at the correct
location.
Bug: #6300
--- /dev/null
+# 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
--- /dev/null
+%YAML 1.1
+---
+
+af-packet:
+ - interface: enp10s0
+ cluster-id: 99
+ cluster-type: cluster_flow
+ defrag: yes
--- /dev/null
+%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
--- /dev/null
+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