From: Subrata M. <su...@li...> - 2010-06-28 11:52:30
|
Hi, The recently introduced option: -K DMESG_LOG_DIR Log Kernel messages generated for each test cases inside this directory, when used will generate huge no. of files inside the DMESG_DIR. Many of them will be ZERO size as we do not expect KERNEL MESSAGE to be generated against all the LTP TESTS that we will run. It is better to prune them, and let only those files exist which will have real entries. The following patch fixes the same. Signed-off-by: Subrata Modak <su...@li...>, --- --- ltp/runltp.orig 2010-06-28 10:02:42.000000000 +0530 +++ ltp/runltp 2010-06-28 10:21:04.000000000 +0530 @@ -858,6 +858,30 @@ main() cd .. echo "LTP Version: $version_date" + # DMESG_DIR will contain hell lot of files which will not have any entry + # since kernel message(s) will not be generated for every test. The zero size + # files will clog the directory. Lets keep only those fules which have real + # kernel message entries. If DMESG_DIR directroy is empty after test run, it + # will indicate that no kernel message was generated during test run + + if [ $ALT_DMESG_OUT -eq 1 ] ; then + PWD=`pwd` + cd $DMESG_DIR + for dmesg_file in `ls` + do + dmesg_file_size=`wc -c $dmesg_file | cut -d ' ' -f1 | tr -d '\n'` + if [ $dmesg_file_size -eq 0 ]; then + rm -rf $dmesg_file + fi + done + cd $PWD + fi + if [ `ls -l $DMESG_DIR | wc -l` -ge 1 ]; then + echo "Kernel messages were generated for LTP tests $version_date" + else + echo "No Kernel messages were generated for LTP tests $version_date" + fi + if [ "$ALT_HTML_OUT" -eq 1 ] ; then #User wants the HTML output to be created, it then needs to be generated export LTP_VERSION=$version_date export TEST_START_TIME=$test_start_time --- Regards-- Subrata |