Whamcloud - gitweb
LU-15626 tests: Remove variables not used 99/51499/6
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Wed, 28 Jun 2023 08:06:43 +0000 (13:36 +0530)
committerOleg Drokin <green@whamcloud.com>
Fri, 14 Jul 2023 03:09:40 +0000 (03:09 +0000)
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 <arshad.hussain@aeoncomputing.com>
Change-Id: I996532de119806e20552e9bbe54b15615ea2c2e0
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51499
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/conf-sanity.sh
lustre/tests/ost-pools.sh
lustre/tests/sanity-sec.sh
lustre/tests/sanity-selinux.sh

index e0fbaa4..829f1f1 100644 (file)
@@ -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"
 
index 1189104..f539289 100755 (executable)
@@ -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"
index eb41d3f..4b2b4a4 100755 (executable)
@@ -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)
index bf882f8..362086b 100755 (executable)
@@ -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}