]> git-server-git.apps.pok.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>
Wed, 4 May 2016 12:33:21 +0000 (08:33 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
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();