]> git.proxmox.com Git - ceph.git/blobdiff - ceph/qa/tasks/cephfs/test_exports.py
import 15.2.4
[ceph.git] / ceph / qa / tasks / cephfs / test_exports.py
index 3ffdb553cf03d2980e859806cd6c80e0dc94338c..abaf92e6bdae138fa3b5b1183392e6bd0140d466 100644 (file)
@@ -1,6 +1,5 @@
 import logging
 import time
-from StringIO import StringIO
 from tasks.cephfs.fuse_mount import FuseMount
 from tasks.cephfs.cephfs_test_case import CephFSTestCase
 
@@ -129,15 +128,15 @@ class TestExports(CephFSTestCase):
             self._wait_subtrees(status, 0, [('/1', 1), ('/1/2', 0), ('/1/2/3', 2)])
 
         if not isinstance(self.mount_a, FuseMount):
-            p = self.mount_a.client_remote.run(args=['uname', '-r'], stdout=StringIO(), wait=True)
+            p = self.mount_a.client_remote.sh('uname -r', wait=True)
             dir_pin = self.mount_a.getfattr("1", "ceph.dir.pin")
             log.debug("mount.getfattr('1','ceph.dir.pin'): %s " % dir_pin)
-           if str(p.stdout.getvalue()) < "5" and not(dir_pin):
-               self.skipTest("Kernel does not support getting the extended attribute ceph.dir.pin")
-        self.assertTrue(self.mount_a.getfattr("1", "ceph.dir.pin") == "1")
-        self.assertTrue(self.mount_a.getfattr("1/2", "ceph.dir.pin") == "0")
+            if str(p) < "5" and not(dir_pin):
+                self.skipTest("Kernel does not support getting the extended attribute ceph.dir.pin")
+        self.assertEqual(self.mount_a.getfattr("1", "ceph.dir.pin"), '1')
+        self.assertEqual(self.mount_a.getfattr("1/2", "ceph.dir.pin"), '0')
         if (len(self.fs.get_active_names()) > 2):
-            self.assertTrue(self.mount_a.getfattr("1/2/3", "ceph.dir.pin") == "2")
+            self.assertEqual(self.mount_a.getfattr("1/2/3", "ceph.dir.pin"), '2')
 
     def test_session_race(self):
         """
@@ -150,7 +149,6 @@ class TestExports(CephFSTestCase):
         status = self.fs.wait_for_daemons()
 
         rank1 = self.fs.get_rank(rank=1, status=status)
-        name1 = 'mds.'+rank1['name']
 
         # Create a directory that is pre-exported to rank 1
         self.mount_a.run_shell(["mkdir", "-p", "a/aa"])