]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: do not append file names to dirname
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 6 Aug 2020 17:55:21 +0000 (10:55 -0700)
committerNathan Cutler <ncutler@suse.com>
Wed, 23 Sep 2020 12:01:57 +0000 (14:01 +0200)
Otherwise the files generated are not actually under the sub-directory!
This is correcting a confusing aspect of the test infrastructure but
doesn't actually require any changes to the tests.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit ac6c150eb07ddd61c33fc4fad034fee6f5fbad35)

qa/tasks/cephfs/mount.py
qa/tasks/cephfs/test_client_limits.py

index 48f065051745d6863610e87769fb132a9678c164..7a833a1182539c2e6da2720f65879d27e1a8605c 100644 (file)
@@ -484,13 +484,14 @@ class CephFSMount(object):
             n = {count}
             abs_path = "{abs_path}"
 
-            if not os.path.exists(os.path.dirname(abs_path)):
-                os.makedirs(os.path.dirname(abs_path))
+            if not os.path.exists(abs_path):
+                os.makedirs(abs_path)
 
             handles = []
             for i in range(0, n):
-                fname = "{{0}}_{{1}}".format(abs_path, i)
-                handles.append(open(fname, 'w'))
+                fname = "file_"+str(i)
+                path = os.path.join(abs_path, fname)
+                handles.append(open(path, 'w'))
 
             while True:
                 time.sleep(1)
index 8491c3d7d888207ae6e1d2f084605e6c66ea1af1..f9ba18d9da2b57f3761267d6a393bd6113d43039 100644 (file)
@@ -54,7 +54,7 @@ class TestClientLimits(CephFSTestCase):
         self.assertTrue(open_files >= mds_min_caps_per_client)
 
         mount_a_client_id = self.mount_a.get_global_id()
-        path = "subdir/mount_a" if use_subdir else "mount_a"
+        path = "subdir" if use_subdir else "."
         open_proc = self.mount_a.open_n_background(path, open_files)
 
         # Client should now hold: