Commit b734189a authored by Tomasz Zawadzki's avatar Tomasz Zawadzki Committed by Jim Harris
Browse files

test/blobstore: use malloc instead of NVMe for blobcli test



The test is simple enough to use a malloc bdev, this allows us to set a specific
size and block size of the device. Instead of relying on specific NVMe in the
test environment.

Change-Id: I10269bf39f34383f0c21e178983395995fbf9f43
Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@nutanix.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26549


Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Reviewed-by: default avatarJacek Kalwas <jacek.kalwas@nutanix.com>
Reviewed-by: default avatarMateusz Kozlowski <mateusz.kozlowski@solidigm.com>
parent 08e8dd5c
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -12,15 +12,20 @@ fi
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source "$rootdir/test/dd/common.sh"

# Nvme0 target configuration
"$rootdir/scripts/gen_nvme.sh" --json-with-subsystems -n 1 > "$testdir/blobcli.json"
# Create malloc bdev with 128MiB in size and 512B block size
declare -A method_bdev_malloc_create_0=(
	["name"]=Malloc0
	["num_blocks"]=262144
	["block_size"]=512
)

# 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 -j $testdir/blobcli.json -b Nvme0n1 -T $testdir/test.bs > $testdir/btest.out)
	&& $SPDK_EXAMPLE_DIR/blobcli -j <(gen_conf) -b Malloc0 -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
@@ -28,6 +33,5 @@ $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.json
rm -rf $testdir/*.blob
rm -rf $testdir/test.pattern
+5 −7
Original line number Diff line number Diff line
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 Name: Nvme0n1
Init blobstore using bdev Name: Malloc0
blobstore init'd: ($(XX))

SCRIPT NOW PROCESSING: -l bdevs

List bdevs:
	bdev Name: Nvme0n1
	bdev Product Name: NVMe disk
	bdev Name: Malloc0
	bdev Product Name: Malloc disk


SCRIPT NOW PROCESSING: -n 1
@@ -36,7 +34,7 @@ Xattr has been set.

SCRIPT NOW PROCESSING: -s bs
Blobstore Public Info:
	Using bdev Product Name: NVMe disk
	Using bdev Product Name: Malloc disk
	API Version: $(N)
	super blob ID: $(XX)
	md page size: $(N)
@@ -73,7 +71,7 @@ Xattr has been removed.

SCRIPT NOW PROCESSING: -s bs
Blobstore Public Info:
	Using bdev Product Name: NVMe disk
	Using bdev Product Name: Malloc disk
	API Version: 3
	super blob ID: $(XX)
	md page size: $(N)