From f5c83c4a86e94377ad34ef7481b2242c5a5828d4 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Thu, 2 Aug 2012 17:51:39 +0300 Subject: tests: ubi: clean-up runtests.sh some more Signed-off-by: Artem Bityutskiy --- tests/ubi-tests/runtests.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'tests/ubi-tests') 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 " +usage() +{ + cat 1>&2 < +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 -- cgit v1.2.3