public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] Remove files which does not have a dmesg entry
@ 2010-06-28 11:52 Subrata Modak
  2010-06-28 19:44 ` Mike Frysinger
  2010-06-28 19:53 ` Garrett Cooper
  0 siblings, 2 replies; 6+ messages in thread
From: Subrata Modak @ 2010-06-28 11:52 UTC (permalink / raw)
  To: LTP List Members; +Cc: Mike Frysinger

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 <subrata@linux.vnet.ibm.com>,
---

--- 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


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-06-28 20:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-28 11:52 [LTP] [PATCH] Remove files which does not have a dmesg entry Subrata Modak
2010-06-28 19:44 ` Mike Frysinger
2010-06-28 19:47   ` Garrett Cooper
2010-06-28 19:52     ` Mike Frysinger
2010-06-28 19:53 ` Garrett Cooper
2010-06-28 19:54   ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox