Whamcloud - gitweb
LU-14544 tests: duplicated export entries 30/42130/5
authorElena Gryaznova <elena.gryaznova@hpe.com>
Mon, 22 Mar 2021 16:55:02 +0000 (19:55 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 8 Jun 2021 21:58:14 +0000 (21:58 +0000)
File /etc/exports could have $MNTPNT entry if
previous NFS tests interrupted.
With duplicated entries in /etc/exports nfs server
service fails to start/restart in RHEL 8 and SLES15.
Patch cleanups exports file before adding $MNTPNT entry.

Test-Parameters: trivial     clientdistro=el8.3 serverdistro=el8.3     testlist=parallel-scale-nfsv3,parallel-scale-nfsv4
Signed-off-by: Elena Gryaznova <elena.gryaznova@hpe.com>
HPE-bug-id: LUS-6291
Reviewed-by: Alexander Lezhoev <alexander.lezhoev@hpe.com>
Reviewed-by: Andriy Skulysh <andriy.skulysh@hpe.com>
Change-Id: I738bd0e8e79dc1ba84e6aa70e06fa47c49a935e0
Reviewed-on: https://review.whamcloud.com/42130
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/setup-nfs.sh

index daed37a..ab3afff 100755 (executable)
@@ -23,8 +23,10 @@ setup_nfs() {
         mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs; }" || return 1
     sleep 5
 
-       do_nodes $LUSTRE_CLIENT "echo $MNTPNT *\($export_opts_v\) \
-                                >> /etc/exports" || return 1
+       # get rid of old $MNTPNT entries in /etc/exports
+       do_nodes $LUSTRE_CLIENT "sed -i '/${MNTPNT##*/}/d' /etc/exports &&
+                       echo $MNTPNT *\($export_opts_v\) >> /etc/exports" ||
+                       return 1
 
        # restart nfs server according to distro
        do_nodes $LUSTRE_CLIENT "{ [[ -e /etc/SuSE-release ]] &&