]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
sg/001: don't require scsi_debug
authorJohannes Thumshirn <jthumshirn@suse.de>
Fri, 23 Jun 2017 08:14:48 +0000 (10:14 +0200)
committerOmar Sandoval <osandov@fb.com>
Mon, 26 Jun 2017 20:18:40 +0000 (13:18 -0700)
Don't require scsi_debug but check if TEST_DEV is a SCSI device and use it
instead.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
tests/sg/001

index a4cfabe25ba03f944c68196698680334608ad6f5..b5a14acc821e62cdbca061c90eac5c2a8d110fc7 100755 (executable)
@@ -24,21 +24,15 @@ DESCRIPTION="try triggering a kernel GPF with 0 byte SG reads"
 QUICK=1
 
 requires() {
-       _have_src_program sg/syzkaller1 && _have_scsi_debug
+       _have_src_program sg/syzkaller1
 }
 
-test() {
+test_device() {
        echo "Running ${TEST_NAME}"
 
-       if ! _get_scsi_debug_dev; then
-               return 1
-       fi
-
        SG_DEV="/dev/$(_get_sg_from_blockdev "$SCSI_DEBUG_NAME")"
        cd "$TMPDIR" || return 1
        timeout -s INT 10s "$SRCDIR/sg/syzkaller1" "$SG_DEV"
 
-       _put_scsi_debug_dev
-
        echo "Test complete"
 }