]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush/CrushTester: remove old test_with_crushtool helper
authorSage Weil <sage@redhat.com>
Thu, 29 Jun 2017 19:15:32 +0000 (15:15 -0400)
committerSage Weil <sage@redhat.com>
Fri, 7 Jul 2017 15:11:24 +0000 (11:11 -0400)
test_with_fork is superior in all ways :)

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_opts.h
src/crush/CrushTester.cc
src/crush/CrushTester.h

index 1500def7ba972a13b1caa3b01f6d3edc64de947d..6455bf846d9657bebcba3382ae14b0da0721d045 100644 (file)
@@ -28,7 +28,6 @@ OPTION(lockdep_force_backtrace, OPT_BOOL, false) // always gather current backtr
 OPTION(run_dir, OPT_STR, "/var/run/ceph")       // the "/var/run/ceph" dir, created on daemon startup
 OPTION(admin_socket, OPT_STR, "$run_dir/$cluster-$name.asok") // default changed by common_preinit()
 OPTION(admin_socket_mode, OPT_STR, "") // permission bits to set for admin socket file, e.g., "0775", "0755"
-OPTION(crushtool, OPT_STR, "crushtool") // crushtool utility path
 
 OPTION(daemonize, OPT_BOOL, false) // default changed by common_preinit()
 OPTION(setuser, OPT_STR, "")        // uid or user name
index c24448a1d359f78bb80cc18440c85be18cbba012..ac58c882feb900c5366f850cbc2bf6159ea501b3 100644 (file)
@@ -372,49 +372,6 @@ int CrushTester::test_with_fork(int timeout)
   return r;
 }
 
-int CrushTester::test_with_crushtool(const char *crushtool_cmd,
-                                    int max_id, int timeout,
-                                    int ruleset)
-{
-  SubProcessTimed crushtool(crushtool_cmd, SubProcess::PIPE, SubProcess::CLOSE, SubProcess::PIPE, timeout);
-  string opt_max_id = boost::lexical_cast<string>(max_id);
-  crushtool.add_cmd_args(
-    "-i", "-",
-    "--test", "--check", opt_max_id.c_str(),
-    "--min-x", "1",
-    "--max-x", "50",
-    NULL);
-  if (ruleset >= 0) {
-    crushtool.add_cmd_args(
-      "--ruleset",
-      stringify(ruleset).c_str(),
-      NULL);
-  }
-  int ret = crushtool.spawn();
-  if (ret != 0) {
-    err << "failed run crushtool: " << crushtool.err();
-    return ret;
-  }
-
-  bufferlist bl;
-  ::encode(crush, bl, CEPH_FEATURES_SUPPORTED_DEFAULT);
-  bl.write_fd(crushtool.get_stdin());
-  crushtool.close_stdin();
-  bl.clear();
-  ret = bl.read_fd(crushtool.get_stderr(), 100 * 1024);
-  if (ret < 0) {
-    err << "failed read from crushtool: " << cpp_strerror(-ret);
-    return ret;
-  }
-  bl.write_stream(err);
-  if (crushtool.join() != 0) {
-    err << crushtool.err();
-    return -EINVAL;
-  }
-
-  return 0;
-}
-
 namespace {
   class BadCrushMap : public std::runtime_error {
   public:
index 0982f342a3a24085830a31590eff2c383ce5997f..e58c24875749ccb24542dc6df709700de616ccb8 100644 (file)
@@ -359,10 +359,6 @@ public:
   void check_overlapped_rules() const;
   int test();
   int test_with_fork(int timeout);
-  int test_with_crushtool(const char *crushtool_cmd = "crushtool",
-                         int max_id = -1,
-                         int timeout = 0,
-                         int ruleset = -1);
 };
 
 #endif