OCF: tests: add hotremove test

Add test for hotremove case for OCF bdev

Change-Id: Iaa1ee32feef50fa45be2bbf2351d9e6e9d3f2dfc
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/439567
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Vitaliy Mysak 2019-01-18 02:59:27 +00:00 committed by Jim Harris
parent 3ec532e1f7
commit 9f792ca0dc

View File

@ -51,6 +51,27 @@ if bdev_check_claimed Malloc0 && bdev_check_claimed Malloc1; then
exit 1
fi
$rpc_py construct_ocf_bdev HotCache wt Malloc0 Malloc1
if ! (bdev_check_claimed Malloc0 && bdev_check_claimed Malloc1); then
>&2 echo "Base devices expected to be claimed now"
exit 1
fi
$rpc_py delete_malloc_bdev Malloc0
if bdev_check_claimed Malloc1; then
>&2 echo "Base device is not expected to be claimed now"
exit 1
fi
status=$($rpc_py get_bdevs)
gone=$(echo $status | jq 'map(select(.name == "HotCache")) == []')
if [[ $gone == false ]]; then
>&2 echo "OCF bdev is expected to unregister"
exit 1
fi
# check if shutdown of running CAS bdev is ok
$rpc_py construct_ocf_bdev PartCache wt NonExisting Malloc1