Skip to content

Commit

Permalink
Merge pull request #14569 from smithfarm/wip-18899-kraken
Browse files Browse the repository at this point in the history
kraken: cephfs: test_open_inode fails

Reviewed-by: John Spray <john.spray@redhat.com>
  • Loading branch information
smithfarm committed Apr 20, 2017
2 parents 0c51569 + 2d5d8f2 commit cc49802
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion qa/tasks/cephfs/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ def open_no_data(self, basename):
def open_background(self, basename="background_file"):
"""
Open a file for writing, then block such that the client
will hold a capability
will hold a capability.
Don't return until the remote process has got as far as opening
the file, then return the RemoteProcess instance.
"""
assert(self.is_mounted())

Expand All @@ -176,6 +179,12 @@ def open_background(self, basename="background_file"):

rproc = self._run_python(pyscript)
self.background_procs.append(rproc)

# This wait would not be sufficient if the file had already
# existed, but it's simple and in practice users of open_background
# are not using it on existing files.
self.wait_for_visible(basename)

return rproc

def wait_for_visible(self, basename="background_file", timeout=30):
Expand Down
4 changes: 2 additions & 2 deletions qa/tasks/cephfs/test_strays.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,11 @@ def test_open_inode(self):

# Write some bytes to a file
size_mb = 8
self.mount_a.write_n_mb("open_file", size_mb)
open_file_ino = self.mount_a.path_to_ino("open_file")

# Hold the file open
p = self.mount_a.open_background("open_file")
self.mount_a.write_n_mb("open_file", size_mb)
open_file_ino = self.mount_a.path_to_ino("open_file")

self.assertEqual(self.get_session(mount_a_client_id)['num_caps'], 2)

Expand Down

0 comments on commit cc49802

Please sign in to comment.