public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Subrata Modak <subrata@linux.vnet.ibm.com>
To: Jiri Palecek <jpalecek@web.de>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] Fixes of the tcore test
Date: Tue, 23 Jun 2009 20:18:36 +0530	[thread overview]
Message-ID: <1245768516.4860.58.camel@subratamodak.linux.ibm.com> (raw)
In-Reply-To: <200906220102.n5M12lQI021373@e35.co.us.ibm.com>

On Tue, 2009-02-17 at 23:58 +0100, Jiri Palecek wrote: 
> Hello,
> 
> these are little fixes of the tcore.sh script
> 
>  - use $BIN_DIR for auxiliary files, and $TEST_DIR as temporary
>    directory
>  - don't run "cd -" if previous "cd something" failed
>  - fixup the value of core_pattern, to replace possibly customized
>    patterns using absolute paths or not using the name "core" for
>    corefiles
>  - don't hide error messages from expect
> 
> Regards
>     Jiri Palecek
> 
> Signed-off-by: Jiri Palecek <jpalecek@web.de>

Thanks. But, arrived quite late.

Regards--
Subrata

> ---
>  testcases/misc/tcore_patch_test_suites/tcore.sh |   39 ++++++++++++++++-------
>  1 files changed, 27 insertions(+), 12 deletions(-)
> 
> diff --git a/testcases/misc/tcore_patch_test_suites/tcore.sh b/testcases/misc/tcore_patch_test_suites/tcore.sh
> index d210fa5..f087fa7 100755
> --- a/testcases/misc/tcore_patch_test_suites/tcore.sh
> +++ b/testcases/misc/tcore_patch_test_suites/tcore.sh
> @@ -19,7 +19,8 @@
>  # Test suite for the t-core kernel patch 
>  export TCID=tcore01
>  PTHREAD_DIR="/lib/i686"
> -TEST_DIR="."
> +BIN_DIR=$LTPROOT/testcases/bin/
> +TEST_DIR=$(mktemp -dt)
>  OSTYPE="redhat"
>  # Do some preparation to generate the correct core dump
>  # files
> @@ -42,6 +43,14 @@ os_check()
>  	fi
>  }
> 
> +cleanup()
> +{
> +		rm -rf $TEST_DIR
> +		[ -f /proc/sys/kernel/core_dumps_threads ] && ! [ -z "$OLD_PATTERN" ] && 
> +		echo "$OLD_PATTERN" > /proc/sys/kernel/core_dumps_threads
> +		exit $1
> +}
> +
>  prepare_dump()
>  {
>  	ulimit -c 20000000 >/dev/null 2>&1
> @@ -52,18 +61,23 @@ prepare_dump()
>  			echo "1">/proc/sys/kernel/core_dumps_threads
>  		fi
>  	fi
> +	if [ -f /proc/sys/kernel/core_pattern ]; then
> +			OLD_PATTERN=$(cat /proc/sys/kernel/core_pattern)
> +			echo 'core.%p' > /proc/sys/kernel/core_pattern
> +	fi
>  	#Recover the lipthread.so.0 lib to generate the correct
>  	#core dump file
>  	os_check
>  	if [ $OSTYPE = "redhat" ];then
> -		cd $PTHREAD_DIR
> -		if [ -f libpthread.so.0.orig ];then
> -			test=`ls -l libpthread.so.0.orig|awk '{print $11}'`
> -			if [ $test = "libpthread-0.9.so"  ];then
> -				mv libpthread.so.0.orig libpthread.so.0
> +		cd $PTHREAD_DIR && {
> +			if [ -f libpthread.so.0.orig ];then
> +				test=`ls -l libpthread.so.0.orig|awk '{print $11}'`
> +					if [ $test = "libpthread-0.9.so"  ];then
> +						mv libpthread.so.0.orig libpthread.so.0
> +					fi
>  			fi
> -		fi
> -		cd -
> +			cd -
> +		}
>  	fi
>  }
>  #Prepare for the gdb dump 
> @@ -71,7 +85,7 @@ prepare_gdb()
>  {
>  	os_check
>  	if [ $OSTYPE = "redhat" ];then
> -		cd $PTHREAD_DIR
> +		cd $PTHREAD_DIR && {
>  		if [ -f libpthread.so.0 ];then
>  			test=`ls -l libpthread.so.0|awk '{print $11}'`
>  			if [ $test = "libpthread-0.9.so"  ];then
> @@ -80,6 +94,7 @@ prepare_gdb()
>  		fi
>  		ln -s /lib/libpthread.so.0 libpthread.so.0 >/dev/null 2>&1
>  		cd -
> +    }
>  	fi
>  }
>  #Test whether the system can generate the needed core files
> @@ -91,7 +106,7 @@ Test_gen_core()
>  	if [ -f core.* ];then
>  		rm -f core.*
>  	fi
> -	pid=`$TEST_DIR/tcore |grep "consumer pid"|awk '{print $2}'|cut -d = -f 2`
> +	pid=`$BIN_DIR/tcore |grep "consumer pid"|awk '{print $2}'|cut -d = -f 2`
>  	echo -e "Test whether we can generate the needed core file"
>  	if [ -f core.* ];then
>  		echo -e "PASS"
> @@ -110,7 +125,7 @@ Test_core_file()
>  	prepare_gdb
>  	mv -f $TEST_DIR/core.* $TEST_DIR/corefile >/dev/null 2>&1
>  	echo -e "Test whether the core support bt,fpu and threads commands "
> -	expect ./tcore.exp >/dev/null 2>&1
> +	expect $BIN_DIR/tcore.exp
>  	return=$?
>  	pass=`expr $pass + $return`
>  	fail=`expr 3 - $return + $fail`
> @@ -123,7 +138,7 @@ Test_core_file
>  echo "Linux Tcore test results" > results
>  echo "Total pass fail" >>  results
>  echo "  5	$pass	$fail" >> results
> -exit $fail 
> +cleanup $fail 
> 
>  	
>  	


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

       reply	other threads:[~2009-06-23 14:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200906220102.n5M12lQI021373@e35.co.us.ibm.com>
2009-06-23 14:48 ` Subrata Modak [this message]
2009-02-17 22:58 [LTP] [PATCH] Fixes of the tcore test Jiri Palecek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1245768516.4860.58.camel@subratamodak.linux.ibm.com \
    --to=subrata@linux.vnet.ibm.com \
    --cc=jpalecek@web.de \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox