numam-spdk/test/blobfs/rocksdb/rocksdb.sh
Daniel Verkamp bf2795c65d test/blobfs/rocksdb: clean before building
RocksDB's build system does not correctly generate dependencies - if
headers have been removed in the SPDK repository since the previous
build, the .d files will prevent the build from continuing.

Avoid this by cleaning up any left-over build outputs from the previous
run.

Change-Id: Ib8669273eb38c241f83e14714683693430469462
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-02 16:49:50 -07:00

43 lines
986 B
Bash
Executable File

#!/usr/bin/env bash
set -ex
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/scripts/autotest_common.sh
DB_BENCH_DIR=/usr/src/rocksdb
DB_BENCH=$DB_BENCH_DIR/db_bench
ROCKSDB_CONF=$testdir/rocksdb.conf
if [ ! -e $DB_BENCH_DIR ]; then
echo $DB_BENCH_DIR does not exist, skipping rocksdb tests
exit 0
fi
timing_enter rocksdb
timing_enter db_bench_build
pushd $DB_BENCH_DIR
git clean -x -f -d
$MAKE db_bench $MAKEFLAGS $MAKECONFIG DEBUG_LEVEL=0 SPDK_DIR=$rootdir
popd
timing_exit db_bench_build
cp $rootdir/etc/spdk/rocksdb.conf.in $ROCKSDB_CONF
$rootdir/scripts/gen_nvme.sh >> $ROCKSDB_CONF
$rootdir/test/lib/blobfs/mkfs/mkfs $ROCKSDB_CONF Nvme0n1
mkdir $output_dir/rocksdb
RESULTS_DIR=$output_dir/rocksdb USE_PERF=0 DURATION=30 NUM_KEYS=50000000 ROCKSDB_CONF=$ROCKSDB_CONF $testdir/run_tests.sh $DB_BENCH
trap 'rm -f $ROCKSDB_CONF; exit 1' SIGINT SIGTERM EXIT
trap - SIGINT SIGTERM EXIT
rm -f $ROCKSDB_CONF
timing_exit rocksdb