diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-05-04 21:00:46 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-05-04 21:00:46 +0300 |
commit | 80cecea79cf13075d136e73067aa40439539bb0f (patch) | |
tree | f28acc5b3a124c3a7355f77ccdbad48753f55872 /ubi-utils/tests/runtests.sh | |
parent | 726ac243f051f0daee6149db66ac21ba621fb454 (diff) | |
parent | 22f90673165489fd50c893a91051a79c1b143d2a (diff) |
Merge branch 'ubi'
Diffstat (limited to 'ubi-utils/tests/runtests.sh')
-rwxr-xr-x | ubi-utils/tests/runtests.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/ubi-utils/tests/runtests.sh b/ubi-utils/tests/runtests.sh new file mode 100755 index 0000000..f993bc0 --- /dev/null +++ b/ubi-utils/tests/runtests.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +ubidev="$1" +ubiloadcmd="$2" +tests="mkvol_basic mkvol_bad mkvol_paral rsvol io_basic io_read io_update io_paral" + +if test -z "$ubidev" || test -z "$ubiloadcmd"; +then + echo "Usage:" + echo "$0 <UBI device> <ubi module load command>" + exit 1 +fi + +ubiname=`echo $ubidev | cut -d/ -f3` + +major=`cat /sys/class/ubi/$ubiname/dev | cut -d: -f1` + +for minor in `seq 0 4`; do + if test ! -e ${ubidev}_${minor} ; + then + mknod ${ubidev}_${minor} c $major $(($minor + 1)) + fi +done + +if ! test -c "$ubidev"; +then + echo "Error: $ubidev is not character device" + exit 1 +fi + +for t in `echo $tests`; +do + echo "Running $t $ubidev" + "./$t" "$ubidev" || exit 1 +done + +./integ "$ubiloadcmd" || exit 1 + +echo SUCCESS + +exit 0 |