]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
store_test: improve synthetic test coverage of long object names
authorSamuel Just <sjust@redhat.com>
Fri, 11 Mar 2016 22:05:37 +0000 (14:05 -0800)
committerSamuel Just <sjust@redhat.com>
Mon, 14 Mar 2016 17:25:30 +0000 (10:25 -0700)
1/2 of objects will now have long names, and we'll shift the region
of the hash space where new objects are created every 1024 objects
created.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/test/objectstore/store_test.cc

index 5520d1632ae3e5bb1188f38315e464e05c0ac2cc..f438056a059874d40df445bc767100a7a90e14a7 100644 (file)
@@ -1681,11 +1681,17 @@ public:
     char buf[100];
     snprintf(buf, sizeof(buf), "OBJ_%u", seq);
     string name(buf);
+    if (seq % 2) {
+      for (unsigned i = 0; i < 300; ++i) {
+       name.push_back('a');
+      }
+    }
     ++seq;
     return ghobject_t(
       hobject_t(
        name, string(), rand() & 2 ? CEPH_NOSNAP : rand(),
-       seq % 16, // use smaller set of hash values so clone can work
+       (((seq / 1024) % 2) * 0xF00 ) +
+       (seq & 0xFF),
        poolid, ""));
   }
 };