Commit 9f792ca0 authored by Vitaliy Mysak's avatar Vitaliy Mysak Committed by Jim Harris
Browse files

OCF: tests: add hotremove test



Add test for hotremove case for OCF bdev

Change-Id: Iaa1ee32feef50fa45be2bbf2351d9e6e9d3f2dfc
Signed-off-by: default avatarVitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/439567


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 3ec532e1
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -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