]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
tasks/nfs: make sure NFS kernel server is started 554/head
authorYan, Zheng <zyan@redhat.com>
Tue, 30 Jun 2015 03:34:13 +0000 (11:34 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 21 Jul 2015 07:11:48 +0000 (15:11 +0800)
Fixes: #9994
Signed-off-by: Yan, Zheng <zyan@redhat.com>
teuthology/task/knfsd.py

index 96f501717ccc7e4fa2bda50332ce74d2bebec019..100671d8226544bc15e20cbcc81ede9ec12c06b0 100644 (file)
@@ -9,6 +9,17 @@ from teuthology import misc as teuthology
 
 log = logging.getLogger(__name__)
 
+def get_nfsd_args(remote, cmd):
+    args=[
+        'sudo',
+        'service',
+        'nfs',
+        cmd,
+        ]
+    if remote.os.package_type == 'deb':
+        args[2] = 'nfs-kernel-server'
+    return args
+
 @contextlib.contextmanager
 def task(ctx, config):
     """
@@ -104,6 +115,10 @@ def task(ctx, config):
                 '{MNT}'.format(MNT=mnt),
                 ],
             )
+        """
+        Start NFS kernel server
+        """
+        remote.run( args=get_nfsd_args(remote, 'restart') )
         args=[
             'sudo',
             "exportfs",
@@ -144,27 +159,8 @@ def task(ctx, config):
                     check_status=False
                     )
             finally:
-                remote.run(
-                    args=[
-                        'sudo',
-                        'exportfs',
-                        '-au',
-                        ],
-                    )
-                remote.run(
-                    args=[
-                        'sudo',
-                        'rpc.nfsd',
-                        '0',
-                        ],
-                    )
-                remote.run(
-                    args=[
-                        'sudo',
-                        'exportfs',
-                        '-f',
-                        ],
-                    )
+                log.debug('Stopping NFS server on client.{id}...'.format(id=id_))
+                remote.run( args=get_nfsd_args(remote, 'stop') )
                 log.debug('Syncing client client.{id}'.format(id=id_))
                 remote.run(
                     args=[