This patch is to fix the 2 further issues apart from the patch I sent out yestoday: [PATCH] Fs_perms: Miss Installing a Binary. Fs_perms test always gives false failure. This is because in the script, it returns whatever the last "fs_perms" command returns. In the case, if "fs_perms" passes, it will return "1" (it returns whatever the expected result specificed. That is 1 here). The patch fixes it by validating the return code of every "fs_perms" command, and returns the final result at the end of the main script -- fs_perms_simpletest.sh. The other issue is that, some tests need to access files in "${LTPROOT}/testcases/bin" directory. For example, "fs_perms" and "fs_racer". As the result, if we are running the tests outside of that directory through "pan" alone, "runltp.sh" or "runltplite.sh", those tests are not running properly. The patch fixes it in both "runltp.sh" and "runltplite.sh" by changing the current working directory to the "bin" just before running "pan", and restore it back. However, the problem still exist if running those tests by "pan" alone not through either "runltp.sh" or "runltplite.sh". This patch has been tested by running the most of LTP tests through "runltp.sh" without seen any negative affect. Signed-off-by: CAI Qian <caiqian@cclom.cn>.
diff --git a/runltp b/runltp
index 1ddfdad..8626cc0 100755
--- a/runltp
+++ b/runltp
@@ -736,6 +736,9 @@
 
     echo "Running tests......."
     test_start_time=$(date)
+
+    # Some tests need to run inside the "bin" directory.
+    cd "${LTPROOT}/testcases/bin"
     ${LTPROOT}/pan/pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE
      
     if [ $? -eq 0 ]; then
@@ -747,6 +750,7 @@
       VALUE=1
       export LTP_EXIT_VALUE=1;
     fi
+    cd ..
     echo "LTP Version: $version_date"
 
     if [ "$ALT_HTML_OUT" -eq 1 ] ; then        #User wants the HTML output to be created, it then needs to be generated