1#!/usr/bin/env bash 2 3SYSTEM=$(uname -s) 4if [ $SYSTEM = "FreeBSD" ]; then 5 echo "blobstore.sh cannot run on FreeBSD currently." 6 exit 0 7fi 8 9testdir=$(readlink -f $(dirname $0)) 10rootdir=$(readlink -f $testdir/../..) 11source $rootdir/test/common/autotest_common.sh 12 13# Nvme0 target configuration 14$rootdir/scripts/gen_nvme.sh --json-with-subsystems > $testdir/blobcli.json 15 16# generate random data file for import/export diff 17dd if=/dev/urandom of=$testdir/test.pattern bs=1M count=1 18 19(cd $testdir \ 20 && $SPDK_EXAMPLE_DIR/blobcli -j $testdir/blobcli.json -b Nvme0n1 -T $testdir/test.bs > $testdir/btest.out) 21 22# the test script will import the test pattern generated by dd and then export 23# it to a file so we can compare and confirm basic read and write 24$rootdir/test/app/match/match -v $testdir/btest.out.match 25diff $testdir/test.pattern $testdir/test.pattern.blob 26 27rm -rf $testdir/btest.out 28rm -rf $testdir/blobcli.json 29rm -rf $testdir/*.blob 30rm -rf $testdir/test.pattern 31