X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=tests%2Fbugs%2Fsignals.sh;h=3c2cf941e8ae8b3c3c89c752175fb3a71cc012d1;hb=871f4456a207925fdce3df3150af3f3b263b2776;hp=a08aa9a574a73ee01b4f8d651d29a8ace49c2ea0;hpb=2bad4e1d02bd2d33de548ec8cf145999700a1aa4;p=pspp-builds.git diff --git a/tests/bugs/signals.sh b/tests/bugs/signals.sh index a08aa9a5..3c2cf941 100755 --- a/tests/bugs/signals.sh +++ b/tests/bugs/signals.sh @@ -27,9 +27,6 @@ cleanup() return ; fi rm -rf $TEMPDIR - - # Kill any remaining children of this shell - kill `ps h --ppid $$ | awk '{print $1}'` 2> /dev/null } @@ -60,41 +57,20 @@ mkdir -p $TEMPDIR cd $TEMPDIR - -activity="run program in interactive mode" -cat | $PSPP --testing-mode -o raw-ascii 2> $TEMPDIR/stderr1 > /dev/null & -thepid1=$! -if [ $? -ne 0 ] ; then no_result ; fi - -activity="run program in interactive mode 2" -cat | $PSPP --testing-mode -o raw-ascii 2> $TEMPDIR/stderr2 > /dev/null & -thepid2=$! -if [ $? -ne 0 ] ; then no_result ; fi - -# This one is a dummy. Despite the sleep command, it may not be enought -# to ensure that the preceeding pspp has actually initialised itself. -activity="run program in interactive mode 3" -cat | $PSPP --testing-mode -o raw-ascii 2> /dev/null > /dev/null & sleep 1 -thepid3=$! -if [ $? -ne 0 ] ; then no_result ; fi - -activity="sending SIGINT to pspp1" -kill -INT $thepid1 -if [ $? -ne 0 ] ; then no_result ; fi - -activity="sending SIGSEGV to pspp2" -kill -SEGV $thepid2 +activity="sending SIGINT to pspp" +echo 'host kill -INT $PPID' | $PSPP --testing-mode -o raw-ascii > /dev/null 2> $TEMPDIR/stderr1 if [ $? -ne 0 ] ; then no_result ; fi - # SIGINT should have caused a clean shutdown - activity="checking for absence of error messages 1" [ ! -s $TEMPDIR/stderr1 ] if [ $? -ne 0 ] ; then fail ; fi -# SIGSEGV should have caused an error message +activity="sending SIGSEGV to pspp" +echo 'host kill -SEGV $PPID' | $PSPP --testing-mode -o raw-ascii > /dev/null 2> $TEMPDIR/stderr2 +if [ $? -eq 0 ] ; then no_result ; fi +# SIGSEGV should have caused an error message activity="checking for error messages from pspp 2" head -8 $TEMPDIR/stderr2 > $TEMPDIR/stderr-head if [ $? -ne 0 ] ; then no_result ; fi