Whamcloud - gitweb
LU-15931 tests: Escape * in log()
[fs/lustre-release.git] / lustre / tests / test-framework.sh
index 1dfb655..7c25003 100755 (executable)
@@ -156,14 +156,15 @@ print_summary () {
 # output: No return values, environment variables are exported
 
 get_lustre_env() {
+       if ! $RPC_MODE; then
+               export mds1_FSTYPE=${mds1_FSTYPE:-$(facet_fstype mds1)}
+               export ost1_FSTYPE=${ost1_FSTYPE:-$(facet_fstype ost1)}
 
-       export mds1_FSTYPE=${mds1_FSTYPE:-$(facet_fstype mds1)}
-       export ost1_FSTYPE=${ost1_FSTYPE:-$(facet_fstype ost1)}
-
-       export MGS_VERSION=$(lustre_version_code mgs)
-       export MDS1_VERSION=$(lustre_version_code mds1)
-       export OST1_VERSION=$(lustre_version_code ost1)
-       export CLIENT_VERSION=$(lustre_version_code client)
+               export MGS_VERSION=$(lustre_version_code mgs)
+               export MDS1_VERSION=$(lustre_version_code mds1)
+               export OST1_VERSION=$(lustre_version_code ost1)
+               export CLIENT_VERSION=$(lustre_version_code client)
+       fi
 
        # Prefer using "mds1" directly instead of SINGLEMDS.
        # Keep this for compat until it is removed from scripts.
@@ -467,7 +468,7 @@ check_cpt_number() {
 # code is useful for comparison two version strings to see which is newer.
 version_code() {
        # split arguments like "1.8.6-wc3" into "1", "8", "6", "3"
-       eval set -- $(tr "[:punct:][a-z]" " " <<< $*)
+       eval set -- $(tr "[:punct:][a-zA-Z]" " " <<< $*)
 
        echo -n $(((${1:-0}<<24) | (${2:-0}<<16) | (${3:-0}<<8) | (${4:-0})))
 }
@@ -4717,6 +4718,7 @@ stopall() {
        # The add fn does rm ${facet}active file, this would be enough
        # if we use do_facet <facet> only after the facet added, but
        # currently we use do_facet mds in local.sh
+       local num
        for num in `seq $MDSCOUNT`; do
                stop mds$num -f
                rm -f ${TMP}/mds${num}active
@@ -6752,6 +6754,7 @@ log() {
     local MSG="$*"
     # Get rid of '
     MSG=${MSG//\'/\\\'}
+    MSG=${MSG//\*/\\\*}
     MSG=${MSG//\(/\\\(}
     MSG=${MSG//\)/\\\)}
     MSG=${MSG//\;/\\\;}
@@ -9071,6 +9074,9 @@ test_mkdir() {
        local dirstripe_index=${DIRSTRIPE_INDEX:-$((base % $MDSCOUNT))}
        local OPTIND=1
 
+       (( $MDS1_VERSION > $(version_code 2.15.0) )) &&
+               hash_name+=("crush2")
+
        while getopts "c:H:i:p" opt; do
                case $opt in
                        c) dirstripe_count=$OPTARG;;