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,63 +1,15 @@
#!/bin/sh
BIN=
SBIN=
LTP=
USELTP=1
USEOSTEST=0
BOOTPARAM="-c 1-7,17-23,9-15,25-31 -m 10G@0,10G@1"
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
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/fork01 ]; then
LTPDIR=$HOME/ltp/testcases
fi
if [ "x$LTPDIR" = x ]; then
LTPDIR="$LTP"
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 no mcexec found >&2
exit 1
fi
. ../../common.sh
################################################################################
if [ x$LTPDIR = x ]; then
echo no LTP found >&2
exit 1
fi
for i in fork02:01 fork03:02 execve01:03 execve02:04 execve03:05 mmap12:06; do
tp=`echo $i|sed 's/:.*//'`
id=`echo $i|sed 's/.*://'`
sudo sh -c "PATH=$LTPDIR/bin:$PATH $BINDIR/mcexec $LTPDIR/bin/$tp" 2>&1 | tee $tp.txt
sudo sh -c "PATH=$LTPBIN:$PATH $MCEXEC $LTPBIN/$tp" 2>&1 | tee $tp.txt
ok=`grep TPASS $tp.txt | wc -l`
ng=`grep TFAIL $tp.txt | wc -l`
if [ $ng = 0 ]; then

View File

@ -16,10 +16,10 @@ C1039T06 mmap12
□ 実行手順
$ make test
実行できない場合は、C1039.shの以下の行を適切に書き換えた後に実行。
BIN= mcexec が存在するパス
SBIN= mcreboot.sh が存在するパス
LTP= LTP が存在するパス
McKernelのインストール先や、OSTEST, LTPの配置場所は、
$HOME/.mck_test_config を参照している
.mck_test_config は、McKernelをビルドした際に生成されるmck_test_config.sample ファイルを
$HOMEにコピーし、適宜編集する
□ 実行結果
C1039.txt 参照。