]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: write_n_mb optionally background
authorJohn Spray <john.spray@redhat.com>
Wed, 11 Nov 2015 10:24:50 +0000 (10:24 +0000)
committerJohn Spray <john.spray@redhat.com>
Thu, 14 Jan 2016 22:55:29 +0000 (22:55 +0000)
Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/mount.py

index 832d0002e54017637177cc5480cb76830681ca9a..f714238fffb93fbc4aed6eeb85abf2920a3b3784 100644 (file)
@@ -281,17 +281,17 @@ class CephFSMount(object):
         self.background_procs.append(rproc)
         return rproc
 
-    def write_n_mb(self, filename, n_mb, seek=0):
+    def write_n_mb(self, filename, n_mb, seek=0, wait=True):
         """
         Write the requested number of megabytes to a file
         """
         assert(self.is_mounted())
 
-        self.run_shell(["dd", "if=/dev/urandom", "of={0}".format(filename),
-                        "bs=1M",
-                        "count={0}".format(n_mb),
-                        "seek={0}".format(seek)
-        ])
+        return self.run_shell(["dd", "if=/dev/urandom", "of={0}".format(filename),
+                               "bs=1M",
+                               "count={0}".format(n_mb),
+                               "seek={0}".format(seek)
+                               ], wait=wait)
 
     def write_test_pattern(self, filename, size):
         log.info("Writing {0} bytes to {1}".format(size, filename))