diff options
Diffstat (limited to 'src/spdk/test/blobstore')
-rwxr-xr-x | src/spdk/test/blobstore/blob_io_wait/blob_io_wait.sh | 61 | ||||
-rwxr-xr-x | src/spdk/test/blobstore/blobstore.sh | 30 | ||||
-rw-r--r-- | src/spdk/test/blobstore/btest.out.ignore | 5 | ||||
-rw-r--r-- | src/spdk/test/blobstore/btest.out.match | 90 | ||||
-rw-r--r-- | src/spdk/test/blobstore/test.bs | 12 |
5 files changed, 198 insertions, 0 deletions
diff --git a/src/spdk/test/blobstore/blob_io_wait/blob_io_wait.sh b/src/spdk/test/blobstore/blob_io_wait/blob_io_wait.sh new file mode 100755 index 000000000..4cdca98f0 --- /dev/null +++ b/src/spdk/test/blobstore/blob_io_wait/blob_io_wait.sh @@ -0,0 +1,61 @@ +#!/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 +source $rootdir/test/nvmf/common.sh +rpc_py="$rootdir/scripts/rpc.py" + +truncate -s 64M $testdir/aio.bdev + +$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_aio_create $testdir/aio.bdev aio0 4096 +$rpc_py bdev_lvol_create_lvstore aio0 lvs0 +$rpc_py bdev_lvol_create -l lvs0 lvol0 32 + +killprocess $bdev_svc_pid + +# Minimal number of bdev io pool (128) and cache (1) +cat << EOL > $testdir/bdevperf.conf +[Bdev] +BdevIoPoolSize 128 +BdevIoCacheSize 1 +[AIO] +AIO $testdir/aio.bdev aio0 4096 +EOL + +$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdevperf.conf -q 128 -o 4096 -w write -t 5 -r /var/tmp/spdk.sock & +bdev_perf_pid=$! +waitforlisten $bdev_perf_pid +$rpc_py bdev_enable_histogram aio0 -e +sleep 2 +$rpc_py bdev_get_histogram aio0 | $rootdir/scripts/histogram.py +$rpc_py bdev_enable_histogram aio0 -d +wait $bdev_perf_pid + +$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdevperf.conf -q 128 -o 4096 -w read -t 5 -r /var/tmp/spdk.sock & +bdev_perf_pid=$! +waitforlisten $bdev_perf_pid +$rpc_py bdev_enable_histogram aio0 -e +sleep 2 +$rpc_py bdev_get_histogram aio0 | $rootdir/scripts/histogram.py +$rpc_py bdev_enable_histogram aio0 -d +wait $bdev_perf_pid + +$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdevperf.conf -q 128 -o 4096 -w unmap -t 1 + +sync +rm -rf $testdir/bdevperf.conf +rm -rf $testdir/aio.bdev +trap - SIGINT SIGTERM EXIT diff --git a/src/spdk/test/blobstore/blobstore.sh b/src/spdk/test/blobstore/blobstore.sh new file mode 100755 index 000000000..247150f5c --- /dev/null +++ b/src/spdk/test/blobstore/blobstore.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +SYSTEM=$(uname -s) +if [ $SYSTEM = "FreeBSD" ]; then + echo "blobstore.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 + +# Nvme0 target configuration +$rootdir/scripts/gen_nvme.sh > $testdir/blobcli.conf + +# generate random data file for import/export diff +dd if=/dev/urandom of=$testdir/test.pattern bs=1M count=1 + +(cd $testdir \ + && $SPDK_EXAMPLE_DIR/blobcli -c $testdir/blobcli.conf -b Nvme0n1 -T $testdir/test.bs > $testdir/btest.out) + +# the test script will import the test pattern generated by dd and then export +# it to a file so we can compare and confirm basic read and write +$rootdir/test/app/match/match -v $testdir/btest.out.match +diff $testdir/test.pattern $testdir/test.pattern.blob + +rm -rf $testdir/btest.out +rm -rf $testdir/blobcli.conf +rm -rf $testdir/*.blob +rm -rf $testdir/test.pattern diff --git a/src/spdk/test/blobstore/btest.out.ignore b/src/spdk/test/blobstore/btest.out.ignore new file mode 100644 index 000000000..8a1df3d18 --- /dev/null +++ b/src/spdk/test/blobstore/btest.out.ignore @@ -0,0 +1,5 @@ +DPDK +EAL +Working + +cryptodev_aesni_mb_create diff --git a/src/spdk/test/blobstore/btest.out.match b/src/spdk/test/blobstore/btest.out.match new file mode 100644 index 000000000..b197e22d4 --- /dev/null +++ b/src/spdk/test/blobstore/btest.out.match @@ -0,0 +1,90 @@ +Starting SPDK v19.10.1 / DPDK 19.08.0 initialization... +[ DPDK EAL parameters: blobcli --no-shconf -c 0x1 --log-level=lib.eal:6 --log-level=lib.cryptodev:5 --log-level=user1:6 --iova-mode=pa --base-virtaddr=0x200000000000 --match-allocations --file-prefix=spdk_pid1641656 ] + +SCRIPT NOW PROCESSING: -i +Init blobstore using bdev Product Name: NVMe disk +blobstore init'd: ($(XX)) + +SCRIPT NOW PROCESSING: -l bdevs + +List bdevs: + bdev Name: Nvme0n1 + bdev Product Name: NVMe disk + + +SCRIPT NOW PROCESSING: -n 1 +New blob id $(N) +blob now has USED clusters of 1 + +SCRIPT NOW PROCESSING: -p $B0 +Super Blob ID has been set. + +SCRIPT NOW PROCESSING: -n 1 +New blob id $(N) +blob now has USED clusters of 1 + +SCRIPT NOW PROCESSING: -m $B1 test.pattern +Working............................................................................................................................................................................................................................................................... +Blob import complete (from test.pattern). + +SCRIPT NOW PROCESSING: -d $B1 test.pattern.blob +Working................................................................................................................................................................................................................................................................ +File write complete (to test.pattern.blob). + +SCRIPT NOW PROCESSING: -x $B1 key val +Xattr has been set. + +SCRIPT NOW PROCESSING: -s bs +Blobstore Public Info: + Using bdev Product Name: NVMe disk + API Version: $(N) + super blob ID: $(N) + page size: $(N) + io unit size: $(N) + cluster size: 1048576 + # free clusters: $(N) + blobstore type: +00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + +Blobstore Private Info: + Metadata start (pages): $(N) + Metadata length (pages): $(N) + +SCRIPT NOW PROCESSING: -s $B1 +Blob Public Info: +blob ID: $(N) +# of clusters: 1 +# of bytes: 1048576 +# of pages: 256 +# of xattrs: 1 +xattrs: + +(0) Name:key +(0) Value: + +00000000 76 61 6c val + +Blob Private Info: +state: CLEAN +open ref count: 1 + +SCRIPT NOW PROCESSING: -r $B1 key +Xattr has been removed. + +SCRIPT NOW PROCESSING: -s bs +Blobstore Public Info: + Using bdev Product Name: NVMe disk + API Version: 3 + super blob ID: $(N) + page size: $(N) + io unit size: $(N) + cluster size: 1048576 + # free clusters: $(N) + blobstore type: +00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + +Blobstore Private Info: + Metadata start (pages): $(N) + Metadata length (pages): $(N) + +SCRIPT NOW PROCESSING: -X diff --git a/src/spdk/test/blobstore/test.bs b/src/spdk/test/blobstore/test.bs new file mode 100644 index 000000000..dcc64861d --- /dev/null +++ b/src/spdk/test/blobstore/test.bs @@ -0,0 +1,12 @@ +-i +-l bdevs +-n 1 +-p $B0 +-n 1 +-m $B1 test.pattern +-d $B1 test.pattern.blob +-x $B1 key val +-s bs +-s $B1 +-r $B1 key +-s bs |