summaryrefslogtreecommitdiff
path: root/tests/ubi-tests/runtests.sh
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-20 17:34:55 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-20 17:34:55 +0200
commit1ba6959299cb386faf178317b21ffd61689246b5 (patch)
treeb98d5f6d9aeadeb30e2d614aa174346529ae3b27 /tests/ubi-tests/runtests.sh
parentb722adcdb1eb8d0321eb5c4112db925c815450fc (diff)
ubi-utils: move UBI tests to tests/ubi-tests/
Clean-up ubi-utils a little by moving tests to a proper place. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'tests/ubi-tests/runtests.sh')
-rwxr-xr-xtests/ubi-tests/runtests.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/ubi-tests/runtests.sh b/tests/ubi-tests/runtests.sh
new file mode 100755
index 0000000..7072e03
--- /dev/null
+++ b/tests/ubi-tests/runtests.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+ubidev="$1"
+tests="mkvol_basic mkvol_bad mkvol_paral rsvol io_basic io_read io_update
+io_paral rmvol"
+
+if test -z "$ubidev";
+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
+
+echo SUCCESS
+
+exit 0