s3: smbd: SMB2 close. If a file has delete on close, store the return info before...
[Samba.git] / ctdb / tests / simple / 04_ctdb_setvar.sh
blob5012e318cc82366218978810393fab84481431c9
1 #!/bin/bash
3 test_info()
5 cat <<EOF
6 Verify that 'ctdb setvar' works correctly.
8 Doesn't strictly follow the procedure outlines below, since it doesn't
9 pick a variable from the output of 'ctdb listvars'. However, it
10 verifies the value with 'ctdb getvar' in addition to 'ctdb listvars'.
12 Prerequisites:
14 * An active CTDB cluster with at least 2 active nodes.
16 Steps:
18 1. Verify that the status on all of the ctdb nodes is 'OK'.
19 2. Get a list of all the ctdb tunable variables, using the 'ctdb
20 listvars' command.
21 3. Set the value of one of the variables using the 'setvar' control on
22 one of the nodes. E.g. 'ctdb setvar DeterministicIPs 0'.
23 4. Verify that the 'listvars' control now shows the new value for the
24 variable.
26 Expected results:
28 * After setting a value using 'ctdb setvar', 'ctdb listvars' shows the
29 modified value of the variable.
30 EOF
33 . "${TEST_SCRIPTS_DIR}/integration.bash"
35 ctdb_test_init "$@"
37 set -e
39 cluster_is_healthy
41 # Reset configuration
42 ctdb_restart_when_done
44 var="RecoverTimeout"
46 try_command_on_node -v 0 $CTDB getvar $var
48 val="${out#*= }"
50 echo "Going to try incrementing it..."
52 incr=$(($val + 1))
54 try_command_on_node 0 $CTDB setvar $var $incr
56 echo "That seemed to work, let's check the value..."
58 try_command_on_node -v 0 $CTDB getvar $var
60 newval="${out#*= }"
62 if [ "$incr" != "$newval" ] ; then
63 echo "Nope, that didn't work..."
64 exit 1
67 echo "Look's good! Now verifying with \"ctdb listvars\""
68 try_command_on_node -v 0 "$CTDB listvars | grep '^$var'"
70 check="${out#*= }"
72 if [ "$incr" != "$check" ] ; then
73 echo "Nope, that didn't work..."
74 exit 1
77 echo "Look's good! Putting the old value back..."
78 cmd="$CTDB setvar $var $val"
79 try_command_on_node 0 $cmd