6 Verify the operation of 'ctdb detach' command.
10 * An active CTDB cluster with at least 2 active nodes.
14 1. Verify that the status on all of the ctdb nodes is 'OK'.
15 2. Attach test databases
16 3. Detach test databases
17 4. Verify that the databases are not attached.
21 * Command 'ctdb detach' command successfully removes attached databases.
25 . "${TEST_SCRIPTS_DIR}/integration.bash"
34 ctdb_restart_when_done
36 ######################################################################
38 # Confirm that no nodes have databases attached
42 try_command_on_node all $CTDB getdbmap
43 local num_db=$(grep -c "$db" <<<"$out") || true
44 if [ $num_db -eq 0 ]; then
45 echo "GOOD: database $db is not attached any more"
47 echo "BAD: database $db is still attached"
53 ######################################################################
55 testdb1="detach_test1.tdb"
56 testdb2="detach_test2.tdb"
57 testdb3="detach_test3.tdb"
58 testdb4="detach_test4.tdb"
60 echo "Create test databases"
62 try_command_on_node 0 $CTDB attach $testdb1
64 try_command_on_node 0 $CTDB attach $testdb2
66 try_command_on_node 0 $CTDB attach $testdb3
68 try_command_on_node 0 $CTDB attach $testdb4
70 ######################################################################
72 echo "Detach single test database $testdb1"
73 try_command_on_node 1 $CTDB detach $testdb1
77 ######################################################################
79 echo "Detach multiple test databases"
80 echo " $testdb2, $testdb3, $testdb4"
81 try_command_on_node 0 $CTDB detach $testdb2 $testdb3 $testdb4