diff mbox

[blktests] sg/001: don't require scsi_debug

Message ID 20170623081448.8121-1-jthumshirn@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Johannes Thumshirn June 23, 2017, 8:14 a.m. UTC
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 | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Omar Sandoval June 26, 2017, 8:19 p.m. UTC | #1
On Fri, Jun 23, 2017 at 10:14:48AM +0200, Johannes Thumshirn wrote:
> 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 | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/sg/001 b/tests/sg/001
> index a4cfabe25ba0..fc883ebd1c8a 100755
> --- a/tests/sg/001
> +++ b/tests/sg/001
> @@ -24,13 +24,13 @@ 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
> +	if ! _test_dev_is_scsi; then
>  		return 1
>  	fi

Since we already check this in tests/sg/group, we don't need this bit.
Got rid of it and applied, thanks, Johannes!

> @@ -38,7 +38,5 @@ test() {
>  	cd "$TMPDIR" || return 1
>  	timeout -s INT 10s "$SRCDIR/sg/syzkaller1" "$SG_DEV"
>  
> -	_put_scsi_debug_dev
> -
>  	echo "Test complete"
>  }
> -- 
> 2.12.3
>
diff mbox

Patch

diff --git a/tests/sg/001 b/tests/sg/001
index a4cfabe25ba0..fc883ebd1c8a 100755
--- a/tests/sg/001
+++ b/tests/sg/001
@@ -24,13 +24,13 @@  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
+	if ! _test_dev_is_scsi; then
 		return 1
 	fi
 
@@ -38,7 +38,5 @@  test() {
 	cd "$TMPDIR" || return 1
 	timeout -s INT 10s "$SRCDIR/sg/syzkaller1" "$SG_DEV"
 
-	_put_scsi_debug_dev
-
 	echo "Test complete"
 }