diff options
Diffstat (limited to 'src/spdk/test/blobstore')
-rwxr-xr-x | src/spdk/test/blobstore/blob_io_wait/blob_io_wait.sh | 49 | ||||
-rwxr-xr-x | src/spdk/test/blobstore/blobstore.sh | 41 | ||||
-rw-r--r-- | src/spdk/test/blobstore/btest.out.ignore | 5 | ||||
-rw-r--r-- | src/spdk/test/blobstore/btest.out.match | 130 | ||||
-rw-r--r-- | src/spdk/test/blobstore/test.bs | 12 |
5 files changed, 237 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 00000000..b44a3525 --- /dev/null +++ b/src/spdk/test/blobstore/blob_io_wait/blob_io_wait.sh @@ -0,0 +1,49 @@ +#!/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="python $rootdir/scripts/rpc.py" +set -e + +timing_enter blob_bdev_io_wait + +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 construct_aio_bdev $testdir/aio.bdev aio0 4096 +$rpc_py construct_lvol_store aio0 lvs0 +$rpc_py construct_lvol_bdev -l lvs0 lvol0 32 + +killprocess $bdev_svc_pid + +# Minimal number of bdev io pool (128) and cache (1) +echo "[Bdev]" > $testdir/bdevperf.conf +echo "BdevIoPoolSize 128" >> $testdir/bdevperf.conf +echo "BdevIoCacheSize 1" >> $testdir/bdevperf.conf +echo "[AIO]" >> $testdir/bdevperf.conf +echo "AIO $testdir/aio.bdev aio0 4096" >> $testdir/bdevperf.conf + +$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdevperf.conf -q 128 -o 4096 -w write -t 1 +$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdevperf.conf -q 128 -o 4096 -w read -t 1 +$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 + +report_test_completion "blob_io_wait" +timing_exit bdev_io_wait diff --git a/src/spdk/test/blobstore/blobstore.sh b/src/spdk/test/blobstore/blobstore.sh new file mode 100755 index 00000000..4ae413a1 --- /dev/null +++ b/src/spdk/test/blobstore/blobstore.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +SYSTEM=`uname -s` +if [ $SYSTEM = "FreeBSD" ] ; then + echo "blobstore.sh cannot run on FreeBSD currently." + exit 0 +fi + +set -xe + +testdir=$(readlink -f $(dirname $0)) +rootdir=$(readlink -f $testdir/../..) +source $rootdir/test/common/autotest_common.sh +timing_enter blobstore + +set -e + +# 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 +$rootdir/examples/blob/cli/blobcli -c $testdir/blobcli.conf -b Nvme0n1 -T $testdir/test.bs > $testdir/btest.out +cd - + +# the tool leaves some trailing whitespaces that we need to strip out +sed -i 's/[[:space:]]*$//' $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 + +timing_exit blobstore diff --git a/src/spdk/test/blobstore/btest.out.ignore b/src/spdk/test/blobstore/btest.out.ignore new file mode 100644 index 00000000..d7aa1120 --- /dev/null +++ b/src/spdk/test/blobstore/btest.out.ignore @@ -0,0 +1,5 @@ +DPDK +EAL +CRYPTODEV + +.... diff --git a/src/spdk/test/blobstore/btest.out.match b/src/spdk/test/blobstore/btest.out.match new file mode 100644 index 00000000..62e49287 --- /dev/null +++ b/src/spdk/test/blobstore/btest.out.match @@ -0,0 +1,130 @@ +Starting DPDK 17.11.0 initialization... +[ DPDK EAL parameters: blobcli -c 0x1 --file-prefix=spdk_pid5072 ] +EAL: Probing VFIO support... +EAL: PCI device 0000:00:04.0 on NUMA socket 0 +EAL: probe driver: 8086:2f20 spdk_ioat +EAL: PCI device 0000:00:04.1 on NUMA socket 0 +EAL: probe driver: 8086:2f21 spdk_ioat +EAL: PCI device 0000:00:04.2 on NUMA socket 0 +EAL: probe driver: 8086:2f22 spdk_ioat +EAL: PCI device 0000:00:04.3 on NUMA socket 0 +EAL: probe driver: 8086:2f23 spdk_ioat +EAL: PCI device 0000:00:04.4 on NUMA socket 0 +EAL: probe driver: 8086:2f24 spdk_ioat +EAL: PCI device 0000:00:04.5 on NUMA socket 0 +EAL: probe driver: 8086:2f25 spdk_ioat +EAL: PCI device 0000:00:04.6 on NUMA socket 0 +EAL: probe driver: 8086:2f26 spdk_ioat +EAL: PCI device 0000:00:04.7 on NUMA socket 0 +CRYPTODEV: [crypto_aesni_mb] - Creating cryptodev crypto_aesni_mb + +CRYPTODEV: [crypto_aesni_mb] - Initialisation parameters - name: crypto_aesni_mb,socket id: 0, max queue pairs: 8 +$(OPT)cryptodev_aesni_mb_create() line 976: IPSec Multi-buffer library version used: 0.49.0 + +EAL: probe driver: 8086:2f27 spdk_ioat +EAL: PCI device 0000:80:04.0 on NUMA socket 1 +EAL: probe driver: 8086:2f20 spdk_ioat +EAL: PCI device 0000:80:04.1 on NUMA socket 1 +EAL: probe driver: 8086:2f21 spdk_ioat +EAL: PCI device 0000:80:04.2 on NUMA socket 1 +EAL: probe driver: 8086:2f22 spdk_ioat +EAL: PCI device 0000:80:04.3 on NUMA socket 1 +EAL: probe driver: 8086:2f23 spdk_ioat +EAL: PCI device 0000:80:04.4 on NUMA socket 1 +EAL: probe driver: 8086:2f24 spdk_ioat +EAL: PCI device 0000:80:04.5 on NUMA socket 1 +EAL: probe driver: 8086:2f25 spdk_ioat +EAL: PCI device 0000:80:04.6 on NUMA socket 1 +EAL: probe driver: 8086:2f26 spdk_ioat +EAL: PCI device 0000:80:04.7 on NUMA socket 1 +EAL: probe driver: 8086:2f27 spdk_ioat +EAL: PCI device 0000:06:00.0 on NUMA socket 0 +EAL: probe driver: 8086:953 spdk_nvme + +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 4294967296 +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 4294967297 +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: 4294967296 + 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: 4294967297 +# of clusters: 1 +# of bytes: 1048576 +# of pages: 256 +# of xattrs: 1 +xattrs: + +(0) Name:key +(0) Value: + +00000000 76 61 6c 00 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: 4294967296 + 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 00000000..dcc64861 --- /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 |