]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: set rand seed for all tests
authorMykola Golub <mgolub@mirantis.com>
Wed, 23 Aug 2017 08:40:56 +0000 (10:40 +0200)
committerMykola Golub <to.my.trociny@gmail.com>
Mon, 6 Nov 2017 08:26:37 +0000 (10:26 +0200)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/test/librbd/test_librbd.cc
src/test/librbd/test_main.cc

index ad9c257502258664143ba4d9a43ebc8843ea8f0e..514b8b3fb8aa2c1b9c1c38f80ddc71d10e23b731 100644 (file)
@@ -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;
index 0aa6aeeb81c9603ac4d07b1569fa97aa40292007..281ccabfb78640e474f2941cf22939c191b352ca 100644 (file)
@@ -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();
 }