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,69 +1,20 @@
#!/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/mcreboot.sh ]; then
echo no mcreboot found >&2
exit 1
fi
if lsmod | grep mcctrl > /dev/null 2>&1; then
sudo $SBINDIR/mcstop+release.sh
if lsmod | grep mcctrl > /dev/null 2>&1; then
echo shutdown failed >&2
exit 1
fi
fi
sudo $SBINDIR/mcreboot.sh $BOOTPARAM
if ! lsmod | grep mcctrl > /dev/null 2>&1; then
echo reboot failed >&2
exit 1
fi
if [ ! -x $BINDIR/mcexec ]; then
echo no mcexec found >&2
exit 1
fi
. ../../common.sh
################################################################################
rm -f mcexec
ln -s $BINDIR/mcexec
ln -s $MCEXEC
./C1024T01
./mcexec ./C1024T02
if [ x$LTPDIR = x ]; then
echo no LTP found >&2
exit 1
fi
for i in process_vm_readv02:03 process_vm_readv03:04 process_vm_writev02:05; do
tp=`echo $i|sed 's/:.*//'`
id=`echo $i|sed 's/.*://'`
sudo $BINDIR/mcexec $LTPDIR/bin/$tp 2>&1 | tee $tp.txt
sudo $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

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