7c03ae496810b87e2f818162538da32d69d5e3d4
[metze/samba/wip.git] / ctdb / tests / simple / 28_zero_eventscripts.sh
1 #!/bin/bash
2
3 test_info()
4 {
5     cat <<EOF
6 Check that CTDB operated correctly if there are 0 event scripts
7
8 This test only does anything with local daemons.  On a real cluster it
9 has no way of updating configuration.
10 EOF
11 }
12
13 . "${TEST_SCRIPTS_DIR}/integration.bash"
14
15 ctdb_test_init "$@"
16
17 set -e
18
19 cluster_is_healthy
20
21 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
22         echo "SKIPPING this test - only runs against local daemons"
23         exit 0
24 fi
25
26 # Reset configuration
27 ctdb_restart_when_done
28
29 daemons_stop
30
31 echo "Starting CTDB with an empty eventscript directory..."
32 empty_dir=$(mktemp -d --tmpdir="$TEST_VAR_DIR")
33 ctdb_test_exit_hook_add "rmdir $empty_dir"
34 CTDB_EVENT_SCRIPT_DIR="$empty_dir" daemons_start
35
36 wait_until_ready
37
38 # If this fails to find processes then the tests fails, so look at
39 # full command-line so this will work with valgrind.  Note that the
40 # output could be generated with pgrep's -a option but it doesn't
41 # exist in older versions.
42 ps -p $(pgrep -f '\<ctdbd\>' | xargs | sed -e 's| |,|g') -o args ww
43
44 echo
45 echo "Good, that seems to work!"