]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Add an extra conf loading test case
authorMartin Schwenke <martin@meltin.net>
Mon, 20 Aug 2018 20:55:33 +0000 (06:55 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 24 Aug 2018 08:59:22 +0000 (10:59 +0200)
This shows that config file loading continues in spite of unknown keys
if ignore_unknown is true.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/cunit/config_test_001.sh

index c0a6e89aeb246ceec7c4f945f87e463fc47743b1..bf1e589c31897dc36cf10fd60c9583524054361b 100755 (executable)
@@ -90,3 +90,23 @@ required_result 2 <<EOF
 Configuration option [section] -> "key" not defined
 EOF
 unit_test ctdb-config get section key
+
+# Confirm that an unknown key doesn't stop the rest of the file from
+# loading
+cat > "$conffile" <<EOF
+[database]
+       unknown key = 123
+
+[logging]
+       log level = debug
+EOF
+
+required_result 2 <<EOF
+Failed to load config file $conffile
+EOF
+unit_test ctdb-config validate
+
+ok <<EOF
+debug
+EOF
+unit_test ctdb-config get "logging" "log level"