]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests/packaging/interactive/watchdog.sh: updated with 'files-watchdog' config
authorAleš Mrázek <ales.mrazek@nic.cz>
Mon, 6 Jan 2025 15:23:27 +0000 (16:23 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Tue, 14 Jan 2025 09:03:29 +0000 (10:03 +0100)
tests/packaging/interactive/watchdog.sh

index 6e5e506a7d9230b83f07e1e7525e15b589eefee1..ffc76e921e65010ef5fd7cd9bc69f2801891b006 100755 (executable)
@@ -29,11 +29,31 @@ function count_reloads(){
     echo "$(journalctl -u knot-resolver.service | grep -c "Reloading of TLS certificate files has finished")"
 }
 
+# test that files watchdog is turned off
+# {{
+
+err_count=$(count_errors)
+rel_count=$(count_reloads)
+sleep 6
+
+if [ $(count_errors) -ne $err_count ] || [ $(count_reloads) -ne $rel_count ]; then
+    echo "TLS certificate files watchdog is running (should not) or other errors occurred."
+    exit 1
+fi
+
+# }}
+
+# configure TLS certificate files and turn on watchdog
+kresctl config set -p /network/tls/files-watchdog true
+if [ "$?" -ne "0" ]; then
+    echo "Could not turn on TLS certificate files watchdog."
+    exit 1
+fi
+
 # test modification
 # {{
 
 # modify certificate files with '-', it will trigger reload
-err_count=$(count_errors)
 rel_count=$(count_reloads)
 echo "-----------" >> $cert_file
 echo "-----------" >> $key_file