X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftest%2Fadmin_socket_output_tests.cc;fp=src%2Fceph%2Fsrc%2Ftest%2Fadmin_socket_output_tests.cc;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=72a573b78092718d4696dbd64894470254af4c68;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/test/admin_socket_output_tests.cc b/src/ceph/src/test/admin_socket_output_tests.cc deleted file mode 100644 index 72a573b..0000000 --- a/src/ceph/src/test/admin_socket_output_tests.cc +++ /dev/null @@ -1,66 +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. - * - */ - -#include -#include - -#include "common/ceph_json.h" - -// Test functions - -// Example test function -/* -bool test_config_get_admin_socket(std::string& output) { - return std::string::npos != output.find("admin_socket") && - std::string::npos != output.rfind(".asok"); -} -*/ - -bool test_dump_pgstate_history(std::string &output) { - JSONParser parser; - bool ret = parser.parse(output.c_str(), output.size()); - if (!ret) { - std::cerr << "test_dump_pgstate_history: parse error" << std::endl; - return false; - } - - JSONObjIter iter = parser.find_first(); - for (; !iter.end(); ++iter) { - if ((*iter)->get_name() == "pg") { - ret = !(*iter)->get_data().empty(); - if (ret == false) { - std::cerr << "test_dump_pgstate_history: pg value empty, failing" - << std::endl; - std::cerr << "Dumping full output: " << std::endl; - std::cerr << output << std::endl; - break; - } - } else if ((*iter)->get_name() == "history") { - ret = std::string::npos != (*iter)->get_data().find("epoch") && - std::string::npos != (*iter)->get_data().find("state") && - std::string::npos != (*iter)->get_data().find("Initial") && - std::string::npos != (*iter)->get_data().find("enter") && - std::string::npos != (*iter)->get_data().find("exit"); - if (ret == false) { - std::cerr << "test_dump_pgstate_history: Can't find expected values in " - "history object, failing" - << std::endl; - std::cerr << "Problem output was:" << std::endl; - std::cerr << (*iter)->get_data() << std::endl; - break; - } - } - } - return ret; -}