summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-02 17:51:39 +0300
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-02 17:51:39 +0300
commitf5c83c4a86e94377ad34ef7481b2242c5a5828d4 (patch)
tree7d1f8ba73901838fed2627cd1dbc1c7203952496
parent669ec176fe602a303f5fa1ea526273748c6d6f5f (diff)
tests: ubi: clean-up runtests.sh some more
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-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