Recent updates to the test meant that it only worked with the latest
ctdb versions. This changes things so that we never bother matching
the machine readable header, just the actual data in the output. It
also takes a slightly more liberal approach in massaging the human
readable output to ensure it matches the machine readable output.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit
8a1cb5dc1ddf82f3b9cbb23e40b3914b3d5c2783)
cluster_is_healthy
echo "Getting list of public IPs..."
cluster_is_healthy
echo "Getting list of public IPs..."
-try_command_on_node -v 1 $CTDB ip -n all
+try_command_on_node -v 1 "$CTDB ip -n all | tail -n +2"
ips=$(echo "$out" | sed \
ips=$(echo "$out" | sed \
- -e 's@\].*$@:@')
-machineout1=":Public IP:Node:ActiveInterface:AvailableInterfaces:ConfiguredInterfaces:"
-machineout2=$(echo "$out" | sed \
- -e '1d' \
- -e 's@^@:@' \
- -e 's@ node\[@:@' \
- -e 's@\] active\[@:@' \
- -e 's@\] available\[@:@' \
- -e 's@\] configured\[@:@' \
- -e 's@\]$@:@')
-machineout=`echo -e "$machineout1\n$machineout2"`
+ -e 's@\].*$@@')
+machineout=$(echo "$out" | sed -r \
+ -e 's@^| |$@:@g' \
+ -e 's@[[:alpha:]]+\[@@g' \
+ -e 's@\]@@g')
while read ip pnn ; do
try_command_on_node $pnn "ip addr show"
while read ip pnn ; do
try_command_on_node $pnn "ip addr show"
[ "$testfailures" != 1 ] && echo "Looks good!"
[ "$testfailures" != 1 ] && echo "Looks good!"
-cmd="$CTDB -Y ip -n all"
+cmd="$CTDB -Y ip -n all | tail -n +2"
echo "Checking that \"$cmd\" produces expected output..."
try_command_on_node 1 "$cmd"
echo "Checking that \"$cmd\" produces expected output..."
try_command_on_node 1 "$cmd"