From 92cdc28ef519d4e26c62a841f43b526fbd5cc949 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Thu, 6 Aug 2020 10:55:21 -0700 Subject: [PATCH] qa: do not append file names to dirname 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 (cherry picked from commit ac6c150eb07ddd61c33fc4fad034fee6f5fbad35) --- qa/tasks/cephfs/mount.py | 9 +++++---- qa/tasks/cephfs/test_client_limits.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/qa/tasks/cephfs/mount.py b/qa/tasks/cephfs/mount.py index ec106680ba194..5d8e6d23ad9ab 100644 --- a/qa/tasks/cephfs/mount.py +++ b/qa/tasks/cephfs/mount.py @@ -449,13 +449,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) diff --git a/qa/tasks/cephfs/test_client_limits.py b/qa/tasks/cephfs/test_client_limits.py index 01b5db6554f80..8fbb9e9bea8d2 100644 --- a/qa/tasks/cephfs/test_client_limits.py +++ b/qa/tasks/cephfs/test_client_limits.py @@ -52,7 +52,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: -- 2.39.5