]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: ceph_objectstore_tool.py run faster by default
authorLoic Dachary <ldachary@redhat.com>
Thu, 13 Nov 2014 16:27:01 +0000 (17:27 +0100)
committerDavid Zafman <dzafman@redhat.com>
Tue, 3 Mar 2015 18:44:17 +0000 (10:44 -0800)
By default use only a small number of objects to speed up the tests. If
the argument "big" is given, use a large number of objects as it may
help find some problems.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit 235257c257aea98b770d9637957818c8aeb6c745)

src/test/ceph_objectstore_tool.py

index 793ca493ee63ef268c1ba3048793de460a78646e..6bad141c923ce3c3957102ac2b5aec6302f46935 100755 (executable)
@@ -168,7 +168,7 @@ def verify(DATADIR, POOL, NAME_PREFIX):
     return ERRORS
 
 
-def main():
+def main(argv):
     sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
     nullfd = open(os.devnull, "w")
 
@@ -177,13 +177,24 @@ def main():
     REP_NAME = "REPobject"
     EC_POOL = "ec_pool"
     EC_NAME = "ECobject"
-    NUM_REP_OBJECTS = 800
-    NUM_EC_OBJECTS = 12
-    NUM_NSPACES = 4
-    # Larger data sets for first object per namespace
-    DATALINECOUNT = 50000
-    # Number of objects to do xattr/omap testing on
-    ATTR_OBJS = 10
+    if len(argv) > 0 and argv[0] == 'large':
+        PG_COUNT = 12
+        NUM_REP_OBJECTS = 800
+        NUM_EC_OBJECTS = 12
+        NUM_NSPACES = 4
+        # Larger data sets for first object per namespace
+        DATALINECOUNT = 50000
+        # Number of objects to do xattr/omap testing on
+        ATTR_OBJS = 10
+    else:
+        PG_COUNT = 4
+        NUM_REP_OBJECTS = 2
+        NUM_EC_OBJECTS = 2
+        NUM_NSPACES = 2
+        # Larger data sets for first object per namespace
+        DATALINECOUNT = 10
+        # Number of objects to do xattr/omap testing on
+        ATTR_OBJS = 2
     ERRORS = 0
     pid = os.getpid()
     TESTDIR = "/tmp/test.{pid}".format(pid=pid)
@@ -194,7 +205,7 @@ def main():
     vstart(new=True)
     wait_for_health()
 
-    cmd = "./ceph osd pool create {pool} 12 12 replicated".format(pool=REP_POOL)
+    cmd = "./ceph osd pool create {pool} {pg} {pg} replicated".format(pool=REP_POOL, pg=PG_COUNT)
     logging.debug(cmd)
     call(cmd, shell=True, stdout=nullfd, stderr=nullfd)
     REPID = get_pool_id(REP_POOL, nullfd)
@@ -207,7 +218,7 @@ def main():
     cmd = "./ceph osd erasure-code-profile get {prof}".format(prof=PROFNAME)
     logging.debug(cmd)
     call(cmd, shell=True, stdout=nullfd, stderr=nullfd)
-    cmd = "./ceph osd pool create {pool} 12 12 erasure {prof}".format(pool=EC_POOL, prof=PROFNAME)
+    cmd = "./ceph osd pool create {pool} {pg} {pg} erasure {prof}".format(pool=EC_POOL, prof=PROFNAME, pg=PG_COUNT)
     logging.debug(cmd)
     call(cmd, shell=True, stdout=nullfd, stderr=nullfd)
     ECID = get_pool_id(EC_POOL, nullfd)
@@ -750,4 +761,4 @@ def main():
         sys.exit(1)
 
 if __name__ == "__main__":
-    main()
+    main(sys.argv[1:])