test: replace backticks with dollar-parenthesis syntax

Scripts were using a mix of two approaches, lets unify that so
just dollar-parenthesis syntax is used.

Change-Id: Id093b6c82d1f766ba6af13bed720977eceaa7ffc
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457744
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Karol Latecki 2019-06-12 09:48:32 +02:00 committed by Darek Stojaczyk
parent ffc26bc3b6
commit fb9c4ee651
21 changed files with 43 additions and 43 deletions

View File

@ -25,7 +25,7 @@ function nbd_function_test() {
local rpc_server=/var/tmp/spdk-nbd.sock
local conf=$1
local nbd_num=6
local nbd_all=(`ls /dev/nbd* | grep -v p`)
local nbd_all=($(ls /dev/nbd* | grep -v p))
local bdev_all=($bdevs_name)
local nbd_list=(${nbd_all[@]:0:$nbd_num})
local bdev_list=(${bdev_all[@]:0:$nbd_num})

View File

@ -55,9 +55,9 @@ function nbd_get_count() {
# return = count of spdk nbd devices
local rpc_server=$1
nbd_disks_json=`$rootdir/scripts/rpc.py -s $rpc_server get_nbd_disks`
nbd_disks_name=`echo "${nbd_disks_json}" | jq -r '.[] | .nbd_device'`
count=`echo "${nbd_disks_name}" | grep -c /dev/nbd || true`
nbd_disks_json=$($rootdir/scripts/rpc.py -s $rpc_server get_nbd_disks)
nbd_disks_name=$(echo "${nbd_disks_json}" | jq -r '.[] | .nbd_device')
count=$(echo "${nbd_disks_name}" | grep -c /dev/nbd || true)
echo $count
}
@ -110,8 +110,8 @@ function nbd_rpc_start_stop_verify() {
nbd_start_disks_without_nbd_idx $rpc_server "${bdev_list[*]}"
nbd_disks_json=`$rootdir/scripts/rpc.py -s $rpc_server get_nbd_disks`
nbd_disks_name=(`echo "${nbd_disks_json}" | jq -r '.[] | .nbd_device'`)
nbd_disks_json=$($rootdir/scripts/rpc.py -s $rpc_server get_nbd_disks)
nbd_disks_name=($(echo "${nbd_disks_json}" | jq -r '.[] | .nbd_device'))
nbd_stop_disks $rpc_server "${nbd_disks_name[*]}"
count=$(nbd_get_count $rpc_server)

View File

@ -30,7 +30,7 @@ if ls $TESTDIR/results/testrun_* &> /dev/null; then
fi
if [ -z "$RESULTS_DIR" ]; then
RESULTS_DIR=$TESTDIR/results/testrun_`date +%Y%m%d_%H%M%S`
RESULTS_DIR=$TESTDIR/results/testrun_$(date +%Y%m%d_%H%M%S)
mkdir -p $RESULTS_DIR
rm -f $TESTDIR/results/last
ln -s $RESULTS_DIR $TESTDIR/results/last
@ -157,7 +157,7 @@ run_step() {
echo -n Generating perf report for $1 test phase...
sudo perf report -f -n | sed '/#/d' | sed '/%/!d' | sort -r > $1.perf.txt
sudo rm perf.data
$TESTDIR/postprocess.py `pwd` $1 > $1_summary.txt
$TESTDIR/postprocess.py $(pwd) $1 > $1_summary.txt
echo done.
fi
}

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
SYSTEM=`uname -s`
SYSTEM=$(uname -s)
if [ $SYSTEM = "FreeBSD" ] ; then
echo "blob_io_wait.sh cannot run on FreeBSD currently."
exit 0

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
SYSTEM=`uname -s`
SYSTEM=$(uname -s)
if [ $SYSTEM = "FreeBSD" ] ; then
echo "blobstore.sh cannot run on FreeBSD currently."
exit 0

View File

@ -140,7 +140,7 @@ if [ -d ${DEPENDENCY_DIR}/vtune_codes ]; then
fi
if [ -d /usr/include/iscsi ]; then
libiscsi_version=`grep LIBISCSI_API_VERSION /usr/include/iscsi/iscsi.h | head -1 | awk '{print $3}' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}'`
libiscsi_version=$(grep LIBISCSI_API_VERSION /usr/include/iscsi/iscsi.h | head -1 | awk '{print $3}' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}')
if [ $libiscsi_version -ge 20150621 ]; then
config_params+=' --with-iscsi-initiator'
fi
@ -414,7 +414,7 @@ function waitfornbd() {
# need to check the size of the output file instead.
for ((i=1; i<=20; i++)); do
dd if=/dev/$nbd_name of=/tmp/nbdtest bs=4096 count=1 iflag=direct
size=`stat -c %s /tmp/nbdtest`
size=$(stat -c %s /tmp/nbdtest)
rm -f /tmp/nbdtest
if [ "$size" != "0" ]; then
return 0
@ -609,9 +609,9 @@ function part_dev_by_gpt () {
parted -s $nbd_path mklabel gpt mkpart first '0%' '50%' mkpart second '50%' '100%'
# change the GUID to SPDK GUID value
SPDK_GPT_GUID=`grep SPDK_GPT_PART_TYPE_GUID $rootdir/lib/bdev/gpt/gpt.h \
SPDK_GPT_GUID=$(grep SPDK_GPT_PART_TYPE_GUID $rootdir/lib/bdev/gpt/gpt.h \
| awk -F "(" '{ print $2}' | sed 's/)//g' \
| awk -F ", " '{ print $1 "-" $2 "-" $3 "-" $4 "-" $5}' | sed 's/0x//g'`
| awk -F ", " '{ print $1 "-" $2 "-" $3 "-" $4 "-" $5}' | sed 's/0x//g')
sgdisk -t 1:$SPDK_GPT_GUID $nbd_path
sgdisk -t 2:$SPDK_GPT_GUID $nbd_path
elif [ "$operation" = reset ]; then
@ -823,7 +823,7 @@ function autotest_cleanup()
function freebsd_update_contigmem_mod()
{
if [ `uname` = FreeBSD ]; then
if [ $(uname) = FreeBSD ]; then
kldunload contigmem.ko || true
if [ ! -z "$WITH_DPDK_DIR" ]; then
echo "Warning: SPDK only works on FreeBSD with patches that only exist in SPDK's dpdk submodule"

View File

@ -75,7 +75,7 @@ function install_iscsi_adm()
git -C open-iscsi-install/open-iscsi config user.email none
git -C open-iscsi-install/open-iscsi checkout 86e8892
for patch in `ls open-iscsi-install/patches`; do
for patch in $(ls open-iscsi-install/patches); do
git -C open-iscsi-install/open-iscsi am ../patches/$patch
done
sed -i '427s/.*/-1);/' open-iscsi-install/open-iscsi/usr/session_info.c

4
test/env/env.sh vendored
View File

@ -22,7 +22,7 @@ timing_exit pci
timing_enter env_dpdk_post_init
argv="-c 0x1 "
if [ `uname` = Linux ]; then
if [ $(uname) = Linux ]; then
# The default base virtaddr falls into a region reserved by ASAN.
# DPDK will try to find the nearest available address space by
# trying to do mmap over and over, which will take ages to finish.
@ -34,7 +34,7 @@ fi
$testdir/env_dpdk_post_init/env_dpdk_post_init $argv
timing_exit env_dpdk_post_init
if [ `uname` = Linux ]; then
if [ $(uname) = Linux ]; then
# This tests the --match-allocations DPDK parameter which is only
# supported on Linux
timing_enter mem_callbacks

View File

@ -43,7 +43,7 @@ sleep 1
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
iscsiadm -m node --login -p $TARGET_IP:$ISCSI_PORT
trap 'for new_dir in `dir -d /mnt/*dir`; do umount $new_dir; rm -rf $new_dir; done; \
trap 'for new_dir in $(dir -d /mnt/*dir); do umount $new_dir; rm -rf $new_dir; done; \
iscsicleanup; killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
sleep 1

View File

@ -139,7 +139,7 @@ timing_exit wait_for_example
trap - SIGINT SIGTERM EXIT
qemupid=`cat "$qemu_pidfile" | awk '{printf $0}'`
qemupid=$(cat "$qemu_pidfile" | awk '{printf $0}')
kill -9 $qemupid
rm "$qemu_pidfile"
rm "$test_img"

View File

@ -28,7 +28,7 @@ function get_nvme_name_from_bdf {
timing_enter nvme
if [ `uname` = Linux ]; then
if [ $(uname) = Linux ]; then
# check that our setup.sh script does not bind NVMe devices to uio/vfio if they
# have an active mountpoint
$rootdir/scripts/setup.sh reset
@ -87,7 +87,7 @@ if [ `uname` = Linux ]; then
fi
fi
if [ `uname` = Linux ]; then
if [ $(uname) = Linux ]; then
start_stub "-s 4096 -i 0 -m 0xF"
trap "kill_stub -9; exit 1" SIGINT SIGTERM EXIT
fi
@ -144,7 +144,7 @@ timing_enter arbitration
$rootdir/examples/nvme/arbitration/arbitration -t 3 -i 0
timing_exit arbitration
if [ `uname` = Linux ]; then
if [ $(uname) = Linux ]; then
timing_enter multi_secondary
$rootdir/examples/nvme/perf/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x1 &
pid0=$!
@ -157,7 +157,7 @@ if [ `uname` = Linux ]; then
timing_exit multi_secondary
fi
if [ `uname` = Linux ]; then
if [ $(uname) = Linux ]; then
trap - SIGINT SIGTERM EXIT
kill_stub
fi

View File

@ -44,7 +44,7 @@ function get_numa_node(){
local disks=$2
if [ "$plugin" = "nvme" ]; then
for bdf in $disks; do
local driver=`grep DRIVER /sys/bus/pci/devices/$bdf/uevent |awk -F"=" '{print $2}'`
local driver=$(grep DRIVER /sys/bus/pci/devices/$bdf/uevent |awk -F"=" '{print $2}')
# Use this check to ommit blacklisted devices ( not binded to driver with setup.sh script )
if [ "$driver" = "vfio-pci" ] || [ "$driver" = "uio_pci_generic" ]; then
echo $(cat /sys/bus/pci/devices/$bdf/numa_node)
@ -67,7 +67,7 @@ function get_disks(){
local plugin=$1
if [ "$plugin" = "nvme" ]; then
for bdf in $(iter_pci_class_code 01 08 02); do
driver=`grep DRIVER /sys/bus/pci/devices/$bdf/uevent |awk -F"=" '{print $2}'`
driver=$(grep DRIVER /sys/bus/pci/devices/$bdf/uevent |awk -F"=" '{print $2}')
if [ "$driver" = "vfio-pci" ] || [ "$driver" = "uio_pci_generic" ]; then
echo "$bdf"
fi

View File

@ -21,7 +21,7 @@ fi
timing_enter nvme_cli
if [ `uname` = Linux ]; then
if [ $(uname) = Linux ]; then
start_stub "-s 2048 -i 0 -m 0xF"
trap "kill_stub; exit 1" SIGINT SIGTERM EXIT
fi
@ -49,7 +49,7 @@ sed -i 's/shm_id=.*/shm_id=0/g' spdk.conf
./nvme get-feature $bdf -n 1 -f 1 -s 1 -l 100
./nvme get-log $bdf -n 1 -i 1 -l 100
./nvme reset $bdf
if [ `uname` = Linux ]; then
if [ $(uname) = Linux ]; then
trap - SIGINT SIGTERM EXIT
kill_stub
fi

View File

@ -12,7 +12,7 @@ have_pci_nics=0
function load_ib_rdma_modules()
{
if [ `uname` != Linux ]; then
if [ $(uname) != Linux ]; then
return 0
fi
@ -53,7 +53,7 @@ function detect_nics_and_probe_drivers()
NIC_VENDOR="$1"
NIC_CLASS="$2"
nvmf_nic_bdfs=`lspci | grep Ethernet | grep "$NIC_VENDOR" | grep "$NIC_CLASS" | awk -F ' ' '{print "0000:"$1}'`
nvmf_nic_bdfs=$(lspci | grep Ethernet | grep "$NIC_VENDOR" | grep "$NIC_CLASS" | awk -F ' ' '{print "0000:"$1}')
if [ -z "$nvmf_nic_bdfs" ]; then
return 0
@ -123,8 +123,8 @@ function get_available_rdma_ips()
function get_rdma_if_list()
{
for nic_type in `ls /sys/class/infiniband`; do
for nic_name in `ls /sys/class/infiniband/${nic_type}/device/net`; do
for nic_type in $(ls /sys/class/infiniband); do
for nic_name in $(ls /sys/class/infiniband/${nic_type}/device/net); do
echo "$nic_name"
done
done

View File

@ -32,7 +32,7 @@ for incapsule in 0 4096; do
mkdir -p /mnt/device
devs=`lsblk -l -o NAME | grep nvme`
devs=$(lsblk -l -o NAME | grep nvme)
for dev in $devs; do
timing_enter parted

View File

@ -28,7 +28,7 @@ fi
$rpc_py nvmf_create_transport -t $TEST_TRANSPORT -u 8192
for i in `seq 1 $NVMF_SUBSYS`
for i in $(seq 1 $NVMF_SUBSYS)
do
$rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc$i
$rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode$i -a -s SPDK$i
@ -36,7 +36,7 @@ do
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode$i -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
done
for i in `seq 1 $NVMF_SUBSYS`; do
for i in $(seq 1 $NVMF_SUBSYS); do
k=$[$i-1]
nvme connect -t $TEST_TRANSPORT -n "nqn.2016-06.io.spdk:cnode${i}" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
@ -47,7 +47,7 @@ $rootdir/scripts/fio.py -p nvmf -i 262144 -d 64 -t read -r 10
$rootdir/scripts/fio.py -p nvmf -i 262144 -d 64 -t randwrite -r 10
sync
for i in `seq 1 $NVMF_SUBSYS`; do
for i in $(seq 1 $NVMF_SUBSYS); do
nvme disconnect -n "nqn.2016-06.io.spdk:cnode${i}" || true
$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode${i}
done

View File

@ -55,7 +55,7 @@ nvme disconnect -n nqn.2016-06.io.spdk:cnode1
$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
# do frequent add delete of namespaces with different nsid.
for i in `seq 1 $times`
for i in $(seq 1 $times)
do
$rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode1 -s SPDK00000000000001
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
@ -75,7 +75,7 @@ done
nvmfcleanup
# do frequent add delete.
for i in `seq 1 $times`
for i in $(seq 1 $times)
do
$rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode1 -s SPDK00000000000001
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT

View File

@ -56,7 +56,7 @@ echo "[Nvme]" > $testdir/bdevperf.conf
timing_enter create_subsystems
# Create subsystems
rm -rf $testdir/rpcs.txt
for i in `seq 1 $num_subsystems`
for i in $(seq 1 $num_subsystems)
do
echo construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc$i >> $testdir/rpcs.txt
echo nvmf_subsystem_create nqn.2016-06.io.spdk:cnode$i -a -s SPDK$i >> $testdir/rpcs.txt

View File

@ -158,7 +158,7 @@ function check_fio_retcode() {
function wait_for_finish() {
local wait_for_pid=$1
local sequence=${2:-30}
for i in `seq 1 $sequence`; do
for i in $(seq 1 $sequence); do
if kill -0 $wait_for_pid; then
sleep 0.5
continue

View File

@ -49,7 +49,7 @@ if [[ ! -r "${VM_IMAGE}" ]]; then
exit 1
fi
DISKS_NUMBER=`lspci -mm -n | grep 0108 | tr -d '"' | awk -F " " '{print "0000:"$1}'| wc -l`
DISKS_NUMBER=$(lspci -mm -n | grep 0108 | tr -d '"' | awk -F " " '{print "0000:"$1}'| wc -l)
WORKDIR=$(readlink -f $(dirname $0))

View File

@ -175,11 +175,11 @@ if [[ $vm_count -le $max_disks ]]; then
done
else
#Calculate least minimum number of splits on each disks
for i in `seq 0 $((max_disks - 1))`; do
for i in $(seq 0 $((max_disks - 1))); do
splits+=( $((vm_count / max_disks)) )
done
# Split up the remainder
for i in `seq 0 $((vm_count % max_disks - 1))`; do
for i in $(seq 0 $((vm_count % max_disks - 1))); do
(( splits[i]++ ))
done
fi