1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
samba-mirror/ctdb/tests/simple/03_ctdb_getvar.sh
Martin Schwenke a70327ce1a Delete some unstructured tests ({fetch,peristent,transaction}.sh) and
replace them with new simple tests (52_ctdb_fetch.sh,
53_ctdb_transaction.sh, 61_ctdb_persistent_safe.sh,
62_ctdb_persistent_unsafe.sh).  Remove "_simple" from some test
filenames in the simple subdirectory - that's redundant.  Always run
ctdb as $CTDB to allow $VALGRIND magic to be used.  Use pgrep/pkill to
detect/kill local daemons so those running under valgrind can be found
too - to support this, always run local daemons with the full path to
the executable.  run_tests now supports -s option to print sumamry
when done - with more and more tests, it is getting hard to follow
progress.  Sort the output of commands in 06_ctdb_getpid.sh to make
sure they compare nicely and also allow the processes' executables to
be called "memcheck" to catch those running under valgrind.  Remove
redundant calls to onnode in commands run from calls
try_command_on_node in some tests.  41_ctdb_ban.sh and
42_ctdb_unban.sh avoid banning the recmaster, since this causes the
recmaster to be reassigned and all nodes to be unbanned.  Minor
cleanups.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 33cdf3e4bcfadf8e20822ca352babf7acca16821)
2009-01-08 17:12:03 +11:00

56 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
test_info()
{
cat <<EOF
Verify that 'ctdb getvar' works correctly.
Expands on the steps below as it actually checks the values of all
variables listed by 'ctdb listvars'.
Prerequisites:
* An active CTDB cluster with at least 2 active nodes.
Steps:
1. Verify that the status on all of the ctdb nodes is 'OK'.
2. Run 'ctdb getvars <varname>' with a valid variable name (possibly
obtained via 'ctdb listvars'.
3. Verify that the command displays the correct value of the variable
(corroborate with the value shown by 'ctdb listvars'.
Expected results:
* 'ctdb getvar' shows the correct value of the variable.
EOF
}
. ctdb_test_functions.bash
ctdb_test_init "$@"
set -e
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node -v 0 "$CTDB listvars"
echo "Veryifying all variable values using \"ctdb getvar\"..."
echo "$out" |
while read var x val ; do
try_command_on_node 0 "$CTDB getvar $var"
val2=$(echo $out | sed -e 's@.*[[:space:]]@@')
if [ "$val" != "$val2" ] ; then
echo "MISMATCH on $var: $val != $val2"
exit 1
fi
done
testfailures=$?
ctdb_test_exit