diff options
| author | Martin Schwenke <martin@meltin.net> | 2014-11-20 15:03:25 +1100 |
|---|---|---|
| committer | Martin Schwenke <martins@samba.org> | 2014-12-05 21:02:40 +0100 |
| commit | 2c4de75d8754616891e97222cfb2ec58fdd8eac2 (patch) | |
| tree | 1006cc4e286239e12eea4489aad4369912d5231b /ctdb/tests/simple | |
| parent | 55df9c86c19e261a2a384ffc4b77c596c84e53a0 (diff) | |
| download | samba-2c4de75d8754616891e97222cfb2ec58fdd8eac2.tar.gz samba-2c4de75d8754616891e97222cfb2ec58fdd8eac2.tar.xz samba-2c4de75d8754616891e97222cfb2ec58fdd8eac2.zip | |
ctdb-tests: Update integration tests to use ctdb -X
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tests/simple')
| -rwxr-xr-x | ctdb/tests/simple/11_ctdb_ip.sh | 8 | ||||
| -rwxr-xr-x | ctdb/tests/simple/12_ctdb_getdebug.sh | 12 | ||||
| -rwxr-xr-x | ctdb/tests/simple/20_delip_iface_gc.sh | 18 | ||||
| -rwxr-xr-x | ctdb/tests/simple/27_ctdb_detach.sh | 2 | ||||
| -rwxr-xr-x | ctdb/tests/simple/75_readonly_records_basic.sh | 4 |
5 files changed, 22 insertions, 22 deletions
diff --git a/ctdb/tests/simple/11_ctdb_ip.sh b/ctdb/tests/simple/11_ctdb_ip.sh index c1aec0e9bd..0e02b5e817 100755 --- a/ctdb/tests/simple/11_ctdb_ip.sh +++ b/ctdb/tests/simple/11_ctdb_ip.sh @@ -15,7 +15,7 @@ Steps: 2. Run 'ctdb ip' on one of the nodes and verify the list of IP addresses displayed (cross check the result with the output of 'ip addr show' on the node). -3. Verify that colon-separated output is generated with the -Y option. +3. Verify that pipe-separated output is generated with the -X option. Expected results: @@ -37,14 +37,14 @@ ips=$(echo "$out" | sed \ -e 's@ node\[@ @' \ -e 's@\].*$@@') machineout=$(echo "$out" | sed -r \ - -e 's@^| |$@:@g' \ + -e 's@^| |$@\|@g' \ -e 's@[[:alpha:]]+\[@@g' \ -e 's@\]@@g') if [ -z "$TEST_LOCAL_DAEMONS" ]; then while read ip pnn ; do try_command_on_node $pnn "ip addr show" - if [ "${out/inet ${ip}\/}" != "$out" ] ; then + if [ "${out/inet* ${ip}\/}" != "$out" ] ; then echo "GOOD: node $pnn appears to have $ip assigned" else echo "BAD: node $pnn does not appear to have $ip assigned" @@ -55,7 +55,7 @@ fi [ "$testfailures" != 1 ] && echo "Looks good!" -cmd="$CTDB -Y ip -n all | tail -n +2" +cmd="$CTDB -X ip -n all | tail -n +2" echo "Checking that \"$cmd\" produces expected output..." try_command_on_node 1 "$cmd" diff --git a/ctdb/tests/simple/12_ctdb_getdebug.sh b/ctdb/tests/simple/12_ctdb_getdebug.sh index 4a4926d0c6..cdd9e342e7 100755 --- a/ctdb/tests/simple/12_ctdb_getdebug.sh +++ b/ctdb/tests/simple/12_ctdb_getdebug.sh @@ -13,7 +13,7 @@ Steps: 1. Verify that the status on all of the ctdb nodes is 'OK'. 2. Get the current debug level on a node, using 'ctdb getdebug -n <node>'. -3. Verify that colon-separated output is generated with the -Y option. +3. Verify that pipe-separated output is generated with the -X option. 4. Verify that the '-n all' option shows the debug level on all nodes. Expected results: @@ -61,19 +61,19 @@ else testfailures=1 fi -colons="" +seps="" nl=" " while read line ; do - t=$(echo "$line" | sed -r -e 's@Node [[:digit:]]+ is at debug level ([[:alpha:]]+) \((-?[[:digit:]]+)\)$@:\1:\2:@') - colons="${colons}${colons:+${nl}}:Name:Level:${nl}${t}" + t=$(echo "$line" | sed -r -e 's@Node [[:digit:]]+ is at debug level ([[:alpha:]]+) \((-?[[:digit:]]+)\)$@\|\1\|\2|@') + seps="${seps}${seps:+${nl}}|Name|Level|${nl}${t}" done <<<"$getdebug_onnode" -cmd="$CTDB -Y getdebug -n all" +cmd="$CTDB -X getdebug -n all" echo "Checking that \"$cmd\" produces expected output..." try_command_on_node 1 "$cmd" -if [ "$out" = "$colons" ] ; then +if [ "$out" = "$seps" ] ; then echo "Yep, looks good!" else echo "Nope, it looks like this:" diff --git a/ctdb/tests/simple/20_delip_iface_gc.sh b/ctdb/tests/simple/20_delip_iface_gc.sh index bc43567a57..83de49595a 100755 --- a/ctdb/tests/simple/20_delip_iface_gc.sh +++ b/ctdb/tests/simple/20_delip_iface_gc.sh @@ -19,19 +19,19 @@ cluster_is_healthy ctdb_restart_when_done echo "Getting public IPs information..." -try_command_on_node -v any "$CTDB ip -v -n all -Y | tail -n +2" +try_command_on_node -v any "$CTDB ip -v -n all -X | tail -n +2" ip_info="$out" # Select the first node and find out its interfaces -test_node=$(awk -F: 'NR == 1 { print $3}' <<<"$ip_info") -ifaces=$(awk -F: -v tn=$test_node '$3 == tn { print $6 }' <<<"$ip_info" | sed 's@, @ @g' | xargs -n 1 | sort -u) +test_node=$(awk -F'|' 'NR == 1 { print $3}' <<<"$ip_info") +ifaces=$(awk -F'|' -v tn=$test_node '$3 == tn { print $6 }' <<<"$ip_info" | sed 's@, @ @g' | xargs -n 1 | sort -u) echo "Selected test node ${test_node} with interfaces: ${ifaces}" # Delete all IPs on each interface... deleting IPs from one interface # can cause other interfaces to disappear, so we need to be careful... for i in $ifaces ; do - try_command_on_node $test_node "$CTDB ifaces -Y" - info=$(awk -F: -v iface="$i" '$2 == iface { print $0 }' <<<"$out") + try_command_on_node $test_node "$CTDB ifaces -X" + info=$(awk -F'|' -v iface="$i" '$2 == iface { print $0 }' <<<"$out") if [ -z "$info" ] ; then echo "Interface ${i} missing... assuming already deleted!" @@ -41,16 +41,16 @@ for i in $ifaces ; do echo "Deleting IPs on interface ${i}, with this information:" echo " $info" - try_command_on_node $test_node "$CTDB ip -v -Y | tail -n +2" - awk -F: -v i="$i" \ + try_command_on_node $test_node "$CTDB ip -v -X | tail -n +2" + awk -F'|' -v i="$i" \ '$6 == i { print $2 }' <<<"$out" | while read ip ; do echo " $ip" try_command_on_node $test_node "$CTDB delip $ip" done - try_command_on_node $test_node "$CTDB ifaces -Y" - info=$(awk -F: -v iface="$i" '$2 == iface { print $0 }' <<<"$out") + try_command_on_node $test_node "$CTDB ifaces -X" + info=$(awk -F'|' -v iface="$i" '$2 == iface { print $0 }' <<<"$out") if [ -z "$info" ] ; then echo "GOOD: Interface ${i} has been garbage collected" diff --git a/ctdb/tests/simple/27_ctdb_detach.sh b/ctdb/tests/simple/27_ctdb_detach.sh index 108a270bd4..4b7b3b5f22 100755 --- a/ctdb/tests/simple/27_ctdb_detach.sh +++ b/ctdb/tests/simple/27_ctdb_detach.sh @@ -35,7 +35,7 @@ ctdb_restart_when_done ###################################################################### -try_command_on_node 0 "$CTDB listnodes -Y" +try_command_on_node 0 "$CTDB listnodes -X" listnodes_output="$out" numnodes=$(wc -l <<<"$listnodes_output") diff --git a/ctdb/tests/simple/75_readonly_records_basic.sh b/ctdb/tests/simple/75_readonly_records_basic.sh index 6cd2cce612..e4d5708160 100755 --- a/ctdb/tests/simple/75_readonly_records_basic.sh +++ b/ctdb/tests/simple/75_readonly_records_basic.sh @@ -113,8 +113,8 @@ check_readonly () ###################################################################### echo "Get list of nodes..." -try_command_on_node any $CTDB -Y listnodes -all_nodes=$(awk -F: '{print $2}' <<<"$out") +try_command_on_node any $CTDB -X listnodes +all_nodes=$(awk -F'|' '{print $2}' <<<"$out") ###################################################################### |
