From 9c69503be7f437bc951cbab8c6e29f265c00bbe7 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Wed, 28 Jun 2023 13:36:43 +0530 Subject: [PATCH] LU-15626 tests: Remove variables not used This patch removes variables which were defined but not used. This was reported by shellcheck. This patch also replaces unicode double quotes wherever applicable Test-Parameters: trivial Signed-off-by: Arshad Hussain Change-Id: I996532de119806e20552e9bbe54b15615ea2c2e0 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51499 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Timothy Day Reviewed-by: Oleg Drokin --- lustre/tests/conf-sanity.sh | 18 ++++++++---------- lustre/tests/ost-pools.sh | 4 ---- lustre/tests/sanity-sec.sh | 4 ---- lustre/tests/sanity-selinux.sh | 7 +------ 4 files changed, 9 insertions(+), 24 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index e0fbaa4..829f1f1 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -1393,7 +1393,7 @@ test_32newtarball() { local flr_dir local flr_file local pj_quota_dir - local pj_quota_file + local pj_quota_file_old local target_dir if [ $FSNAME != t32fs -o \( -z "$MDSDEV" -a -z "$MDSDEV1" \) -o \ @@ -4487,8 +4487,8 @@ test_51() { start_ost2 || error "Unable to start OST1" wait $pid stop_ost2 || error "Unable to stop OST1" - umount_client $MOUNT -f || error “unmount $MOUNT failed” - cleanup_nocli || error “stop server failed” + umount_client $MOUNT -f || error "unmount $MOUNT failed" + cleanup_nocli || error "stop server failed" #writeconf to remove all ost2 traces for subsequent tests writeconf_or_reformat } @@ -5310,7 +5310,7 @@ test_64() { stop_ost2 || error "Unable to stop second ost" echo "$LFS df" $LFS df --lazy - umount_client $MOUNT -f || error “unmount $MOUNT failed” + umount_client $MOUNT -f || error "unmount $MOUNT failed" cleanup_nocli || error "cleanup_nocli failed with $?" #writeconf to remove all ost2 traces for subsequent tests writeconf_or_reformat @@ -6409,7 +6409,7 @@ test_79() { # LU-4227 > /dev/null || error "start mds1 failed" add mds2 $opts_mds2 $mdsdev2 $mdsvdev2 && error "Must specify --mgsnode when formatting a mdt" - add ost1 $opts_ost1 $ostdev1 $ostvdev2 && + add ost1 $opts_ost1 $ostdev1 $ostvdev1 && error "Must specify --mgsnode when formatting an ost" reformat_and_config @@ -7960,7 +7960,6 @@ run_test 97 "ldev returns correct ouput when querying based on role" test_98() { local mountopt - local temp=$MDS_MOUNT_OPTS setup check_mount || error "mount failed" @@ -9635,7 +9634,6 @@ test_123ae() { # LU-11566 local id local orig local new - local rpcs remote_mgs_nodsh && skip "remote MGS with nodsh" [ -d $MOUNT/.lustre ] || setupall @@ -10422,10 +10420,10 @@ test_134() { error "check_iam failed with fault or exception $rc"; } rc=$(grep -c "^255" $out) - error=$(grep -c "FINISHED WITH ERRORS" $out) + errors=$(grep -c "FINISHED WITH ERRORS" $out) - (( rc == error )) || { cat $out && - error "check_iam errcode does not fit with errors $rc $error"; } + (( rc == errors )) || { cat $out && + error "check_iam errcode does not fit with errors $rc $errors"; } } run_test 134 "check_iam works without faults" diff --git a/lustre/tests/ost-pools.sh b/lustre/tests/ost-pools.sh index 1189104..f539289 100755 --- a/lustre/tests/ost-pools.sh +++ b/lustre/tests/ost-pools.sh @@ -995,7 +995,6 @@ run_test 17 "Referencing an empty pool" create_perf() { local cdir=$1/d local numsec=$2 - local time mkdir -p $cdir sync @@ -1488,7 +1487,6 @@ run_test 25 "Create new pool and restart MDS" test_26() { [[ $OSTCOUNT -le 2 ]] && skip_env "needs >= 3 OSTs" - local dev=$(mdsdevname ${SINGLEMDS//mds/}) local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir} mkdir -p $POOL_ROOT @@ -1737,7 +1735,6 @@ test_30() { local pool1=${TESTNAME}-1 local pool2=${TESTNAME}-2 local threshold=10 - local spill local prefix="lod.$FSNAME-MDT0000*.pool.$pool1" local cmd="$LCTL get_param -n $prefix" @@ -1800,7 +1797,6 @@ test_31() { local pool3=${TESTNAME}-3 local pool4=${TESTNAME}-4 local threshold=10 - local spill (( $MDS1_VERSION >= $(version_code 2.14.53) )) || skip "Need MDS version at least 2.14.53" diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index eb41d3f..4b2b4a4 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -361,8 +361,6 @@ update_idmaps() { #LU-10040 local new_id=$((ID0 + 100)) local tmp_id local cmd - local run - local idtype local rc=0 echo "Start to update idmaps ..." @@ -2976,9 +2974,7 @@ run_test 37 "simple encrypted file" test_38() { local testfile=$DIR/$tdir/$tfile local tmpfile=$TMP/abc - local objid local blksz - local srvsz=0 local filesz local bsize local pagesz=$(getconf PAGE_SIZE) diff --git a/lustre/tests/sanity-selinux.sh b/lustre/tests/sanity-selinux.sh index bf882f8..362086b 100755 --- a/lustre/tests/sanity-selinux.sh +++ b/lustre/tests/sanity-selinux.sh @@ -71,11 +71,9 @@ umask 077 check_selinux_xattr() { local mds=$1 local mds_path=$2 - local mds_dev=$(facet_device $mds) local mntpt="/tmp/mdt_" - local opts - do_facet $mds mkdir -p $mntpt || error "mkdir $mntpt failed" + do_facet $mds mkdir -p $mntpt || error "mkdir $mntpt failed" mount_fstype $mds $mntpt || error "mount $mds failed" local xattrval=$(do_facet $mds getfattr -n security.selinux \ @@ -97,7 +95,6 @@ get_sel_ctx() { } test_1() { - local devname=$(mdsdevname 1) local filename=${DIR}/${tdir}/df1 local mds_path=${filename#$MOUNT} @@ -114,7 +111,6 @@ test_1() { run_test 1 "create file and check security.selinux xattr is set on MDT" test_2a() { - local devname=$(mdsdevname 1) local dirname=${DIR}/${tdir}/dir2a local mds_path=${dirname#$MOUNT} @@ -131,7 +127,6 @@ test_2a() { run_test 2a "create dir (mkdir) and check security.selinux xattr is set on MDT" test_2b() { - local devname=$(mdsdevname 1) local dirname1=${DIR}/$tdir/dir2b1 local dirname2=${DIR}/$tdir/dir2b2 local mds_path=${dirname1#$MOUNT} -- 1.8.3.1