To use in the 'check' script in the following commit, move the helper
function _unload_module() from 'common/rc' to 'check'.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
$(cat "${TEST_DEV_SYSFS}/queue/zoned") != none ]]
}
+# Arguments: module to unload ($1) and retry count ($2).
+_unload_module() {
+ local i m=$1 rc=${2:-1}
+
+ [ ! -e "/sys/module/$m" ] && return 0
+ for ((i=rc;i>0;i--)); do
+ modprobe -r "$m"
+ [ ! -e "/sys/module/$m" ] && return 0
+ sleep .1
+ done
+ return 1
+}
+
_run_test() {
TEST_NAME="$1"
CAN_BE_ZONED=0
awk '{ print int($1) }' /proc/uptime
}
-# Arguments: module to unload ($1) and retry count ($2).
-_unload_module() {
- local i m=$1 rc=${2:-1}
-
- [ ! -e "/sys/module/$m" ] && return 0
- for ((i=rc;i>0;i--)); do
- modprobe -r "$m"
- [ ! -e "/sys/module/$m" ] && return 0
- sleep .1
- done
- return 1
-}
-
_have_writeable_kmsg() {
if [[ ! -w /dev/kmsg ]]; then
SKIP_REASONS+=("cannot write to /dev/kmsg")