From: Cyril H. <su...@li...> - 2013-11-11 16:51:07
|
The branch, master, has been updated via bfd9860c64e9b0c7bcb0cc149fae00ef3311574e (commit) via 021494d2512abdc30234dba4079c9435a81a24ec (commit) from 87f593c16f80c3f204c87de276c426aeb65c3527 (commit) - Log ----------------------------------------------------------------- commit bfd9860c64e9b0c7bcb0cc149fae00ef3311574e Author: Simon Xu <xu....@or...> Date: Fri Nov 8 09:52:15 2013 +0800 mc_cmds: Multicast ping being disabled should not fail the test Signed-off-by: Simon Xu <xu....@or...> commit 021494d2512abdc30234dba4079c9435a81a24ec Author: Simon Xu <xu....@or...> Date: Fri Nov 8 11:39:08 2013 +0800 rdist01: fix mistakes Fix the following mistakes in the script: 1) the way it gets dirname and basename of files is broken 2) ${FILES} and ${HOSTS} get substituted when generating distfile 3) the way it calculates sum of files on RHOST is broken 4) there is no $DIRECTORIES variable Signed-off-by: Simon Xu <xu....@or...> ----------------------------------------------------------------------- Summary of changes: testcases/network/multicast/mc_cmds/mc_cmds | 3 ++- testcases/network/tcp_cmds/rdist/rdist01 | 24 +++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/testcases/network/multicast/mc_cmds/mc_cmds b/testcases/network/multicast/mc_cmds/mc_cmds index e9b7bb5..d27f669 100755 --- a/testcases/network/multicast/mc_cmds/mc_cmds +++ b/testcases/network/multicast/mc_cmds/mc_cmds @@ -127,7 +127,8 @@ for eth in $IFNAME cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts | grep 1 > /dev/null if [ $? -eq 0 ] then - end_testcase "Multicast ping disabled on this system (this is normal on post year:2005 kernels)" + tst_resm TCONF "Multicast ping disabled on this system (this is normal on post year:2005 kernels)" + exit 0 fi # Do the ping tests: Execute ping 224.0.0.1 - Verify that the proper diff --git a/testcases/network/tcp_cmds/rdist/rdist01 b/testcases/network/tcp_cmds/rdist/rdist01 index 9e30492..4bc239f 100755 --- a/testcases/network/tcp_cmds/rdist/rdist01 +++ b/testcases/network/tcp_cmds/rdist/rdist01 @@ -63,8 +63,8 @@ do_setup() done for i in $FILES; do - BASE=${i##*/} - DIR=${%%/*} + BASE=$(basename "$i") + DIR=$(dirname "$i") test -d "$DIR" || mkdir -p "$DIR" if [ $? -ne 0 ] ; then end_testcase "failed to create $DIR" @@ -94,7 +94,7 @@ create_distfile() { T_FILES="FILES = ( " for i in $FILES; do - if [ "${i%%*/}" = "." ]; then + if [ $(dirname "$i") == "." ]; then T_FILES="$T_FILES $i" else T_FILES="$T_FILES $DIR" @@ -105,7 +105,7 @@ create_distfile() T_HOST="HOSTS = (" for c_ruser in $RUSERS; do for c_rhost in $HOSTS; do - T_HOST=$T_HOST"$c_ruser@$c_rhost " + T_HOST=$T_HOST" $c_ruser@$c_rhost" done done @@ -113,7 +113,7 @@ create_distfile() cat <<EOF > "$TCtmp/distfile" $T_HOST $T_FILES -${FILES} -> ${HOSTS} +\${FILES} -> \${HOSTS} EOF } @@ -130,17 +130,15 @@ check_result() cd $TCtmp for c_rhost in $HOSTS; do for c_ruser in $RUSERS; do - TOTAL_SUM=`rsh -n -l $c_ruser $c_rhost \ - x=0; SUM=\$(sum -s $FILES|awk '{ print \$1 }') - for i in \$SUM; do - x=\$(( \$x + \$i )) + TOTAL_SUM=0 + for i in $(rsh -n -l $c_ruser $c_rhost sum -s $FILES | awk '{ print $1 }'); do + TOTAL_SUM=$(( $TOTAL_SUM + $i )) done - echo \$x` - if [ $TOTAL_SUM = $LSUM ]; then + if [ $TOTAL_SUM -eq $LSUM ]; then tst_resm TINFO "Success rdist in $c_ruser@$c_rhost " - rsh -n -l $c_ruser $c_rhost "rm -rf $FILES $DIRECTORIES" + rsh -n -l $c_ruser $c_rhost "rm -rf $FILES" else - end_testcase "Wrong sum doing rdist in $curr_ruser@$curr_rhost" + end_testcase "Wrong sum doing rdist in $curr_ruser@$curr_rhost" fi done done hooks/post-receive -- ltp |