From: Mykola Golub Date: Wed, 23 Aug 2017 08:40:56 +0000 (+0200) Subject: test/librbd: set rand seed for all tests X-Git-Tag: v13.0.1~279^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ca25c561784db2df115454656ec9b0d740558594;p=ceph.git test/librbd: set rand seed for all tests Signed-off-by: Mykola Golub --- diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index ad9c2575022..514b8b3fb8a 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -179,14 +179,6 @@ public: } static void SetUpTestCase() { - static bool seeded = false; - if (!seeded) { - seeded = true; - int seed = getpid(); - cout << "seed " << seed << std::endl; - srand(seed); - } - _pool_names.clear(); _unique_pool_names.clear(); _image_number = 0; diff --git a/src/test/librbd/test_main.cc b/src/test/librbd/test_main.cc index 0aa6aeeb81c..281ccabfb78 100644 --- a/src/test/librbd/test_main.cc +++ b/src/test/librbd/test_main.cc @@ -54,5 +54,10 @@ int main(int argc, char **argv) std::cerr << "failed to enable lockdep" << std::endl; return -r; } + + int seed = getpid(); + std::cout << "seed " << seed << std::endl; + srand(seed); + return RUN_ALL_TESTS(); }