]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Only configure statistics-channels if supported
authorMark Andrews <marka@isc.org>
Tue, 3 Sep 2024 04:59:19 +0000 (14:59 +1000)
committerMark Andrews <marka@isc.org>
Wed, 11 Sep 2024 23:21:44 +0000 (09:21 +1000)
22 files changed:
bin/tests/system/statistics/ns1/named.conf.in
bin/tests/system/statistics/ns1/statistics-channels.conf.in [new file with mode: 0644]
bin/tests/system/statistics/ns2/named.conf.in
bin/tests/system/statistics/ns2/named2.conf.in
bin/tests/system/statistics/ns2/statistics-channels.conf.in [new file with mode: 0644]
bin/tests/system/statistics/ns3/named.conf.in
bin/tests/system/statistics/ns3/statistics-channels.conf.in [new file with mode: 0644]
bin/tests/system/statistics/setup.sh
bin/tests/system/statschannel/prereq.sh
bin/tests/system/synthfromdnssec/ns1/named.conf.in
bin/tests/system/synthfromdnssec/ns1/statistics-channels.conf.in [new file with mode: 0644]
bin/tests/system/synthfromdnssec/ns2/named.conf.in
bin/tests/system/synthfromdnssec/ns2/statistics-channels.conf.in [new file with mode: 0644]
bin/tests/system/synthfromdnssec/ns3/named.conf.in
bin/tests/system/synthfromdnssec/ns3/statistics-channels.conf.in [new file with mode: 0644]
bin/tests/system/synthfromdnssec/ns4/named.conf.in
bin/tests/system/synthfromdnssec/ns4/statistics-channels.conf.in [new file with mode: 0644]
bin/tests/system/synthfromdnssec/ns5/named.conf.in
bin/tests/system/synthfromdnssec/ns5/statistics-channels.conf.in [new file with mode: 0644]
bin/tests/system/synthfromdnssec/ns6/named.conf.in
bin/tests/system/synthfromdnssec/ns6/statistics-channels.conf.in [new file with mode: 0644]
bin/tests/system/synthfromdnssec/setup.sh

index 8fd14f9855f85400eef174f0bc2c1e339daa17af..2048d73bf94a2c2784a913e777241e780512c67c 100644 (file)
@@ -24,9 +24,7 @@ options {
        notify yes;
 };
 
-statistics-channels {
-       inet 10.53.0.1 port @EXTRAPORT1@ allow { any; };
-};
+include "statistics-channels.conf";
 
 zone "." {
        type primary;
diff --git a/bin/tests/system/statistics/ns1/statistics-channels.conf.in b/bin/tests/system/statistics/ns1/statistics-channels.conf.in
new file mode 100644 (file)
index 0000000..12a1e27
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+statistics-channels {
+        inet 10.53.0.1 port @EXTRAPORT1@ allow { any; };
+};
index 877e26a16f81838b82632733d2aa340b13ff95f5..f23bac8d6787d2b4df6b7d2a2f7aa86a1da2fc56 100644 (file)
@@ -26,9 +26,7 @@ options {
 
 trust-anchors { };
 
-statistics-channels {
-       inet 10.53.0.2 port @EXTRAPORT1@ allow { any; };
-};
+include "statistics-channels.conf";
 
 key rndc_key {
        secret "1234abcd8765";
index 39772f98221f8ab7e57c3feeb9ac3f2663453863..4b8e5030f14fae5afd0098cac5f8063d02c91f21 100644 (file)
@@ -24,9 +24,7 @@ options {
        notify yes;
 };
 
-statistics-channels {
-       inet 10.53.0.2 port @EXTRAPORT1@ allow { any; };
-};
+include "statistics-channels.conf";
 
 key rndc_key {
        secret "1234abcd8765";
diff --git a/bin/tests/system/statistics/ns2/statistics-channels.conf.in b/bin/tests/system/statistics/ns2/statistics-channels.conf.in
new file mode 100644 (file)
index 0000000..6dd1516
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+statistics-channels {
+        inet 10.53.0.2 port @EXTRAPORT1@ allow { any; };
+};
index 1726d1d381eb52ee82d9bd714fcab5e02ec509de..cacc0ec8e76f4f2c0e08557d72459cf8de6434f7 100644 (file)
@@ -29,9 +29,7 @@ options {
 
 trust-anchors { };
 
-statistics-channels {
-       inet 10.53.0.3 port @EXTRAPORT1@ allow { any; };
-};
+include "statistics-channels.conf";
 
 key rndc_key {
        secret "1234abcd8765";
diff --git a/bin/tests/system/statistics/ns3/statistics-channels.conf.in b/bin/tests/system/statistics/ns3/statistics-channels.conf.in
new file mode 100644 (file)
index 0000000..a755c39
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+statistics-channels {
+        inet 10.53.0.3 port @EXTRAPORT1@ allow { any; };
+};
index 7ffda5583c449b68a3c36141c5568fbb71feaab2..37f52f5e32f66859b0b749122cf2c92250105de9 100644 (file)
 
 . ../conf.sh
 
-copy_setports ns1/named.conf.in ns1/named.conf
-copy_setports ns2/named.conf.in ns2/named.conf
-copy_setports ns3/named.conf.in ns3/named.conf
+for d in ns1 ns2 ns3; do
+  conf=named.conf
+  copy_setports "${d}/${conf}.in" "${d}/${conf}"
+  conf=statistics-channels.conf
+  if $FEATURETEST --have-libxml2 || $FEATURETEST --have-json-c; then
+    copy_setports "${d}/${conf}.in" "${d}/${conf}"
+  else
+    echo "" >"${d}/${conf}"
+  fi
+done
index a0ad7a9bc7dc3a5e6dbbc8a04d30c2de20376b1a..df30423dc69abe5f2d7415ac02a971aa7ea85678 100644 (file)
@@ -23,4 +23,9 @@ if ! ${PERL} -MFile::Fetch -e ''; then
   exit 1
 fi
 
+if ! $FEATURETEST --have-libxml2 && ! $FEATURETEST --have-json-c; then
+  echo_i "skip: one or both of --with-libxml2 and --with-json-c required"
+  exit 255
+fi
+
 exit 0
index 9a86e24acc039200b0209e3ab1024e40fd7e6c48..6a5086e4b2f46de32e31711652108674318f39e3 100644 (file)
@@ -35,9 +35,7 @@ controls {
        inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-statistics-channels {
-       inet 10.53.0.1 port @EXTRAPORT1@ allow { any; };
-};
+include "statistics-channels.conf";
 
 zone "." {
        type primary;
diff --git a/bin/tests/system/synthfromdnssec/ns1/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns1/statistics-channels.conf.in
new file mode 100644 (file)
index 0000000..12a1e27
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+statistics-channels {
+        inet 10.53.0.1 port @EXTRAPORT1@ allow { any; };
+};
index f4b5059c44cf53b38336c08e837d91589658ad13..efcf7e5d78d9c4d57341465b535a2d54101e3a7c 100644 (file)
@@ -35,9 +35,7 @@ controls {
        inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-statistics-channels {
-       inet 10.53.0.2 port @EXTRAPORT1@ allow { any; };
-};
+include "statistics-channels.conf";
 
 zone "." {
        type hint;
diff --git a/bin/tests/system/synthfromdnssec/ns2/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns2/statistics-channels.conf.in
new file mode 100644 (file)
index 0000000..6dd1516
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+statistics-channels {
+        inet 10.53.0.2 port @EXTRAPORT1@ allow { any; };
+};
index 874143a5438e14663888cd233ba6be867a516a3a..7665d8a6e6d32598524a30a0b06c7e7f3167e190 100644 (file)
@@ -35,9 +35,7 @@ controls {
        inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-statistics-channels {
-       inet 10.53.0.3 port @EXTRAPORT1@ allow { any; };
-};
+include "statistics-channels.conf";
 
 zone "." {
        type hint;
diff --git a/bin/tests/system/synthfromdnssec/ns3/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns3/statistics-channels.conf.in
new file mode 100644 (file)
index 0000000..a755c39
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+statistics-channels {
+        inet 10.53.0.3 port @EXTRAPORT1@ allow { any; };
+};
index c9d921092eb81b6d59ff37478817010406687576..85cbc38d98696f4c4536f2f056fa5cfed956192b 100644 (file)
@@ -36,9 +36,7 @@ controls {
        inet 10.53.0.4 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-statistics-channels {
-       inet 10.53.0.4 port @EXTRAPORT1@ allow { any; };
-};
+include "statistics-channels.conf";
 
 zone "." {
        type hint;
diff --git a/bin/tests/system/synthfromdnssec/ns4/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns4/statistics-channels.conf.in
new file mode 100644 (file)
index 0000000..5a89f8d
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+statistics-channels {
+        inet 10.53.0.4 port @EXTRAPORT1@ allow { any; };
+};
index 42495488c20e4f36abf2ece74f2557f117c8918f..0875b7701eb9fddf8ddaa1ee50820480d9d5af62 100644 (file)
@@ -37,9 +37,7 @@ controls {
        inet 10.53.0.5 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-statistics-channels {
-       inet 10.53.0.5 port @EXTRAPORT1@ allow { any; };
-};
+include "statistics-channels.conf";
 
 zone "." {
        type hint;
diff --git a/bin/tests/system/synthfromdnssec/ns5/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns5/statistics-channels.conf.in
new file mode 100644 (file)
index 0000000..12a9398
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+statistics-channels {
+        inet 10.53.0.5 port @EXTRAPORT1@ allow { any; };
+};
index c10e0f70e25fcee4b7c21b2776cacce5b03cf1b4..1f631865acfc04b24f78d291db265c584cefbeb0 100644 (file)
@@ -36,9 +36,7 @@ controls {
        inet 10.53.0.6 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-statistics-channels {
-       inet 10.53.0.6 port @EXTRAPORT1@ allow { any; };
-};
+include "statistics-channels.conf";
 
 zone "." {
        type hint;
diff --git a/bin/tests/system/synthfromdnssec/ns6/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns6/statistics-channels.conf.in
new file mode 100644 (file)
index 0000000..138a84b
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+statistics-channels {
+        inet 10.53.0.6 port @EXTRAPORT1@ allow { any; };
+};
index 5d0ddee2d3584f5b1621fb3d171d2ea84d41d716..85feba601d04cbd0960b6f858cfa18958d34fd6f 100644 (file)
 
 set -e
 
-copy_setports ns1/named.conf.in ns1/named.conf
-copy_setports ns2/named.conf.in ns2/named.conf
-copy_setports ns3/named.conf.in ns3/named.conf
-copy_setports ns4/named.conf.in ns4/named.conf
-copy_setports ns5/named.conf.in ns5/named.conf
-copy_setports ns6/named.conf.in ns6/named.conf
+for d in ns1 ns2 ns3 ns4 ns5 ns6; do
+  conf=named.conf
+  copy_setports "${d}/${conf}.in" "${d}/${conf}"
+  conf=statistics-channels.conf
+  if $FEATURETEST --have-libxml2 || $FEATURETEST --have-json-c; then
+    copy_setports "${d}/${conf}.in" "${d}/${conf}"
+  else
+    echo "" >"${d}/${conf}"
+  fi
+done
 
 (
   cd ns1