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,77 +1,18 @@
#!/bin/sh
BIN=
SBIN=
LTP=
OSTEST=
USELTP=0
USEOSTEST=0
BOOTPARAM="-c 1-7,17-23,9-15,25-31 -m 10G@0,10G@1"
. ../../common.sh
if ! sudo ls /sys/kernel/debug | grep kmemleak > /dev/null 2>&1; then
echo kmemleak: not found >&2
exit 1
fi
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
fi
if [ "x$LTPDIR" = x ]; then
LTPDIR="$LTP"
fi
if [ "x$LTPDIR" != x ]; then
LTPDIR="$LTPDIR/testcases"
fi
if [ -f $HOME/ostest/bin/test_mck ]; then
OSTESTDIR=$HOME/ostest/
fi
if [ "x$OSTESTDIR" = x ]; then
OSTESTDIR="$OSTEST"
fi
if [ ! -x "$OSTESTDIR"/bin/test_mck ]; then
echo no ostest found $OSTEST >&2
exit 1
fi
TESTMCK="$OSTESTDIR/bin/test_mck"
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
################################################################################
sudo sh -c 'echo clear > /sys/kernel/debug/kmemleak'
$BINDIR/mcexec ./C1021
$MCEXEC ./C1021
sudo $SBINDIR/mcstop+release.sh
sudo sh -c 'echo scan > /sys/kernel/debug/kmemleak'
if sudo cat /sys/kernel/debug/kmemleak | tee C1021T71.kmemleak | grep 'mcctrl'; then

View File

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