]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tasks/cephfs: fix ps usage to not truncate cmds
authorJohn Spray <john.spray@redhat.com>
Thu, 12 May 2016 10:16:56 +0000 (11:16 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 12 May 2016 10:23:11 +0000 (11:23 +0100)
Now that daemon commandlines include "--cluster" they
easily overflow ps's default behaviour.

Fixes: http://tracker.ceph.com/issues/15857
Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/test_sessionmap.py

index adab12433121a18dbe95fd93ab7551004c653242..032b279b9f9e81ebba428621a1fd4a4eaa22180c 100644 (file)
@@ -30,7 +30,7 @@ class TestSessionMap(CephFSTestCase):
         remote = self.fs.mds_daemons[mds_id].remote
 
         ps_txt = remote.run(
-            args=["ps", "axo", "cmd,nlwp"],
+            args=["ps", "-ww", "axo", "nlwp,cmd"],
             stdout=StringIO()
         ).stdout.getvalue().strip()
         lines = ps_txt.split("\n")[1:]
@@ -39,7 +39,7 @@ class TestSessionMap(CephFSTestCase):
             if line.find("ceph-mds") != -1:
                 if line.find("-i {0}".format(mds_id)) != -1:
                     log.info("Found ps line for daemon: {0}".format(line))
-                    return int(line.split()[-1])
+                    return int(line.split()[0])
 
         raise RuntimeError("No process found in ps output for MDS {0}: {1}".format(
             mds_id, ps_txt