Whamcloud - gitweb
LU-8885 tests: zconf_mount_clients() defect 54/24054/4
authorArshad Hussain <arshad.hussain@seagate.com>
Fri, 23 Sep 2016 03:12:09 +0000 (23:12 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Jul 2017 03:28:35 +0000 (03:28 +0000)
Presently zconf_mount_clients() returns success(0)
in cases where the 'NFS' mount is already mounted
on a mount point which it is trying to mount again.
In this case, it silently ignores the mount, leading
to testcase failure. This patch addresses this defect
by allowing zconf_mount_clients() to compare that
nothing unexpected is mounted by comparing the result
of mount count with mount count of "type lustre". If
they are unequal the function exists with an error.

Test-Parameters: envdefinitions=PARALLEL_SCALE_EXCEPT=parallel_grouplock \
testlist=sanity,parallel-scale,parallel-scale-nfsv3
Signed-off-by: Arshad Hussain <arshad.hussain@seagate.com>
Change-Id: I55e4b2ef2a18985be4833fca017cc6c6b0c5410f
Seagate-bug-id: MRP-3773
Reviewed-by: Ashish Purkar <ashish.purkar@seagate.com>
Reviewed-by: Ujjwal Lanjewar <ujjwal.lanjewar@seagate.com>
Reviewed-by: Elena V. Gryaznova <elena.gryaznova@seagate.com>
Tested-by: Elena V. Gryaznova <elena.gryaznova@seagate.com>
Reviewed-on: https://review.whamcloud.com/24054
Reviewed-by: Elena Gryaznova <elena.gryaznova@seagate.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/test-framework.sh

index 4b0182e..5727455 100755 (executable)
@@ -1776,14 +1776,24 @@ zconf_mount_clients() {
        fi
 
        do_nodes $clients "
-running=\\\$(mount | grep -c $mnt' ');
-rc=0;
-if [ \\\$running -eq 0 ] ; then
-    mkdir -p $mnt;
-    $MOUNT_CMD $flags $opts $device $mnt;
-    rc=\\\$?;
-fi;
-exit \\\$rc" || return ${PIPESTATUS[0]}
+               running=\\\$(mount | grep -c $mnt' ');
+               rc=0;
+               if [ \\\$running -eq 0 ] ; then
+                       mkdir -p $mnt;
+                       $MOUNT_CMD $flags $opts $device $mnt;
+                       rc=\\\$?;
+               else
+                       lustre_mnt_count=\\\$(mount | grep $mnt' ' | \
+                               grep 'type lustre' | wc -l);
+                       if [ \\\$running -ne \\\$lustre_mnt_count ] ; then
+                               echo zconf_mount_clients FAILED: \
+                                       mount count \\\$running, not matching \
+                                       with mount count of 'type lustre' \
+                                       \\\$lustre_mnt_count;
+                               rc=1;
+                       fi;
+               fi;
+       exit \\\$rc" || return ${PIPESTATUS[0]}
 
        echo "Started clients $clients: "
        do_nodes $clients "mount | grep $mnt' '"