Whamcloud - gitweb
LU-15360 tests: Use saved value on EXIT/Restore 21/45821/2
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Fri, 10 Dec 2021 09:46:54 +0000 (15:16 +0530)
committerOleg Drokin <green@whamcloud.com>
Thu, 23 Dec 2021 07:21:22 +0000 (07:21 +0000)
This was originally reported by shellcheck as
unused variable. However, on closer inspection
it appears that the restore on "EXIT" was
hard-coded to 0 (mostly this should be correct)
instead of using the original value of $old

This patch resets 'enable_chprojid_gid' value
to original value captured in $old instead of
hard-coded value of 0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In ./lustre/tests/sanity-quota.sh line 4150:
local old=$(do_facet mds1 $LCTL get_param -n \
      ^-- SC2034: old appears unused. Verify it or export it.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Test-Parameters: trivial testlist=sanity-quota
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I31e7a8a931d53a1fcb9d77ecf1759fce572bd52c
Reviewed-on: https://review.whamcloud.com/45821
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-quota.sh

index 0cc20c7..52b820b 100755 (executable)
@@ -4222,8 +4222,8 @@ test_66() {
        local testdir=$DIR/$tdir/foo
 
        do_facet mds1 $LCTL set_param mdt.*.enable_chprojid_gid=0
-       stack_trap "do_facet mds1 $LCTL set_param mdt.*.enable_chprojid_gid=0" \
-               EXIT
+       stack_trap "do_facet mds1 $LCTL \
+               set_param mdt.*.enable_chprojid_gid=$old" EXIT
 
        mkdir_on_mdt0 $testdir || error "failed to mkdir"
        chown -R $TSTID:$TSTID $testdir