netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [conntrack-tools PATCH 1/2] tests: conntrackd: add testcase for missing hashtable buckets and max entries
@ 2021-03-10 12:37 Arturo Borrero Gonzalez
  2021-03-10 12:37 ` [conntrack-tools PATCH 2/2] tests: conntrackd: silence sysctl Arturo Borrero Gonzalez
  2021-03-11 13:35 ` [conntrack-tools PATCH 1/2] tests: conntrackd: add testcase for missing hashtable buckets and max entries Pablo Neira Ayuso
  0 siblings, 2 replies; 4+ messages in thread
From: Arturo Borrero Gonzalez @ 2021-03-10 12:37 UTC (permalink / raw)
  To: netfilter-devel

This test case covers missing hashtable buckets and max entries configuration options. There should
be a value for them, otherwise the daemon segfaults.

Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
---
 tests/conntrackd/scenarios.yaml |    5 +++++
 tests/conntrackd/tests.yaml     |   31 +++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [conntrack-tools PATCH 2/2] tests: conntrackd: silence sysctl
  2021-03-10 12:37 [conntrack-tools PATCH 1/2] tests: conntrackd: add testcase for missing hashtable buckets and max entries Arturo Borrero Gonzalez
@ 2021-03-10 12:37 ` Arturo Borrero Gonzalez
  2021-03-11 13:35   ` Pablo Neira Ayuso
  2021-03-11 13:35 ` [conntrack-tools PATCH 1/2] tests: conntrackd: add testcase for missing hashtable buckets and max entries Pablo Neira Ayuso
  1 sibling, 1 reply; 4+ messages in thread
From: Arturo Borrero Gonzalez @ 2021-03-10 12:37 UTC (permalink / raw)
  To: netfilter-devel

We are not interested in sysctl echoing the value it just set.

Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
---
 tests/conntrackd/scenarios/basic/network-setup.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/conntrackd/scenarios/basic/network-setup.sh b/tests/conntrackd/scenarios/basic/network-setup.sh
index ff8df26..7f2f78a 100755
--- a/tests/conntrackd/scenarios/basic/network-setup.sh
+++ b/tests/conntrackd/scenarios/basic/network-setup.sh
@@ -25,7 +25,7 @@ start () {
 	ip -net nsr1 link set up dev veth0
 	ip -net nsr1 link set up dev veth1
 	ip -net nsr1 route add default via 192.168.10.2
-	ip netns exec nsr1 sysctl net.ipv4.ip_forward=1
+	ip netns exec nsr1 sysctl -q net.ipv4.ip_forward=1
 
 	ip -net nsr1 addr add 192.168.100.2/24 dev veth2
 	ip -net nsr1 link set up dev veth2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [conntrack-tools PATCH 1/2] tests: conntrackd: add testcase for missing hashtable buckets and max entries
  2021-03-10 12:37 [conntrack-tools PATCH 1/2] tests: conntrackd: add testcase for missing hashtable buckets and max entries Arturo Borrero Gonzalez
  2021-03-10 12:37 ` [conntrack-tools PATCH 2/2] tests: conntrackd: silence sysctl Arturo Borrero Gonzalez
@ 2021-03-11 13:35 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2021-03-11 13:35 UTC (permalink / raw)
  To: Arturo Borrero Gonzalez; +Cc: netfilter-devel

On Wed, Mar 10, 2021 at 01:37:03PM +0100, Arturo Borrero Gonzalez wrote:
> This test case covers missing hashtable buckets and max entries configuration options. There should
> be a value for them, otherwise the daemon segfaults.
> 
> Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [conntrack-tools PATCH 2/2] tests: conntrackd: silence sysctl
  2021-03-10 12:37 ` [conntrack-tools PATCH 2/2] tests: conntrackd: silence sysctl Arturo Borrero Gonzalez
@ 2021-03-11 13:35   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2021-03-11 13:35 UTC (permalink / raw)
  To: Arturo Borrero Gonzalez; +Cc: netfilter-devel

On Wed, Mar 10, 2021 at 01:37:10PM +0100, Arturo Borrero Gonzalez wrote:
> We are not interested in sysctl echoing the value it just set.
> 
> Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-11 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-10 12:37 [conntrack-tools PATCH 1/2] tests: conntrackd: add testcase for missing hashtable buckets and max entries Arturo Borrero Gonzalez
2021-03-10 12:37 ` [conntrack-tools PATCH 2/2] tests: conntrackd: silence sysctl Arturo Borrero Gonzalez
2021-03-11 13:35   ` Pablo Neira Ayuso
2021-03-11 13:35 ` [conntrack-tools PATCH 1/2] tests: conntrackd: add testcase for missing hashtable buckets and max entries Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).