]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/test_admin_socket_output: allow different asok directory 20371/head
authorKefu Chai <kchai@redhat.com>
Thu, 8 Feb 2018 11:09:25 +0000 (19:09 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 8 Feb 2018 14:37:54 +0000 (22:37 +0800)
the asok files are not necessary located in ./out, actually, they are
put in $TMPDIR/ceph-asok.$random_stuff .

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/admin_socket_output.h
src/test/test_admin_socket_output.cc

index 1eda77430c911ab1d6845639d7fc4afb6adc2af9..3be7311907fb5d5799e52dd83bc8398a926376c3 100644 (file)
@@ -41,8 +41,8 @@ public:
 
   void exec();
 
-  void mod_for_vstart() {
-    socketdir = "./out";
+  void mod_for_vstart(const std::string& dir) {
+    socketdir = dir;
     prefix = "";
   }
 
index 7e1b35d0aacc2b9b993eb16dfbf94358d3ae7b59..9ce244e6341f8ec1835cfda41c9e52c0f7850fe1 100644 (file)
@@ -58,7 +58,8 @@ int main(int argc, char** argv) {
     ("mgr", "Test mgr admin socket output")
     ("mds", "Test mds admin socket output")
     ("client", "Test client (includes rgw) admin socket output")
-    ("vstart", "Modify to run in vstart environment")
+    ("vstart", po::value<std::string>()->implicit_value("./out"),
+     "Modify to run in vstart environment")
     ;
   auto parsed =
     po::command_line_parser(argc, argv).options(desc).allow_unregistered().run();
@@ -80,7 +81,7 @@ int main(int argc, char** argv) {
   std::unique_ptr<AdminSocketOutput> asockout(new AdminSocketOutput);
 
   if (vm.count("vstart")) {
-    asockout->mod_for_vstart();
+    asockout->mod_for_vstart(vm["vstart"].as<std::string>());
   }
 
   if(vm.count("all")) {