The test fails when path values have trailing slash,
e.g. DIR=/mnt/lustre/
The patch adds validation which at the moment processes
these parameters-DIR, DIR1, DIR2, MOUNT, MOUNT1, MOUNT2.
Change-Id: Ief85e8798911cb67b4dafce985a9e4ef56cc26a4
Signed-off-by: Kyrylo Shatskyy <kyrylo.shatskyy@seagate.com>
Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com>
Seagate-bug-id: MRP-334
Reviewed-on: http://es-gerrit.xyus.xyratex.com:8080/#/c/269
Tested-by: Jenkins
Reviewed-by: Andrew Perepechko <Andrew_Perepechko@xyratex.com>
Reviewed-by: Alexander Lezhoev <Alexander_Lezhoev@xyratex.com>
Tested-by: Alexander Lezhoev <Alexander_Lezhoev@xyratex.com>
Reviewed-by: Vitaly Fertman <Vitaly_Fertman@xyratex.com>
Reviewed-on: http://review.whamcloud.com/16358
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
[ -z "$MODPROBECONF" -a -f /etc/modprobe.conf ] &&
MODPROBECONF=/etc/modprobe.conf
[ -z "$MODPROBECONF" -a -f /etc/modprobe.conf ] &&
MODPROBECONF=/etc/modprobe.conf
+sanitize_parameters() {
+ for i in DIR DIR1 DIR2 MOUNT MOUNT1 MOUNT2
+ do
+ local path=${!i}
+ if [ -d "$path" ]; then
+ eval export $i=$(echo $path | sed -E 's/\/+$//g')
+ fi
+ done
+}
- local failed=""
- [[ $DIR/ = $MOUNT/* ]] || \
- { failed=1 && echo "DIR=$DIR not in $MOUNT. Aborting."; }
- [[ $DIR1/ = $MOUNT1/* ]] || \
- { failed=1 && echo "DIR1=$DIR1 not in $MOUNT1. Aborting."; }
- [[ $DIR2/ = $MOUNT2/* ]] || \
- { failed=1 && echo "DIR2=$DIR2 not in $MOUNT2. Aborting"; }
+ local failed=""
+ [[ $DIR/ = $MOUNT/* ]] ||
+ { failed=1 && echo "DIR=$DIR not in $MOUNT. Aborting."; }
+ [[ $DIR1/ = $MOUNT1/* ]] ||
+ { failed=1 && echo "DIR1=$DIR1 not in $MOUNT1. Aborting."; }
+ [[ $DIR2/ = $MOUNT2/* ]] ||
+ { failed=1 && echo "DIR2=$DIR2 not in $MOUNT2. Aborting"; }
- [ -n "$failed" ] && exit 99 || true
+ [ -n "$failed" ] && exit 99 || true
}
check_and_setup_lustre() {
}
check_and_setup_lustre() {
- nfs_client_mode && return
+ sanitize_parameters
+ nfs_client_mode && return
cifs_client_mode && return
cifs_client_mode && return
- local MOUNTED=$(mounted_lustre_filesystems)
+ local MOUNTED=$(mounted_lustre_filesystems)
# 1.
# both MOUNT and MOUNT2 are not mounted
if ! is_mounted $MOUNT && ! is_mounted $MOUNT2; then
# 1.
# both MOUNT and MOUNT2 are not mounted
if ! is_mounted $MOUNT && ! is_mounted $MOUNT2; then