xfstests: test for scsi_debug before trying to rmmod it
PATCH 1/1 xfstests: test for scsi_debug before trying to rmmod it
_cleanup does _put_scsi_debug_dev but there's a chance the module has already been removed in the non-error case.
If it's not loaded, don't try to rmmod it.
---
common.scsi_debug +1 -0
@@ -58,5 +58,6 @@ _get_scsi_debug_dev() _put_scsi_debug_dev() { sleep 1 + grep -q scsi_debug /proc/modules || return rmmod scsi_debug || _fail "Could not remove scsi_debug module" }
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 1/1 xfstests: clean up scsi_debug module handling
2 little fixes to common scsi_debug handling.
* don't consider the scsi_debug module in use in _require, unless it can't be rmmod'd
* don't try to rmmod it in _put unless it is currently loaded
---
Argh.
common.scsi_debug +2 -1
@@ -26,7 +26,7 @@ _require_scsi_debug() { # make sure we have the module and it's not already used modinfo scsi_debug 2>&1 > /dev/null || _notrun "scsi_debug module not found" - lsmod | grep -wq scsi_debug && _notrun "scsi_debug module in use" + lsmod | grep -wq scsi_debug && (rmmod scsi_debug || _notrun "scsi_debug module in use") # make sure it has the features we need # logical/physical sectors plus unmap support all went in together modinfo scsi_debug | grep -wq sector_size || _notrun "scsi_debug too old"
@@ -58,5 +58,6 @@ _get_scsi_debug_dev() _put_scsi_debug_dev() { sleep 1 + lsmod | grep -wq scsi_debug || return rmmod scsi_debug || _fail "Could not remove scsi_debug module" }
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH V2] xfstests: clean up scsi_debug module handling
Hey Eric,
Quoted 8 lines · Eric Sandeen
2 little fixes to common
scsi_debughandling.* don't consider the
scsi_debugmodule in use in_require, unless it can't be rmmod'd
* don't try to rmmod it in_putunless it is currently loadedSigned-off-by Eric Sandeen <[email protected]>
This looks good to me.
Quoted 25 lines
---
Argh.
common.scsi_debug +2
-1@@ -26,7 +26,7 @@ _require_scsi_debug() { # make sure we have the module and it's not already used modinfo scsi_debug 2>&1 > /dev/null || _notrun "scsi_debug module not found" - lsmod | grep -wq scsi_debug && _notrun "scsi_debug module in use" + lsmod | grep -wq scsi_debug && (rmmod scsi_debug || _notrun "scsi_debug module in use") # make sure it has the features we need # logical/physical sectors plus unmap support all went in together modinfo scsi_debug | grep -wq sector_size || _notrun "scsi_debug too old"@@ -58,5 +58,6 @@ _get_scsi_debug_dev() _put_scsi_debug_dev() { sleep 1 + lsmod | grep -wq scsi_debug || return rmmod scsi_debug || _fail "Could not remove scsi_debug module" }
Quoted 4 lines
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs