]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test "tkey-gssapi-credential" conditionally
authorMichał Kępień <michal@isc.org>
Mon, 26 Apr 2021 05:16:38 +0000 (07:16 +0200)
committerMichał Kępień <michal@isc.org>
Mon, 26 Apr 2021 07:46:23 +0000 (09:46 +0200)
If "tkey-gssapi-credential" is set in the configuration and GSSAPI
support is not available, named will refuse to start.  As the test
system framework does not support starting named instances
conditionally, ensure that "tkey-gssapi-credential" is only present in
named.conf if GSSAPI support is available.

(cherry picked from commit 6feac68b5050e445b2e46b364ab7a0490e57ae52)

bin/tests/system/nsupdate/ns10/named.conf.in
bin/tests/system/nsupdate/ns9/named.conf.in
bin/tests/system/nsupdate/setup.sh

index 3ea8761978617c845e6f4c700e6237600298dc73..5bf3b53dd90a4ffa38c2544c92408c8eeddd5baf 100644 (file)
@@ -20,7 +20,7 @@ options {
        recursion no;
        notify yes;
        minimal-responses no;
-       tkey-gssapi-credential "DNS/ns10.example.com@EXAMPLE.COM";
+       @TKEY_CONFIGURATION@
 };
 
 key rndc_key {
index 52294d12ec33b270b1a47b91c7ffc415090f5c52..40b9e9f7677c483b380b420011c78daa8e3b8d57 100644 (file)
@@ -20,7 +20,7 @@ options {
        recursion no;
        notify yes;
        minimal-responses no;
-       tkey-gssapi-credential "DNS/ns9.example.com@EXAMPLE.COM";
+       @TKEY_CONFIGURATION@
 };
 
 key rndc_key {
index 6fbf1d79dd336d4df242362b67d2de00e6da26ad..2b3b1549cbf837f7ed5cf8d54c70837b9c6e845e 100644 (file)
@@ -21,8 +21,23 @@ copy_setports ns5/named.conf.in ns5/named.conf
 copy_setports ns6/named.conf.in ns6/named.conf
 copy_setports ns7/named.conf.in ns7/named.conf
 copy_setports ns8/named.conf.in ns8/named.conf
-copy_setports ns9/named.conf.in ns9/named.conf
-copy_setports ns10/named.conf.in ns10/named.conf
+
+# If "tkey-gssapi-credential" is set in the configuration and GSSAPI support is
+# not available, named will refuse to start.  As the test system framework does
+# not support starting named instances conditionally, ensure that
+# "tkey-gssapi-credential" is only present in named.conf if GSSAPI support is
+# available.
+copy_setports ns9/named.conf.in ns9/named.conf.in.tkey
+copy_setports ns10/named.conf.in ns10/named.conf.in.tkey
+if $FEATURETEST --gssapi; then
+       sed 's|@TKEY_CONFIGURATION@|tkey-gssapi-credential "DNS/ns9.example.com@EXAMPLE.COM";|' ns9/named.conf.in.tkey > ns9/named.conf
+       sed 's|@TKEY_CONFIGURATION@|tkey-gssapi-credential "DNS/ns10.example.com@EXAMPLE.COM";|' ns10/named.conf.in.tkey > ns10/named.conf
+else
+       sed 's|@TKEY_CONFIGURATION@||' ns9/named.conf.in.tkey > ns9/named.conf
+       sed 's|@TKEY_CONFIGURATION@||' ns10/named.conf.in.tkey > ns10/named.conf
+fi
+rm -f ns9/named.conf.in.tkey
+rm -f ns10/named.conf.in.tkey
 
 copy_setports verylarge.in verylarge