6 Verify that 'ctdb ip' shows the correct output.
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. Run 'ctdb ip' on one of the nodes and verify the list of IP
16 addresses displayed (cross check the result with the output of
17 'ip addr show' on the node).
18 3. Verify that colon-separated output is generated with the -Y option.
22 * 'ctdb ip' shows the list of public IPs being served by a node.
26 . ctdb_test_functions.bash
32 onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
34 echo "Getting list of public IPs..."
35 try_command_on_node 1 ctdb ip -n all
36 ips=$(echo "$out" | sed -e '1d')
37 colons=$(echo "$ips" | sed -e 's@^@:@' -e 's@$@:@' -e 's@ @:@')
39 while read ip pnn ; do
40 try_command_on_node $pnn "ip addr show"
41 if [ "${out/inet ${ip}\/}" != "$out" ] ; then
42 echo "GOOD: node $pnn appears to have $ip assigned"
44 echo "BAD: node $pnn does not appear to have $ip assigned"
47 done <<<"$ips" # bashism to avoid problem setting variable in pipeline.
49 [ "$testfailures" != 1 ] && echo "Looks good!"
51 cmd="ctdb -Y ip -n all | sed -e '1d'"
52 echo "Checking that \"$cmd\" produces expected output..."
54 try_command_on_node 1 "$cmd"
55 if [ "$out" = "$colons" ] ; then
56 echo "Yep, looks good!"
58 echo "Nope, it looks like this:"