]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add task for running fsx on an rbd image.
authorJosh Durgin <josh.durgin@dreamhost.com>
Thu, 12 Apr 2012 01:03:44 +0000 (18:03 -0700)
committerSage Weil <sage@newdream.net>
Tue, 17 Apr 2012 15:59:51 +0000 (08:59 -0700)
teuthology/task/rbd_fsx.py [new file with mode: 0644]

diff --git a/teuthology/task/rbd_fsx.py b/teuthology/task/rbd_fsx.py
new file mode 100644 (file)
index 0000000..1631be6
--- /dev/null
@@ -0,0 +1,60 @@
+import contextlib
+import logging
+
+from ..orchestra import run
+from teuthology.parallel import parallel
+
+log = logging.getLogger(__name__)
+
+@contextlib.contextmanager
+def task(ctx, config):
+    """
+    Run fsx on an rbd image.
+
+    Currently this requires running as client.admin
+    to create a pool.
+
+    Specify which clients to run on as a list::
+
+      tasks:
+        ceph:
+        rbd_fsx:
+          clients: [client.0, client.1]
+
+    You can optionally change some properties of fsx:
+
+      tasks:
+        ceph:
+        rbd_fsx:
+          clients: <list of clients>
+          seed: <random seed number, or 0 to use the time>
+          ops: <number of operations to do>
+          size: <maximum image size in bytes>
+    """
+    log.info('starting rbd_fsx...')
+    with parallel() as p:
+        for role in config['clients']:
+            p.spawn(_run_one_client, ctx, config, role)
+    yield
+
+def _run_one_client(ctx, config, role):
+    (remote,) = ctx.cluster.only(role).remotes.iterkeys()
+    remote.run(
+        args=[
+            'CEPH_CONF=/tmp/cephtest/ceph.conf',
+            'LD_LIBRARY_PATH=/tmp/cephtest/binary/usr/local/lib',
+            '/tmp/cephtest/enable-coredump',
+            '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+            '/tmp/cephtest/archive/coverage',
+            '/tmp/cephtest/binary/usr/local/bin/test_librbd_fsx',
+            '-d',
+            '-W', '-R', # mmap doesn't work with rbd
+            '-P', '/tmp/cephtest/archive',
+            '-t', '4194304',
+            '-l', str(config.get('size', 1073741824)),
+            '-S', str(config.get('seed', 0)),
+            '-N', str(config.get('ops', 1000)),
+            'pool_{pool}'.format(pool=role),
+            'image_{image}'.format(image=role),
+            ],
+        )