Some fixes of shell scripts of tests
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Jiri Palecek
Hello,
this patch fixes some minor bugs in the code of LTP shell scripts.
- quote arguments of test(1) in some places concerning redhat detection
Quoted 6 lines
- don't execute the result of type(1), it makes no sense - even more when the output of it should be redirected
Regards
Jiri PalecekSigned-off-by Jiri Palecek <[email protected]>
Thanks.
Regards--
Subrata
Quoted 111 lines
--- testcases/commands/ade/file/file_test.sh | 2 +- testcases/commands/cron/cron_allow01 | 2 +- testcases/commands/cron/cron_deny01 | 2 +- testcases/commands/cron/cron_pos_tests.sh | 2 +- testcases/commands/mail/mail_tests.sh | 2 +- testcases/commands/su/su01 | 6 +++--- testcases/network/tcp_cmds/rdist/rdist01 | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-)testcases/commands/ade/file/file_test.sh +1
-1@@ -474,7 +474,7 @@ export TCID=file09 export TST_COUNT=9 $LTPBIN/tst_resm TINFO "TEST #9: file command recognizes RPM files" -`type rpm &> /dev/null` +type rpm > /dev/null 2>&1 if [ $? = 0 ]; then bDIR=$(rpm --eval "%{_topdir}") bCMD=rpmbuildtestcases/commands/cron/cron_allow01 +1
-1@@ -29,7 +29,7 @@ iam=`whoami` tvar=${MACHTYPE%-*} tvar=${tvar#*-} -if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] +if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ] then CRON_ALLOW="/etc/cron.allow" elsetestcases/commands/cron/cron_deny01 +1
-1@@ -29,7 +29,7 @@ iam=`whoami` tvar=${MACHTYPE%-*} tvar=${tvar#*-} -if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] +if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ] then CRON_DENY="/etc/cron.deny" CRON_ALLOW="/etc/cron.allow"testcases/commands/cron/cron_pos_tests.sh +1
-1@@ -7,7 +7,7 @@ iam=`whoami` tvar=${MACHTYPE%-*} tvar=${tvar#*-} -if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] +if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ] then CRON_ALLOW="/etc/cron.allow" elsetestcases/commands/mail/mail_tests.sh +1
-1@@ -60,7 +60,7 @@ export TCID=SETUP export TST_COUNT=1 MAIL_NOT_INSTALLED= -`type mail &> /dev/null` +type mail > /dev/null 2>&1 if [ $? != 0 ]; then MAIL_NOT_INSTALLED=1 fitestcases/commands/su/su01 +3
-3@@ -43,7 +43,7 @@ tvar=${tvar#*-} export tvar printf "Machine type is: $tvar\n\n" -if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] +if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ] # Need to also set group for TEST_USER2 then export TEST_USER1_GROUP="wheel"@@ -99,7 +99,7 @@ rm -f $TEST_ENV_FILE > /dev/null 2>&1 #create users home directory (SLES 8 does not do this, even when specified in adduser) # Only do this if not RH; RH creates the directory. - if [ $tvar != "redhat" -a $tvar != "redhat-linux" ] + if [ "$tvar" != "redhat" -a "$tvar" != "redhat-linux" ] then { USER_UID=`id -u $TEST_USER1` USER_GID=`id -g $TEST_USER1`@@ -135,7 +135,7 @@ rm -f $TEST_ENV_FILE > /dev/null 2>&1 #create users home diretory (SLES 8 does not do this, even when specified in adduser) # Only do this if not RH; RH creates the directory. - if [ $tvar != "redhat" -a $tvar != "redhat-linux" ] + if [ "$tvar" != "redhat" -a "$tvar" != "redhat-linux" ] then { USER_UID=`id -u $TEST_USER2` USER_GID=`id -g $TEST_USER2`testcases/network/tcp_cmds/rdist/rdist01 +0
-0
testcases/network/tcp_cmds/rdist/rdist01 check_result() · line 181
Quoted 8 lines
testcases/network/tcp_cmds/rdist/rdist01 +1
-1@@ -175,7 +175,7 @@ check_result() x=\$(( \$x + \$i )) done echo \$x` - if [ $TOTAL_SUM = $LSUM ]; then + if [ "$TOTAL_SUM" = "$LSUM" ]; then tst_resm TINFO "Success rdist in $c_ruser@$c_rhost " rsh -n -l $c_ruser $c_rhost "rm -rf $FILES $DIRECTORIES" else
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list