summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArturo Borrero Gonzalez <arturo@netfilter.org>2021-03-10 13:10:47 +0100
committerArturo Borrero Gonzalez <arturo@netfilter.org>2021-03-10 13:10:47 +0100
commit323ca7be1a2dbb7031957979449587f5379900c7 (patch)
treec40cd2c6708a599b98b3b42a8187f7a48aa4fe94
parent3276471d23d4d96d55e9a0fb7a10983d8097dc45 (diff)
tests: conntrackd: add testcase for missing hashtable buckets and max entries
This test case covers missing hashtable buckets and max entries configuration options. There should be a value for them, otherwise the daemon segfaults. Acked-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
-rw-r--r--tests/conntrackd/scenarios.yaml5
-rw-r--r--tests/conntrackd/tests.yaml31
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/conntrackd/scenarios.yaml b/tests/conntrackd/scenarios.yaml
index 6c425d0..65d6fa4 100644
--- a/tests/conntrackd/scenarios.yaml
+++ b/tests/conntrackd/scenarios.yaml
@@ -1,3 +1,8 @@
+- name: empty
+ start:
+ - ":"
+ stop:
+ - ":"
- name: simple_stats
start:
- rm -f /var/lock/conntrack.lock
diff --git a/tests/conntrackd/tests.yaml b/tests/conntrackd/tests.yaml
index 872269d..307f38f 100644
--- a/tests/conntrackd/tests.yaml
+++ b/tests/conntrackd/tests.yaml
@@ -50,3 +50,34 @@
- timeout 5 bash -c -- '
while ! ip netns exec nsr2 $CONNTRACK -L -p icmp 2>/dev/null | grep -q icmp
; do sleep 0.5 ; done'
+
+- name: hash_defaults_segfault
+ scenario: empty
+ test:
+ - rm -f /var/lock/conntrack.lock
+ - |
+ cat << EOF > /tmp/conntrackd_notrack_hash_defaults
+ Sync {
+ Mode NOTRACK { }
+ Multicast {
+ IPv4_address 225.0.0.50
+ Group 3780
+ IPv4_interface 127.0.0.1
+ Interface lo
+ SndSocketBuffer 1249280
+ RcvSocketBuffer 1249280
+ Checksum on
+ }
+ }
+ General {
+ LogFile on
+ Syslog on
+ LockFile /var/lock/conntrackd.lock
+ UNIX { Path /var/run/conntrackd.sock }
+ NetlinkBufferSize 2097152
+ NetlinkBufferSizeMaxGrowth 8388608
+ }
+ EOF
+ - $CONNTRACKD -C /tmp/conntrackd_notrack_hash_defaults -d
+ - $CONNTRACKD -C /tmp/conntrackd_notrack_hash_defaults -s | grep -q "cache"
+ - $CONNTRACKD -C /tmp/conntrackd_notrack_hash_defaults -k