]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: add wrapper helper over JSON-mode command
authorShachar Sharon <ssharon@redhat.com>
Sun, 8 Feb 2026 11:39:53 +0000 (13:39 +0200)
committerMartin Schwenke <martins@samba.org>
Fri, 20 Feb 2026 00:47:32 +0000 (00:47 +0000)
Run ctdb sub-command with '--json' flag only when code has been compiled
with json support. Otherwise, ignore the test silently.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Anoop C S <anoopcs@samba.org>
ctdb/tests/UNIT/tool/scripts/local.sh

index 618fa36cd879d851411cfca9d18cfb9d6314fd97..11b1a711bcab8e6c6934fc806a878dc5c64662c5 100644 (file)
@@ -110,3 +110,11 @@ simple_test ()
 {
        simple_test_other $test_args "$@"
 }
+
+simple_json_test ()
+{
+       if ! "$CTDB" version --json > /dev/null 2>&1; then
+               return 0
+       fi
+       simple_test "$@" --json
+}