mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
8b24cae630
* Use "#!/usr/bin/env bash" for improved portability * Drop test_info() definition and replace it with a comment The use of test_info() is pointless. * Drop call to cluster_is_healthy() This is a holdover from when the previous test would restart daemons to get things ready for a test. There was also a bug where going into recovery during the restart would sometimes cause the cluster to become unhealthy. If we really need something like this then we can add it to ctdb_test_init(). * Make order of preamble consistent Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
68 lines
1.3 KiB
Bash
Executable File
68 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Verify the operation of "ctdb listvars", "ctdb getvar", "ctdb setvar"
|
|
|
|
. "${TEST_SCRIPTS_DIR}/integration.bash"
|
|
|
|
set -e
|
|
|
|
ctdb_test_init
|
|
|
|
try_command_on_node -v 0 "$CTDB listvars"
|
|
|
|
sanity_check_output \
|
|
5 \
|
|
'^[[:alpha:]][[:alnum:]]+[[:space:]]*=[[:space:]]*[[:digit:]]+$'
|
|
|
|
echo "Verifying all variable values using \"ctdb getvar\"..."
|
|
|
|
while read var x val ; do
|
|
try_command_on_node 0 "$CTDB getvar $var"
|
|
|
|
val2="${out#*= }"
|
|
|
|
if [ "$val" != "$val2" ] ; then
|
|
echo "MISMATCH on $var: $val != $val2"
|
|
exit 1
|
|
fi
|
|
done <"$outfile"
|
|
|
|
echo "GOOD: all tunables match"
|
|
|
|
var="RecoverTimeout"
|
|
|
|
try_command_on_node -v 0 $CTDB getvar $var
|
|
|
|
val="${out#*= }"
|
|
|
|
echo "Going to try incrementing it..."
|
|
|
|
incr=$(($val + 1))
|
|
|
|
try_command_on_node 0 $CTDB setvar $var $incr
|
|
|
|
echo "That seemed to work, let's check the value..."
|
|
|
|
try_command_on_node -v 0 $CTDB getvar $var
|
|
|
|
newval="${out#*= }"
|
|
|
|
if [ "$incr" != "$newval" ] ; then
|
|
echo "Nope, that didn't work..."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Look's good! Now verifying with \"ctdb listvars\""
|
|
try_command_on_node -v 0 "$CTDB listvars | grep '^$var'"
|
|
|
|
check="${out#*= }"
|
|
|
|
if [ "$incr" != "$check" ] ; then
|
|
echo "Nope, that didn't work..."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Look's good! Putting the old value back..."
|
|
cmd="$CTDB setvar $var $val"
|
|
try_command_on_node 0 $cmd
|