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 an existing process
20 3. Run 'ctdb process-exists <pid>' on the node and verify that the
21 correct output is shown.
22 4. Run 'ctdb process-exists <pid>' with a pid of a non-existent
23 process and verify that the correct output is shown.
27 * 'ctdb process-exists' shows the correct output.
31 . ctdb_test_functions.bash
37 onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
41 # Create a background process on $test_node that will last for 60 seconds.
42 # It should still be there when we check.
43 try_command_on_node $test_node 'sleep 60 >/dev/null 2>&1 & echo $!'
46 echo "Checking for PID $pid on node $test_node"
47 # set -e is good, but avoid it here
49 onnode 0 "$CTDB process-exists ${test_node}:${pid}" || status=$?
52 if [ $status -eq 0 ] ; then
59 # Now just echo the PID of the shell from the onnode process on node
60 # 2. This PID will disappear and PIDs shouldn't roll around fast
61 # enough to trick the test... but there is a chance that will happen!
62 try_command_on_node $test_node 'echo $$'
65 echo "Checking for PID $pid on node $test_node"
66 # set -e is good, but avoid it here
68 onnode 0 "$CTDB process-exists ${test_node}:${pid}" || status=$?
71 if [ $status -ne 0 ] ; then