6 Verify that 'ctdb process-exists' shows correct information.
8 The implementation is creative about how it gets PIDs for existing and
9 non-existing processes.
13 * An active CTDB cluster with at least 2 active nodes.
17 1. Verify that the status on all of the ctdb nodes is 'OK'.
18 2. On one of the cluster nodes, get the PID of a ctdb client.
19 3. Run 'ctdb process-exists <pid>' on the node and verify that the
20 correct output is shown.
21 4. Run 'ctdb process-exists <pid>' with a pid of ctdb daemon
22 process and verify that the correct output is shown.
26 * 'ctdb process-exists' shows the correct output.
30 .
"${TEST_SCRIPTS_DIR}/integration.bash"
39 srvid
=0xAE00000012345678
41 # Execute a ctdb client on $test_node that will last for 60 seconds.
42 # It should still be there when we check.
43 try_command_on_node
-v $test_node \
44 "$CTDB_TEST_WRAPPER exec dummy_client -n 10 -S ${srvid} >/dev/null 2>&1 & echo \$!"
49 if [ -n "$client_pid" ] ; then
50 onnode
$test_node kill -9 "$client_pid"
54 ctdb_test_exit_hook_add cleanup
56 echo "Waiting until PID $client_pid is registered on node $test_node"
58 wait_until
30 try_command_on_node
$test_node \
59 "$CTDB process-exists ${client_pid}" || status
=$?
62 if [ $status -eq 0 ] ; then
69 echo "Checking for PID $client_pid with SRVID $srvid on node $test_node"
71 try_command_on_node
$test_node \
72 "$CTDB process-exists ${client_pid} ${srvid}" || status
=$?
75 if [ $status -eq 0 ] ; then
82 echo "Checking for PID $client_pid with SRVID $client_pid on node $test_node"
83 try_command_on_node
-v $test_node \
84 "! $CTDB process-exists ${client_pid} ${client_pid}"
86 # Now just echo the PID of the ctdb daemon on test node.
87 # This is not a ctdb client and process-exists should return error.
88 try_command_on_node
$test_node "ctdb getpid"
91 echo "Checking for PID $pid on node $test_node"
92 try_command_on_node
-v $test_node "! $CTDB process-exists ${pid}"