aboutsummaryrefslogtreecommitdiff
path: root/testcases/lib
diff options
context:
space:
mode:
authorPetr Vorel <pvorel@suse.cz>2018-06-28 14:16:53 +0200
committerPetr Vorel <pvorel@suse.cz>2018-06-29 16:52:00 +0200
commitcc7d06ce374e7430876ca0b1e48cb88eb712093f (patch)
tree6a0f8c8248ccd8a72e9cba7bf43584065e140ab4 /testcases/lib
parente11b7c03609e9ca4f442f3fb1753f358bcb792c2 (diff)
tst_test.sh: Fix check for $TST_DEVICE
When tst_device acquire call fails, it outputs into stdout, therefore the content is actually help message. => Check for file presence or error exit code rather than variable not being empty. Fixes: c5ac5d712 tst_test.sh: Make use of tst_device helper Signed-off-by: Petr Vorel <pvorel@suse.cz> Acked-by: Jan Stancek <jstancek@redhat.com>
Diffstat (limited to 'testcases/lib')
-rw-r--r--testcases/lib/tst_test.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index d27b4afd6..73c238ab4 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -364,7 +364,7 @@ tst_run()
TST_DEVICE=$(tst_device acquire)
- if [ -z "$TST_DEVICE" ]; then
+ if [ ! -b "$TST_DEVICE" -o $? -ne 0 ]; then
tst_brk TBROK "Failed to acquire device"
fi