Commit 02925187 authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Tomasz Zawadzki
Browse files

test: Shellcheck - correct rule: Consider using { cmd1; cmd2; }



Correct shellcheck rule SC2129: Consider using { cmd1; cmd2; } >> file instead of individual redirects.

Signed-off-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ic692e9f78f2d3d8a3b27d702884cbe97c880727c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474959


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
parent 58164215
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -69,12 +69,14 @@ mnt_pt=${mnt_dir}/osd-device-0-data
mkdir -p ${mnt_pt}
mkfs.xfs -f /dev/disk/by-partlabel/osd-device-0-data
mount /dev/disk/by-partlabel/osd-device-0-data ${mnt_pt}
echo -e "\tosd data = ${mnt_pt}" >> "$ceph_conf"
echo -e "\tosd journal = /dev/disk/by-partlabel/osd-device-0-journal" >> "$ceph_conf"
cat << EOL >> $ceph_conf
osd data = ${mnt_pt}
osd journal = /dev/disk/by-partlabel/osd-device-0-journal

# add mon address
echo -e "\t[mon.a]" >> "$ceph_conf"
echo -e "\tmon addr = ${mon_ip}:12046" >> "$ceph_conf"
[mon.a]
mon addr = ${mon_ip}:12046
EOL

# create mon
rm -rf "${mon_dir:?}/"*
+1 −2
Original line number Diff line number Diff line
@@ -242,8 +242,7 @@ if hash shellcheck 2>/dev/null; then
	# This SHCK_EXCLUDE list is out "to do" and we work to fix all of this errors.
	SHCK_EXCLUDE="SC1083,SC2002,\
SC2010,SC2012,SC2016,SC2034,SC2045,SC2046,SC2068,SC2086,SC2089,SC2090,\
SC2097,SC2098,SC2119,SC2120,SC2128,\
SC2129"
SC2097,SC2098,SC2119,SC2120,SC2128"
	# SPDK fails some error checks which have been deprecated in later versions of shellcheck.
	# We will not try to fix these error checks, but instead just leave the error types here
	# so that we can still run with older versions of shellcheck.
+5 −3
Original line number Diff line number Diff line
@@ -62,9 +62,11 @@ function on_error_exit() {
function configure_raid_bdev() {
	rm -rf $testdir/rpcs.txt

	echo bdev_malloc_create 32 512 -b Base_1 >> $testdir/rpcs.txt
	echo bdev_malloc_create 32 512 -b Base_2 >> $testdir/rpcs.txt
	echo bdev_raid_create -z 64 -r 0 -b \"Base_1 Base_2\" -n raid0 >> $testdir/rpcs.txt
	cat <<- EOL >> $testdir/rpcs.txt
	bdev_malloc_create 32 512 -b Base_1
	bdev_malloc_create 32 512 -b Base_2
	bdev_raid_create -z 64 -r 0 -b \"Base_1 Base_2\" -n raid0
	EOL
	$rpc_py < $testdir/rpcs.txt

	rm -rf $testdir/rpcs.txt
+45 −33
Original line number Diff line number Diff line
@@ -10,9 +10,11 @@ run_step() {
		exit 1
	fi

	echo "--spdk=$ROCKSDB_CONF" >> "$1"_flags.txt
	echo "--spdk_bdev=Nvme0n1" >> "$1"_flags.txt
	echo "--spdk_cache_size=$CACHE_SIZE" >> "$1"_flags.txt
	cat <<- EOL >> "$1"_flags.txt
	--spdk=$ROCKSDB_CONF
	--spdk_bdev=Nvme0n1
	--spdk_cache_size=$CACHE_SIZE
	EOL

	echo -n Start $1 test phase...
	/usr/bin/time taskset 0xFF $DB_BENCH --flagfile="$1"_flags.txt &> "$1"_db_bench.txt
@@ -77,44 +79,54 @@ fi

cd $RESULTS_DIR
cp $testdir/common_flags.txt insert_flags.txt
echo "--benchmarks=fillseq" >> insert_flags.txt
echo "--threads=1" >> insert_flags.txt
echo "--disable_wal=1" >> insert_flags.txt
echo "--use_existing_db=0" >> insert_flags.txt
echo "--num=$NUM_KEYS" >> insert_flags.txt
cat << EOL >> insert_flags.txt
--benchmarks=fillseq
--threads=1
--disable_wal=1
--use_existing_db=0
--num=$NUM_KEYS
EOL

cp $testdir/common_flags.txt randread_flags.txt
echo "--benchmarks=readrandom" >> randread_flags.txt
echo "--threads=16" >> randread_flags.txt
echo "--duration=$DURATION" >> randread_flags.txt
echo "--disable_wal=1" >> randread_flags.txt
echo "--use_existing_db=1" >> randread_flags.txt
echo "--num=$NUM_KEYS" >> randread_flags.txt
cat << EOL >> randread_flags.txt
--benchmarks=readrandom
--threads=16
--duration=$DURATION
--disable_wal=1
--use_existing_db=1
--num=$NUM_KEYS
EOL

cp $testdir/common_flags.txt overwrite_flags.txt
echo "--benchmarks=overwrite" >> overwrite_flags.txt
echo "--threads=1" >> overwrite_flags.txt
echo "--duration=$DURATION" >> overwrite_flags.txt
echo "--disable_wal=1" >> overwrite_flags.txt
echo "--use_existing_db=1" >> overwrite_flags.txt
echo "--num=$NUM_KEYS" >> overwrite_flags.txt
cat << EOL >> overwrite_flags.txt
--benchmarks=overwrite
--threads=1
--duration=$DURATION
--disable_wal=1
--use_existing_db=1
--num=$NUM_KEYS
EOL

cp $testdir/common_flags.txt readwrite_flags.txt
echo "--benchmarks=readwhilewriting" >> readwrite_flags.txt
echo "--threads=4" >> readwrite_flags.txt
echo "--duration=$DURATION" >> readwrite_flags.txt
echo "--disable_wal=1" >> readwrite_flags.txt
echo "--use_existing_db=1" >> readwrite_flags.txt
echo "--num=$NUM_KEYS" >> readwrite_flags.txt
cat << EOL >> readwrite_flags.txt
--benchmarks=readwhilewriting
--threads=4
--duration=$DURATION
--disable_wal=1
--use_existing_db=1
--num=$NUM_KEYS
EOL

cp $testdir/common_flags.txt writesync_flags.txt
echo "--benchmarks=overwrite" >> writesync_flags.txt
echo "--threads=1" >> writesync_flags.txt
echo "--duration=$DURATION" >> writesync_flags.txt
echo "--disable_wal=0" >> writesync_flags.txt
echo "--use_existing_db=1" >> writesync_flags.txt
echo "--sync=1" >> writesync_flags.txt
echo "--num=$NUM_KEYS" >> writesync_flags.txt
cat << EOL >> writesync_flags.txt
--benchmarks=overwrite
--threads=1
--duration=$DURATION
--disable_wal=0
--use_existing_db=1
--sync=1
--num=$NUM_KEYS
EOL

timing_enter rocksdb_insert
run_step insert
+7 −5
Original line number Diff line number Diff line
@@ -29,11 +29,13 @@ $rpc_py bdev_lvol_create -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
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=$!
Loading