]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
filestore_idempotent: use new sequence-based tester
authorSage Weil <sage@newdream.net>
Sat, 14 Apr 2012 21:06:12 +0000 (14:06 -0700)
committerSage Weil <sage@newdream.net>
Sat, 14 Apr 2012 21:06:12 +0000 (14:06 -0700)
random seed, inject at 50-300.

teuthology/task/filestore_idempotent.py

index 45c424cafddf2b2259ae85cfaae97b6a1a4c64e7..c956d33d0f1f677a41aab1e4bd46195446d5a99f 100644 (file)
@@ -1,4 +1,6 @@
 import logging
+from ..orchestra import run
+import random
 
 from teuthology import misc as teuthology
 
@@ -27,31 +29,46 @@ def task(ctx, config):
     (remote,) = ctx.cluster.only(client).remotes.iterkeys()
 
     dir = '/tmp/cephtest/data/test.%s' % client
-    journal = '/tmp/cephtest/data/test.journal.%s' % client
-
-    remote.run(args=['mkdir', dir])
-    remote.run(args=['dd', 'if=/dev/zero', 'of=%s' % journal, 'bs=1M',
-                     'count=100'])
-
-    log.info('writing some data and simulating a failure')
-    remote.run(
-        args=[
-            '/tmp/cephtest/enable-coredump',
-            '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
-            '/tmp/cephtest/archive/coverage',
-            '/tmp/cephtest/binary/usr/local/bin/test_filestore_idempotent',
-            '-c', '/tmp/cephtest/ceph.conf',
-            'write', dir, journal
-            ])
-
-    log.info('verifying journal replay gives the correct result')
-    remote.run(
-        args=[
-            '/tmp/cephtest/enable-coredump',
-            '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
-            '/tmp/cephtest/archive/coverage',
-            '/tmp/cephtest/binary/usr/local/bin/test_filestore_idempotent',
-            '-c', '/tmp/cephtest/ceph.conf',
-            'verify', dir, journal
-            ])
 
+    seed = str(int(random.uniform(1,100)))
+
+    try:
+        log.info('creating a working dir')
+        remote.run(args=['mkdir', dir])
+        remote.run(
+            args=[
+                'cd', dir,
+                run.Raw('&&'),
+                'wget','-q', '-Orun_seed_to.sh',
+                'http://ceph.newdream.net/git/?p=ceph.git;a=blob_plain;f=src/test/filestore_test/run_seed_to.sh;hb=HEAD',
+                run.Raw('&&'),
+                'wget','-q', '-Orun_seed_to_range.sh',
+                'http://ceph.newdream.net/git/?p=ceph.git;a=blob_plain;f=src/test/filestore_test/run_seed_to_range.sh;hb=HEAD',
+                run.Raw('&&'),
+                'chmod', '+x', 'run_seed_to.sh', 'run_seed_to_range.sh',
+                ]);
+
+        log.info('running a series of tests')
+        proc = remote.run(
+            args=[
+                'cd', dir,
+                run.Raw('&&'),
+                run.Raw('PATH="/tmp/cephtest/binary/usr/local/bin:$PATH"'),
+                './run_seed_to_range.sh', seed, '50', '300',
+                ],
+            wait=False,
+            check_status=False)
+        result = proc.exitstatus.get();
+    
+        if result != 0:
+            remote.run(
+                args=[
+                    'cp', '-a', dir, '/tmp/cephtest/archive/idempotent_failure',
+                    ])
+            raise Exception("./run_seed_to_range.sh errored out")
+
+    finally:
+        remote.run(args=[
+                'rm', '-rf', '--', dir
+                ])
+