X-Git-Url: http://git.samba.org/samba.git/?p=vlendec%2Fsamba-autobuild%2F.git;a=blobdiff_plain;f=ctdb%2Ftests%2Fsimple%2F11_ctdb_ip.sh;h=e85884541a92905299781fd0d5e0cc3c7074858e;hp=6ea1f956c31aaf7f92656bc0b062fed43520bd39;hb=47bebba8fecdfcfada81d37011eb519e574f93cd;hpb=04d896a5feece12c6576dbcf807213760dafa010 diff --git a/ctdb/tests/simple/11_ctdb_ip.sh b/ctdb/tests/simple/11_ctdb_ip.sh index 6ea1f956c31..e85884541a9 100755 --- a/ctdb/tests/simple/11_ctdb_ip.sh +++ b/ctdb/tests/simple/11_ctdb_ip.sh @@ -32,16 +32,14 @@ set -e 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 \ - -e '1d') -machineout1=":Public IP:Node:" -machineout2=$(echo "$out" | sed \ - -e '1d' \ - -e 's@^@:@' \ - -e 's@ @:@' \ - -e 's@$@:@') -machineout=`echo -e "$machineout1\n$machineout2"` + -e 's@ node\[@ @' \ + -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" @@ -55,7 +53,7 @@ done <<<"$ips" # bashism to avoid problem setting variable in pipeline. [ "$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"