X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftest%2Fadmin_socket_output.h;fp=src%2Fceph%2Fsrc%2Ftest%2Fadmin_socket_output.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=28f65767f91abc7ea15c6b5faa1ec83929aff955;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/test/admin_socket_output.h b/src/ceph/src/test/admin_socket_output.h deleted file mode 100644 index 28f6576..0000000 --- a/src/ceph/src/test/admin_socket_output.h +++ /dev/null @@ -1,78 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -/* - * Ceph - scalable distributed file system - * - * Copyright (C) 2017 Red Hat - * - * This is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software - * Foundation. See file COPYING. - * - */ - -#ifndef CEPH_ADMIN_SOCKET_OUTPUT_H -#define CEPH_ADMIN_SOCKET_OUTPUT_H - -#include -#include -#include -#include - -#include // For path -#include // For exists, is_directory - -namespace bfs = boost::filesystem; - -using socket_results = std::map; -using test_functions = - std::vector>; - -class AdminSocketClient; - -class AdminSocketOutput { -public: - AdminSocketOutput() {} - - void add_target(const std::string &target); - void add_command(const std::string &target, const std::string &command); - void add_test(const std::string &target, const std::string &command, - bool (*test)(std::string &)); - void postpone(const std::string &target, const std::string &command); - - void exec(); - - void mod_for_vstart() { - socketdir = "./out"; - prefix = ""; - } - -private: - bool init_directories() const { - std::cout << "Checking " << socketdir << std::endl; - return exists(socketdir) && is_directory(socketdir); - } - - bool init_sockets(); - bool gather_socket_output(); - std::string get_result(const std::string target, const std::string command) const; - - std::pair - run_command(AdminSocketClient &client, const std::string raw_command, - bool send_untouched = false); - - bool run_tests() const; - - std::set targets; - std::map sockets; - std::map results; - std::map> custom_commands; - std::map> postponed_commands; - std::map tests; - - std::string prefix = "ceph-"; - bfs::path socketdir = "/var/run/ceph"; -}; - -#endif // CEPH_ADMIN_SOCKET_OUTPUT_H