Whamcloud - gitweb
LU-1471 tests: check rpcidmapd service in setup-nfs.sh
authorYu Jian <yujian@whamcloud.com>
Mon, 16 Jul 2012 03:40:05 +0000 (11:40 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 23 Jul 2012 23:14:05 +0000 (19:14 -0400)
The rpcidmapd system service is not in SLES11 distro, which
caused "service: no such service rpcidmapd" error while running
setup-nfs.sh. This patch fixes the above issue by checking the
service before restarting or stopping it.

Test-Parameters: testlist=parallel-scale-nfsv3,parallel-scale-nfsv4
Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: I0571d9ce3850fda246c1cd43b6c9019de30398e1
Reviewed-on: http://review.whamcloud.com/3400
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/setup-nfs.sh

index 7863d40..218eb58 100755 (executable)
@@ -23,7 +23,9 @@ setup_nfs() {
 
     do_nodes $LUSTRE_CLIENT "service nfs restart" || return 1
 
-    do_nodes $NFS_CLIENTS "service rpcidmapd restart" || return 1
+       do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
+                              grep -q rpcidmapd && service rpcidmapd restart ||
+                              true"
 
     do_nodes $LUSTRE_CLIENT "exportfs -o $export_opts_v *:$MNTPNT \
         && exportfs -v" || return 1
@@ -50,8 +52,10 @@ cleanup_nfs() {
     echo -e "\nUnmounting NFS clients..."
     do_nodes $NFS_CLIENTS "umount -f $MNTPNT" || return 1
 
-    echo -e "\nUnexporting Lustre filesystem..."
-    do_nodes $NFS_CLIENTS "service rpcidmapd stop" || return 1
+       echo -e "\nUnexporting Lustre filesystem..."
+       do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
+                              grep -q rpcidmapd && service rpcidmapd stop ||
+                              true"
 
     do_nodes $LUSTRE_CLIENT "service nfs stop" || return 1