# quiesce test
QUIESCE_HOOK=${TEMPDIR}/quiesce.sh
DEV=`_sudo rbd-nbd map --quiesce --quiesce-hook ${QUIESCE_HOOK} ${POOL}/${IMAGE}`
+ get_pid
-# test it does not fail if the hook does not exists
+# test it fails if the hook does not exists
test ! -e ${QUIESCE_HOOK}
-rbd snap create ${POOL}/${IMAGE}@quiesce1
+expect_false rbd snap create ${POOL}/${IMAGE}@quiesce1
_sudo dd if=${DATA} of=${DEV} bs=1M count=1 oflag=direct
# test the hook is executed
_sudo mkfs ${DEV}
mkdir ${TEMPDIR}/mnt
_sudo mount ${DEV} ${TEMPDIR}/mnt
-rbd snap create ${POOL}/${IMAGE}@quiesce5
+rbd snap create ${POOL}/${IMAGE}@quiesce3
_sudo dd if=${DATA} of=${TEMPDIR}/mnt/test bs=1M count=1 oflag=direct
_sudo umount ${TEMPDIR}/mnt
- unmap_device ${DEV}
+ unmap_device ${DEV} ${PID}
cat ${LOG_FILE}
expect_false grep 'quiesce failed' ${LOG_FILE}