Whamcloud - gitweb
LU-11673 tests: quote argument of -n conf-sanity 69/35669/3
authorJames Nunez <jnunez@whamcloud.com>
Thu, 1 Aug 2019 21:23:14 +0000 (15:23 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 15 Aug 2019 07:55:00 +0000 (07:55 +0000)
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.

Test-Parameters: trivial envdefinitions=ONLY=79 testlist=conf-sanity
Signed-off-by: James Nunez <jnunez@whamcloud.com>
Change-Id: I4b3a43de064d1992439dc25ecc7b0682520f74c9
Reviewed-on: https://review.whamcloud.com/35669
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
lustre/tests/conf-sanity.sh

index 79cec18..fcb77a0 100644 (file)
@@ -5757,13 +5757,13 @@ test_79() { # LU-4227
        mgsnode_opt=$(echo $opts_mds2 |
                awk '{ for ( i = 1; i < NF; i++ )
                        if ( $i ~ "--mgsnode" ) { print $i; break } }')
        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 } }')
                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
                opts_ost1=$(echo $opts_ost1 | sed -e "s/$mgsnode_opt//")
        load_modules
        # -MGS, format a mdt without --mgs option