From c207b3cb9b49e3c8026e63173a92ee6231f8eb5f Mon Sep 17 00:00:00 2001 From: James Nunez Date: Thu, 1 Aug 2019 15:23:14 -0600 Subject: [PATCH] LU-11673 tests: quote argument of -n conf-sanity MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Inside the single bracket test function '[', the argument of the ‘-n’ flag should be quoted arguments. If the -n argument is not quoted, a blank value will cause the variable to disappear and this causes issues. Quote the argument or use [[ ]]. conf-sanity test 79 has two cases where the ‘-n’ argument is not quoted. Let's correct this. Lustre-change: https://review.whamcloud.com/35669 Lustre-commit: 443cc6e51f0202b9bc40c256259c4fc14ae3f7af Test-Parameters: trivial envdefinitions=ONLY=79 testlist=conf-sanity Signed-off-by: James Nunez Change-Id: I4b3a43de064d1992439dc25ecc7b0682520f74c9 Reviewed-by: Andreas Dilger Reviewed-by: Wei Liu Reviewed-on: https://review.whamcloud.com/36928 Tested-by: jenkins Tested-by: Maloo --- lustre/tests/conf-sanity.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 492b7a4..72bfcb8 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -5728,13 +5728,13 @@ test_79() { # LU-4227 mgsnode_opt=$(echo $opts_mds2 | awk '{ for ( i = 1; i < NF; i++ ) if ( $i ~ "--mgsnode" ) { print $i; break } }') - [ -n $mgsnode_opt ] && + [ -n "$mgsnode_opt" ] && opts_mds2=$(echo $opts_mds2 | sed -e "s/$mgsnode_opt//") mgsnode_opt=$(echo $opts_ost1 | awk '{ for ( i = 1; i < NF; i++ ) if ( $i ~ "--mgsnode" ) { print $i; break } }') - [ -n $mgsnode_opt ] && + [ -n "$mgsnode_opt" ] && opts_ost1=$(echo $opts_ost1 | sed -e "s/$mgsnode_opt//") load_modules # -MGS, format a mdt without --mgs option -- 1.8.3.1