blob: dd5949eec77fb53caf0a10cca6b4cdb4ad810c19 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#!/usr/bin/env bash
# Verify that 'ctdb setdebug' works as expected.
# This is a little superficial. It checks that CTDB thinks the debug
# level has been changed but doesn't actually check that logging occurs
# at the new level.
. "${TEST_SCRIPTS_DIR}/integration.bash"
set -e
ctdb_test_init
select_test_node
get_debug ()
{
# Sets: check_debug
local node="$1"
local out
try_command_on_node -v $node "$CTDB getdebug"
check_debug="$out"
}
set_and_check_debug ()
{
local node="$1"
local level="$2"
local levelstr="${3:-$level}"
echo "Setting debug level on node ${node} to ${level}."
try_command_on_node $node "$CTDB setdebug ${level}"
local check_debug
get_debug $node
if [ "$levelstr" != "$check_debug" ] ; then
die "BAD: Debug level \"$levelstr\" != \"$check_debug\"."
fi
}
get_debug $test_node
initial_debug="$check_debug"
levels="ERROR WARNING NOTICE INFO DEBUG"
for new_debug in $levels ; do
[ "$initial_debug" != "$new_debug" ] || continue
echo
set_and_check_debug $test_node "$new_debug"
done
while read new_debug i ; do
[ "$initial_debug" != "$i" ] || continue
echo
set_and_check_debug $test_node "$i" "$new_debug"
done <<EOF
ERROR 0
WARNING 1
WARNING 2
NOTICE 3
NOTICE 4
INFO 5
INFO 6
INFO 7
INFO 8
INFO 9
DEBUG 10
EOF
|