* [LTP] [PATCH 1/2] ltpstress.sh: added cmdline option to set temporary directory
@ 2014-03-11 13:04 Stanislav Kholmanskikh
2014-03-11 13:04 ` [LTP] [PATCH 2/2] ltpstress.sh: explicit passing of -p and -q ltp-pan parameters Stanislav Kholmanskikh
2014-03-27 13:38 ` [LTP] [PATCH 1/2] ltpstress.sh: added cmdline option to set temporary directory chrubis
0 siblings, 2 replies; 4+ messages in thread
From: Stanislav Kholmanskikh @ 2014-03-11 13:04 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
testscripts/ltpstress.sh | 35 ++++++++++++++++++++++-------------
1 file changed, 22 insertions(+), 13 deletions(-)
diff --git a/testscripts/ltpstress.sh b/testscripts/ltpstress.sh
index 49fc5a2..d87148d 100755
--- a/testscripts/ltpstress.sh
+++ b/testscripts/ltpstress.sh
@@ -35,8 +35,6 @@ if [ $? -eq 0 ]; then
cd ..
export LTPROOT=${PWD}
fi
-export TMPBASE="/tmp"
-export TMP="${TMPBASE}/ltpstress-$$"
export PATH=$LTPROOT/testcases/bin:$PATH
memsize=0
hours=24
@@ -57,7 +55,7 @@ usage()
{
cat <<-END >&2
- usage: ${0##*/} [ -d datafile ] [ -i # (in seconds) ] [ -I iofile ] [ -l logfile ] [ -m # (in Mb) ] [ -n ] [ -t duration ] [ [-S]|[-T] ]
+ usage: ${0##*/} [ -d datafile ] [ -i # (in seconds) ] [ -I iofile ] [ -l logfile ] [ -m # (in Mb) ] [ -n ] [ -t duration ] [ -x TMPDIR ] [ [-S]|[-T] ]
-d datafile Data file for 'sar' or 'top' to log to. Default is "/tmp/ltpstress.data".
-i # (in sec) Interval that 'sar' or 'top' should take snapshots. Default is 10 seconds.
@@ -68,6 +66,7 @@ usage()
-S Use 'sar' to measure data.
-T Use LTP's modified 'top' tool to measure data.
-t duration Execute the testsuite for given duration in hours. Default is 24.
+ -x TMPDIR Directory where temporary files will be created.
example: ${0##*/} -d /tmp/sardata -l /tmp/ltplog.$$ -m 128 -t 24 -S
END
@@ -84,16 +83,7 @@ check_memsize()
leftover_memsize=$memsize
}
-
-mkdir -p ${TMP}
-
-cd ${TMP}
-if [ $? -ne 0 ]; then
- echo "could not cd ${TMP} ... exiting"
- exit
-fi
-
-while getopts d:hi:I:l:STt:m:n\? arg
+while getopts d:hi:I:l:STt:m:nx:\? arg
do case $arg in
d) datafile="$OPTARG";;
@@ -137,11 +127,30 @@ do case $arg in
t) hours=$OPTARG
duration=$(($hours * 60 * 60));;
+ x) export TMPBASE=$(readlink -f ${OPTARG});;
+
\?) echo "Help info:"
usage;;
esac
done
+export TMP="${TMPBASE}/ltpstress-$$"
+export TMPDIR=${TMP}
+mkdir -p ${TMP}
+
+# to write as user nobody into tst_tmpdir()
+chmod 777 $TMP || \
+{
+ echo "unable to chmod 777 $TMP ... aborting"
+ exit 1
+}
+
+cd $TMP || \
+{
+ echo "could not cd ${TMP} ... exiting"
+ exit 1
+}
+
if [ $NO_NETWORK -eq 0 ];then
# Networking setup
echo `hostname` >> /root/.rhosts
--
1.7.9.5
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 4+ messages in thread* [LTP] [PATCH 2/2] ltpstress.sh: explicit passing of -p and -q ltp-pan parameters
2014-03-11 13:04 [LTP] [PATCH 1/2] ltpstress.sh: added cmdline option to set temporary directory Stanislav Kholmanskikh
@ 2014-03-11 13:04 ` Stanislav Kholmanskikh
2014-03-27 13:39 ` chrubis
2014-03-27 13:38 ` [LTP] [PATCH 1/2] ltpstress.sh: added cmdline option to set temporary directory chrubis
1 sibling, 1 reply; 4+ messages in thread
From: Stanislav Kholmanskikh @ 2014-03-11 13:04 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Added cmdline options to pass -p and/or -q arguments to the
ltp-pan instances. The same way as runltp does.
It's needed if we parse the output of the ltp-pans by scripts.
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
testscripts/ltpstress.sh | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/testscripts/ltpstress.sh b/testscripts/ltpstress.sh
index d87148d..681b8b0 100755
--- a/testscripts/ltpstress.sh
+++ b/testscripts/ltpstress.sh
@@ -49,13 +49,15 @@ Sar=0
Top=0
Iostat=0
LOGGING=0
+PRETTY_PRT=""
+QUIET_MODE=""
NO_NETWORK=0
usage()
{
cat <<-END >&2
- usage: ${0##*/} [ -d datafile ] [ -i # (in seconds) ] [ -I iofile ] [ -l logfile ] [ -m # (in Mb) ] [ -n ] [ -t duration ] [ -x TMPDIR ] [ [-S]|[-T] ]
+ usage: ${0##*/} [ -d datafile ] [ -i # (in seconds) ] [ -I iofile ] [ -l logfile ] [ -m # (in Mb) ] [ -n ] [ -p ] [ -q ] [ -t duration ] [ -x TMPDIR ] [ [-S]|[-T] ]
-d datafile Data file for 'sar' or 'top' to log to. Default is "/tmp/ltpstress.data".
-i # (in sec) Interval that 'sar' or 'top' should take snapshots. Default is 10 seconds.
@@ -63,6 +65,8 @@ usage()
-l logfile Log results of test in a logfile. Default is "/tmp/ltpstress.log"
-m # (in Mb) Specify the _minimum_ memory load of # megabytes in background. Default is all the RAM + 1/2 swap.
-n Disable networking stress.
+ -p Human readable format logfiles.
+ -q Print less verbose output to the output files.
-S Use 'sar' to measure data.
-T Use LTP's modified 'top' tool to measure data.
-t duration Execute the testsuite for given duration in hours. Default is 24.
@@ -83,7 +87,7 @@ check_memsize()
leftover_memsize=$memsize
}
-while getopts d:hi:I:l:STt:m:nx:\? arg
+while getopts d:hi:I:l:STt:m:npqx:\? arg
do case $arg in
d) datafile="$OPTARG";;
@@ -104,6 +108,10 @@ do case $arg in
n) NO_NETWORK=1;;
+ p) PRETTY_PRT=" -p ";;
+
+ q) QUIET_MODE=" -q ";;
+
S) if [ $Top -eq 0 ]; then
Sar=1
else
@@ -284,9 +292,9 @@ output1=${TMPBASE}/ltpstress.$$.output1
output2=${TMPBASE}/ltpstress.$$.output2
output3=${TMPBASE}/ltpstress.$$.output3
-${LTPROOT}/bin/ltp-pan -e -p -q -S -t ${hours}h -a stress1 -n stress1 -l $logfile -f ${TMP}/stress.part1 -o $output1 &
-${LTPROOT}/bin/ltp-pan -e -p -q -S -t ${hours}h -a stress2 -n stress2 -l $logfile -f ${TMP}/stress.part2 -o $output2 &
-${LTPROOT}/bin/ltp-pan -e -p -q -S -t ${hours}h -a stress3 -n stress3 -l $logfile -f ${TMP}/stress.part3 -o $output3 &
+${LTPROOT}/bin/ltp-pan -e ${PRETTY_PRT} ${QUIET_MODE} -S -t ${hours}h -a stress1 -n stress1 -l $logfile -f ${TMP}/stress.part1 -o $output1 &
+${LTPROOT}/bin/ltp-pan -e ${PRETTY_PRT} ${QUIET_MODE} -S -t ${hours}h -a stress2 -n stress2 -l $logfile -f ${TMP}/stress.part2 -o $output2 &
+${LTPROOT}/bin/ltp-pan -e ${PRETTY_PRT} ${QUIET_MODE} -S -t ${hours}h -a stress3 -n stress3 -l $logfile -f ${TMP}/stress.part3 -o $output3 &
echo "Running LTP Stress for $hours hour(s) using $(($memsize/1024)) Mb"
echo ""
@@ -316,7 +324,12 @@ fi
rm -rf ${TMP}
echo "Testing done"
if [ $LOGGING -eq 1 ];then
- grep FAIL $logfile >/dev/null 2>&1
+ if [ ! -z $PRETTY_PRT ]; then
+ grep FAIL $logfile > /dev/null 2>&1
+ else
+ grep 'stat=' $logfile | grep -v 'stat=0' > /dev/null 2>&1
+ fi
+
if [ $? -eq 1 ]; then
echo "All Tests PASSED!"
else
--
1.7.9.5
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [LTP] [PATCH 1/2] ltpstress.sh: added cmdline option to set temporary directory
2014-03-11 13:04 [LTP] [PATCH 1/2] ltpstress.sh: added cmdline option to set temporary directory Stanislav Kholmanskikh
2014-03-11 13:04 ` [LTP] [PATCH 2/2] ltpstress.sh: explicit passing of -p and -q ltp-pan parameters Stanislav Kholmanskikh
@ 2014-03-27 13:38 ` chrubis
1 sibling, 0 replies; 4+ messages in thread
From: chrubis @ 2014-03-27 13:38 UTC (permalink / raw)
To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list
Hi!
> -export TMPBASE="/tmp"
You have removed the default value for TMPBASE so the default dir is now
/ltpstress-$$ and not /tmp/ltpstress-$$.
> -export TMP="${TMPBASE}/ltpstress-$$"
> export PATH=$LTPROOT/testcases/bin:$PATH
> memsize=0
> hours=24
> @@ -57,7 +55,7 @@ usage()
> {
>
> cat <<-END >&2
> - usage: ${0##*/} [ -d datafile ] [ -i # (in seconds) ] [ -I iofile ] [ -l logfile ] [ -m # (in Mb) ] [ -n ] [ -t duration ] [ [-S]|[-T] ]
> + usage: ${0##*/} [ -d datafile ] [ -i # (in seconds) ] [ -I iofile ] [ -l logfile ] [ -m # (in Mb) ] [ -n ] [ -t duration ] [ -x TMPDIR ] [ [-S]|[-T] ]
>
> -d datafile Data file for 'sar' or 'top' to log to. Default is "/tmp/ltpstress.data".
> -i # (in sec) Interval that 'sar' or 'top' should take snapshots. Default is 10 seconds.
> @@ -68,6 +66,7 @@ usage()
> -S Use 'sar' to measure data.
> -T Use LTP's modified 'top' tool to measure data.
> -t duration Execute the testsuite for given duration in hours. Default is 24.
> + -x TMPDIR Directory where temporary files will be created.
It's shame that -d is allready taken and we are not compatible with
runltp... but I guess we cannot do anything about it.
>
> -
> -mkdir -p ${TMP}
> -
> -cd ${TMP}
> -if [ $? -ne 0 ]; then
> - echo "could not cd ${TMP} ... exiting"
> - exit
> -fi
> -
> -while getopts d:hi:I:l:STt:m:n\? arg
> +while getopts d:hi:I:l:STt:m:nx:\? arg
> do case $arg in
>
> d) datafile="$OPTARG";;
> @@ -137,11 +127,30 @@ do case $arg in
> t) hours=$OPTARG
> duration=$(($hours * 60 * 60));;
>
> + x) export TMPBASE=$(readlink -f ${OPTARG});;
Why readlink?
The rest is fine.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-03-27 13:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-11 13:04 [LTP] [PATCH 1/2] ltpstress.sh: added cmdline option to set temporary directory Stanislav Kholmanskikh
2014-03-11 13:04 ` [LTP] [PATCH 2/2] ltpstress.sh: explicit passing of -p and -q ltp-pan parameters Stanislav Kholmanskikh
2014-03-27 13:39 ` chrubis
2014-03-27 13:38 ` [LTP] [PATCH 1/2] ltpstress.sh: added cmdline option to set temporary directory chrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox