Files
mckernel/test/issues/1176/C1176.sh
Dominique Martinet 60011718d2 add common test framework
Add new file with common functions for tests to use.

 - loads config file
 - checks for mcexec etc
 - checks for LTP and OSTEST if required
 - handle mcstop / mcreboot if required, and provide function for it

At the same time, make a few changes to mck_test_config:
 - move to ~/.mck_test_config
 - add boot params to the config, tests the require specific params can
   overwite it
 - make the config "set-if-variable-is-empty", so someone can overwrite
   any param by setting the environment value e.g. LTP=.... ./test.sh
   will use the value given

Change-Id: Ib04112043e3eb89615dc7afaa8842a98571fab93
2018-09-14 03:30:06 +00:00

31 lines
662 B
Bash

#!/bin/sh
USELTP=1
USEOSTEST=1
. ../../common.sh
"$MCEXEC" "$TESTMCK" -s getrusage -n 2 2>&1 | tee C1176T01.txt
if grep "RESULT: you need check rusage value" C1176T01.txt > /dev/null 2>&1;then
echo "*** C1176T01: OK"
else
echo "*** C1176T01: NG"
fi
"$MCEXEC" ./C1176T02
"$MCEXEC" ./C1176T03
"$MCEXEC" ./C1176T04
for i in kill01:05 kill12:06 pause02:07 sigaction01:08 ; do
tp=`echo $i|sed 's/:.*//'`
id=`echo $i|sed 's/.*://'`
$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
echo "*** C1176T$id: $tp OK ($ok)"
else
echo "*** C1176T$id: $tp NG (ok=$ok ng=%ng)"
fi
done