From 9348b9a1e061243ff95c3b8bde69425829405efd Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Fri, 10 Dec 2021 15:16:54 +0530 Subject: [PATCH] LU-15360 tests: Use saved value on EXIT/Restore 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 Change-Id: I31e7a8a931d53a1fcb9d77ecf1759fce572bd52c Reviewed-on: https://review.whamcloud.com/45821 Tested-by: jenkins Reviewed-by: James Nunez Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/tests/sanity-quota.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 0cc20c7..52b820b 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -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 -- 1.8.3.1