Spdk/test/blobstore/blobstore_grow/blobstore_grow.sh
yupeng c7db171c01 blobstore: add test script for blobstore grow
It launches the bdev_svc app, creates an lvstore,
then grows it twice. In the first grow, the lvstore has
no logical volume. In the second grow, the lvstore has
a logical volume.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: I21a7d3f1d2e6a6fe72e42f89023a8588391d2aba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12320
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-06-28 17:55:43 +00:00

45 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
SYSTEM=$(uname -s)
if [ $SYSTEM = "FreeBSD" ]; then
echo "blob_io_wait.sh cannot run on FreeBSD currently."
exit 0
fi
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
rpc_py="$rootdir/scripts/rpc.py"
$rootdir/test/app/bdev_svc/bdev_svc &
bdev_svc_pid=$!
trap 'killprocess $bdev_svc_pid; exit 1' SIGINT SIGTERM EXIT
waitforlisten $bdev_svc_pid
$rpc_py bdev_malloc_create --name malloc0 128 4096
$rpc_py bdev_malloc_create --name malloc1 128 4096
$rpc_py bdev_malloc_create --name malloc2 128 4096
$rpc_py bdev_raid_create --name concat0 --raid-level concat --base-bdevs malloc0 --strip-size-kb 4
$rpc_py bdev_lvol_create_lvstore --cluster-sz 4194304 --clear-method unmap concat0 lvs0 --md-pages-per-cluster-ratio 300
free_clusters=$($rpc_py bdev_lvol_get_lvstores --lvs-name lvs0 | jq -rM '.[0].free_clusters')
test $free_clusters -eq 31
$rpc_py bdev_raid_delete concat0
$rpc_py bdev_raid_create --name concat0 --raid-level concat --base-bdevs "malloc0 malloc1" --strip-size-kb 4
$rpc_py bdev_lvol_grow_lvstore -l lvs0
free_clusters=$($rpc_py bdev_lvol_get_lvstores --lvs-name lvs0 | jq -rM '.[0].free_clusters')
test $free_clusters -eq 63
$rpc_py bdev_lvol_create --lvs-name lvs0 --thin-provision --clear-method unmap lv0 8192
$rpc_py bdev_raid_delete concat0
$rpc_py bdev_raid_create --name concat0 --raid-level concat --base-bdevs "malloc0 malloc1 malloc2" --strip-size-kb 4
$rpc_py bdev_lvol_grow_lvstore -l lvs0
free_clusters=$($rpc_py bdev_lvol_get_lvstores --lvs-name lvs0 | jq -rM '.[0].free_clusters')
test $free_clusters -eq 95
bdev_cnt=$($rpc_py bdev_get_bdevs --name lvs0/lv0 | jq -rM '. | length')
test $bdev_cnt -eq 1
killprocess $bdev_svc_pid
trap - SIGINT SIGTERM EXIT