X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fcommon.sh.in;h=57508be9fe73a90f3233991ee714ecd48a43d99c;hb=2959d94a0a53612cc1ca9ce9d17df26c3d69a513;hp=0a8399f18412de8c2c544fae4f957e7b048e4de2;hpb=325f023544bbec6a478882c442e15304ee379759;p=zfs.git diff --git a/scripts/common.sh.in b/scripts/common.sh.in index 0a8399f..57508be 100644 --- a/scripts/common.sh.in +++ b/scripts/common.sh.in @@ -1,13 +1,13 @@ #!/bin/bash # -# Common support functions for testing scripts. If a .script-config +# Common support functions for testing scripts. If a script-config # files is available it will be sourced so in-tree kernel modules and -# utilities will be used. If no .script-config can be found then the +# utilities will be used. If no script-config can be found then the # installed kernel modules and utilities will be used. basedir="$(dirname $0)" -SCRIPT_CONFIG=.script-config +SCRIPT_CONFIG=zfs-script-config.sh if [ -f "${basedir}/../${SCRIPT_CONFIG}" ]; then . "${basedir}/../${SCRIPT_CONFIG}" else @@ -39,6 +39,8 @@ sbindir=@sbindir@ ETCDIR=${ETCDIR:-/etc} DEVDIR=${DEVDIR:-/dev/disk/zpool} ZPOOLDIR=${ZPOOLDIR:-${pkglibexecdir}/zpool-config} +ZPIOSDIR=${ZPIOSDIR:-${pkglibexecdir}/zpios-test} +ZPIOSPROFILEDIR=${ZPIOSPROFILEDIR:-${pkglibexecdir}/zpios-profile} ZDB=${ZDB:-${sbindir}/zdb} ZFS=${ZFS:-${sbindir}/zfs} @@ -46,10 +48,13 @@ ZINJECT=${ZINJECT:-${sbindir}/zinject} ZPOOL=${ZPOOL:-${sbindir}/zpool} ZPOOL_ID=${ZPOOL_ID:-${bindir}/zpool_id} ZTEST=${ZTEST:-${sbindir}/ztest} +ZPIOS=${ZPIOS:-${sbindir}/zpios} COMMON_SH=${COMMON_SH:-${pkglibexecdir}/common.sh} ZFS_SH=${ZFS_SH:-${pkglibexecdir}/zfs.sh} ZPOOL_CREATE_SH=${ZPOOL_CREATE_SH:-${pkglibexecdir}/zpool-create.sh} +ZPIOS_SH=${ZPIOS_SH:-${pkglibexecdir}/zpios.sh} +ZPIOS_SURVEY_SH=${ZPIOS_SURVEY_SH:-${pkglibexecdir}/zpios-survey.sh} LDMOD=${LDMOD:-/sbin/modprobe} LSMOD=${LSMOD:-/sbin/lsmod} @@ -436,3 +441,20 @@ run_test() { skip_one_test ${TEST_NUM} "${TEST_NAME}" fi } + +wait_udev() { + local DEVICE=$1 + local DELAY=$2 + local COUNT=0 + + while [ ! -e ${DEVICE} ]; do + if [ ${COUNT} -gt ${DELAY} ]; then + return 1 + fi + + let COUNT=${COUNT}+1 + sleep 1 + done + + return 0 +}