test: Refactor test programs

Change-Id: I77fec2f5f30f6fda3bda6f85ce00f1c2e7f7a9b3
This commit is contained in:
Ken Sato
2018-09-18 16:02:20 +09:00
parent c862b29d65
commit e803698618
93 changed files with 1127 additions and 2748 deletions

View File

@ -1,56 +1,13 @@
#!/bin/sh
BIN=
SBIN=
LTP=
BOOTPARAM="-c 1-7,9-15,17-23,25-31 -m 10G@0,10G@1 -r 1-7:0+9-15:8+17-23:16+25-31:24"
if [ -f ../../../config.h ]; then
str=`grep "^#define BINDIR " ../../../config.h | head -1 | sed 's/^#define BINDIR /BINDIR=/'`
eval $str
fi
if [ "x$BINDIR" = x ];then
BINDIR="$BIN"
fi
USELTP=1
USEOSTEST=0
if [ -f ../../../Makefile ]; then
str=`grep ^SBINDIR ../../../Makefile | head -1 | sed 's/ //g'`
eval $str
fi
if [ "x$SBINDIR" = x ];then
SBINDIR="$SBIN"
fi
if [ -f $HOME/ltp/testcases/bin/execve01 ]; then
LTPDIR=$HOME/ltp/testcases
fi
if [ "x$LTPDIR" = x ]; then
LTPDIR="$LTP/testcases"
fi
if [ ! -x $SBINDIR/mcstop+release.sh ]; then
echo mcstop+release: not found >&2
exit 1
fi
echo -n "mcstop+release.sh ... "
sudo $SBINDIR/mcstop+release.sh
echo "done"
if [ ! -x $SBINDIR/mcreboot.sh ]; then
echo mcreboot: not found >&2
exit 1
fi
echo -n "mcreboot.sh $BOOTPARAM ... "
sudo $SBINDIR/mcreboot.sh $BOOTPARAM
echo "done"
if [ ! -x $BINDIR/mcexec ]; then
echo mcexec: not found >&2
exit 1
fi
. ../../common.sh
tid=001
echo "*** RT_$tid start *******************************"
sudo $BINDIR/mcexec ./call_execve ./test_01.sh | tee ./RT_${tid}.txt
sudo ${MCEXEC} ./call_execve ./test_01.sh | tee ./RT_${tid}.txt
if grep "argv\[0\]: ./syml_put_args" ./RT_${tid}.txt > /dev/null 2>&1 ; then
echo "*** RT_$tid: PASSED"
else
@ -60,7 +17,7 @@ echo ""
tid=002
echo "*** RT_$tid start *******************************"
sudo $BINDIR/mcexec ./call_execve ./test_02.sh | tee ./RT_${tid}.txt
sudo ${MCEXEC} ./call_execve ./test_02.sh | tee ./RT_${tid}.txt
if grep "argv\[0\]: `pwd`/syml_put_args" ./RT_${tid}.txt > /dev/null 2>&1 ; then
echo "*** RT_$tid: PASSED"
else
@ -70,7 +27,7 @@ echo ""
tid=001
echo "*** LT_$tid start *******************************"
sudo PATH=$LTPDIR/bin:${PATH} $BINDIR/mcexec $LTPDIR/bin/execve01 2>&1 | tee ./LT_${tid}.txt
sudo PATH=${LTPBIN}:${PATH} ${MCEXEC} ${LTPBIN}/execve01 2>&1 | tee ./LT_${tid}.txt
ok=`grep TPASS LT_${tid}.txt | wc -l`
ng=`grep TFAIL LT_${tid}.txt | wc -l`
if [ $ng = 0 ]; then
@ -82,7 +39,7 @@ echo ""
tid=002
echo "*** LT_$tid start *******************************"
sudo PATH=$LTPDIR/bin:${PATH} $BINDIR/mcexec $LTPDIR/bin/execve02 2>&1 | tee ./LT_${tid}.txt
sudo PATH=${LTPBIN}:${PATH} ${MCEXEC} ${LTPBIN}/execve02 2>&1 | tee ./LT_${tid}.txt
ok=`grep TPASS LT_${tid}.txt | wc -l`
ng=`grep TFAIL LT_${tid}.txt | wc -l`
if [ $ng = 0 ]; then
@ -94,7 +51,7 @@ echo ""
tid=003
echo "*** LT_$tid start *******************************"
sudo PATH=$LTPDIR/bin:${PATH} $BINDIR/mcexec $LTPDIR/bin/execve03 2>&1 | tee ./LT_${tid}.txt
sudo PATH=${LTPBIN}:${PATH} ${MCEXEC} ${LTPBIN}/execve03 2>&1 | tee ./LT_${tid}.txt
ok=`grep TPASS LT_${tid}.txt | wc -l`
ng=`grep TFAIL LT_${tid}.txt | wc -l`
if [ $ng = 0 ]; then
@ -106,7 +63,7 @@ echo ""
tid=004
echo "*** LT_$tid start *******************************"
sudo PATH=$LTPDIR/bin:${PATH} $BINDIR/mcexec $LTPDIR/bin/execve05 20 $LTPDIR/bin/execve05 $LTPDIR/bin/execve05 4 2>&1 | tee ./LT_${tid}.txt
sudo PATH=${LTPBIN}:${PATH} ${MCEXEC} ${LTPBIN}/execve05 20 ${LTPBIN}/execve05 ${LTPBIN}/execve05 4 2>&1 | tee ./LT_${tid}.txt
ok=`grep TPASS LT_${tid}.txt | wc -l`
ng=`grep TFAIL LT_${tid}.txt | wc -l`
if [ $ng = 0 ]; then