From: Arshad Hussain Date: Fri, 23 Sep 2016 03:12:09 +0000 (-0400) Subject: LU-8885 tests: zconf_mount_clients() defect X-Git-Tag: 2.10.51~104 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=10ec9eba801dc80f1ccb9f8fbcbd4b0258940623;ds=sidebyside LU-8885 tests: zconf_mount_clients() defect 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 Change-Id: I55e4b2ef2a18985be4833fca017cc6c6b0c5410f Seagate-bug-id: MRP-3773 Reviewed-by: Ashish Purkar Reviewed-by: Ujjwal Lanjewar Reviewed-by: Elena V. Gryaznova Tested-by: Elena V. Gryaznova Reviewed-on: https://review.whamcloud.com/24054 Reviewed-by: Elena Gryaznova Reviewed-by: Jian Yu Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 4b0182e..5727455 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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' '"