diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-08-02 17:51:39 +0300 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-08-02 17:51:39 +0300 |
commit | f5c83c4a86e94377ad34ef7481b2242c5a5828d4 (patch) | |
tree | 7d1f8ba73901838fed2627cd1dbc1c7203952496 /tests/ubi-tests/runtests.sh | |
parent | 669ec176fe602a303f5fa1ea526273748c6d6f5f (diff) |
tests: ubi: clean-up runtests.sh some more
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'tests/ubi-tests/runtests.sh')
-rwxr-xr-x | tests/ubi-tests/runtests.sh | 20 |
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 |