summaryrefslogtreecommitdiff
path: root/tests/ubi-tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ubi-tests')
-rwxr-xr-xtests/ubi-tests/runtests.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/ubi-tests/runtests.sh b/tests/ubi-tests/runtests.sh
index 5bd9baa..a69a9bf 100755
--- a/tests/ubi-tests/runtests.sh
+++ b/tests/ubi-tests/runtests.sh
@@ -1,20 +1,30 @@
#!/bin/sh -euf
-ubidev="$1"
tests="mkvol_basic mkvol_bad mkvol_paral rsvol io_basic io_read io_update io_paral volrefcnt"
fatal()
{
- echo "Error: $1" 2>&1
+ echo "Error: $1" 1>&2
exit 1
}
-if [ -z "$ubidev" ]; then
- echo "Usage:" 2>&1
- echo "$0 <UBI device>"
+usage()
+{
+ cat 1>&2 <<EOF
+Run all UBI tests for on an UBI device.
+Usage:
+ ${0##*/} <UBI device node>
+Example:
+ ${0##*/} /dev/ubi1 - test /dev/ubi1.
+EOF
+}
+
+if [ "$#" -lt 1 ]; then
+ usage
exit 1
fi
+ubidev="$1"
[ -c "$ubidev" ] || fatal "$ubidev is not character device"
for t in $tests; do