Skip to content

Commit

Permalink
test: configuration include arrays
Browse files Browse the repository at this point in the history
Test for configuration include arrays being loaded at the correct
location.

Bug: #6300
  • Loading branch information
jasonish committed Sep 7, 2023
1 parent 9d7cba8 commit 9e57230
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/config-includes-array/README.md
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions tests/config-includes-array/af-packet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
%YAML 1.1
---

af-packet:
- interface: enp10s0
cluster-id: 99
cluster-type: cluster_flow
defrag: yes
14 changes: 14 additions & 0 deletions tests/config-includes-array/suricata.yaml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions tests/config-includes-array/test.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9e57230

Please sign in to comment.