]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: randomize rbd-mirror test case IO
authorJason Dillaman <dillaman@redhat.com>
Wed, 4 May 2016 03:17:12 +0000 (23:17 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 10 May 2016 17:44:00 +0000 (13:44 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 0d75f2ce61cee164da4e5b7ffb4e69c286e6036a)

src/test/rbd_mirror/test_fixture.cc

index 34981eac95feb953550c2af71aaf9f73458590db..7ec0ab3284f5742d933cfb65b618d0fda9188f25 100644 (file)
@@ -38,6 +38,14 @@ void TestFixture::TearDownTestCase() {
 }
 
 void TestFixture::SetUp() {
+  static bool seeded = false;
+  if (!seeded) {
+    seeded = true;
+    int seed = getpid();
+    cout << "seed " << seed << std::endl;
+    srand(seed);
+  }
+
   ASSERT_EQ(0, _rados.ioctx_create(_local_pool_name.c_str(), m_local_io_ctx));
   ASSERT_EQ(0, _rados.ioctx_create(_remote_pool_name.c_str(), m_remote_io_ctx));
   m_image_name = get_temp_image_name();