Unverified Commit 12da61b6 authored by David Boucher's avatar David Boucher Committed by GitHub
Browse files

Mon 4520 connector deadlock (#11)

* cleanup(perl/checks): headers coding style

* cleanup(perl/orders): headers coding style

* cleanup(perl): headers coding style updated

* cleanup(perl/checks): c++ files coding style updated

* cleanup(perl/orders): c++ files coding style updated

* cleanup(perl): c++ files coding style updated

* fix(ssh): Failing tests compilation enabled.

* cleanup(ssh/checks): headers coding style updaed

* cleanup(ssh/orders): headers coding style updated

* cleanup(ssh/sessions): headers coding style updated

* cleanup(ssh): headers coding style updated

* cleanup(ssh/checks): c++ files coding style updated

* cleanup(ssh): c++ files coding style updated

* cleanup(ssh/orders): c++ files coding style updated

* cleanup(ssh/sessions): c++ files coding style updated

* cleanup(ssh/test/checks): c++ files coding style updated

* cleanup(tasks): classes inherited from tasks are updated to match clib

* cleanup(pipe_handle/buffer_handle): classes updated due to changes in clib::handle.

* fix(various): multiplexer is restored and listeners are cleanup

* cleanup(various): Many little changes

* fix(session): Deadlock fixed.

* cleanup(reporter): Not needed code removed.

* cleanup(orders/parser): unused code removed.

* cleanup(ssh/session): unused functions removed

* cleanup(parser/reporter): unused functions removed - changes due to handle_listener changes

* cleanup(gitignore): little update

* fix(perl): clib singletons api is changed.

* fix(ssh): clib singletons api changed

* fix(ssh/test/timeout): clib singletons api changed

* cleanup(ssh/test/orders): c++ files coding style updated

* fix(ssh/test/reporter): clib singletons api changed

* cleanup(ssh/test/credentials): c++ files coding style updated

* cleanup(benchmark): coding style updated

* fix(perl/options): unused code removed.
parent 9ab53ad6
ssh/build
**/.*.swp
perl/src/xs_init.cc
perl/test/connector/paths.hh
ssh/test/connector/binary.hh
......@@ -125,13 +125,11 @@ set(CONNECTORLIB "centreonconnectorperl")
add_library("${CONNECTORLIB}" STATIC
# Sources.
"${SRC_DIR}/checks/check.cc"
"${SRC_DIR}/checks/listener.cc"
"${SRC_DIR}/checks/result.cc"
"${SRC_DIR}/checks/timeout.cc"
"${SRC_DIR}/embedded_perl.cc"
"${SRC_DIR}/multiplexer.cc"
"${SRC_DIR}/options.cc"
"${SRC_DIR}/orders/listener.cc"
"${SRC_DIR}/orders/parser.cc"
"${SRC_DIR}/pipe_handle.cc"
"${SRC_DIR}/policy.cc"
......@@ -182,6 +180,15 @@ install(TARGETS "${CONNECTOR}"
# Packaging.
include("package.cmake")
# Code coverage on unit tests
option(WITH_COVERAGE "Add code coverage on unit tests." OFF)
if (WITH_COVERAGE)
set(WITH_TESTING ON)
set(CMAKE_BUILD_TYPE "Debug")
include(CodeCoverage.cmake)
APPEND_COVERAGE_COMPILER_FLAGS()
endif ()
# Testing.
option(WITH_TESTING "Build unit tests." OFF)
if (WITH_TESTING)
......@@ -196,30 +203,37 @@ if (WITH_TESTING)
"${TEST_DIR}/connector/paths.hh.in"
"${TEST_DIR}/connector/paths.hh")
# Embedded Perl tests.
# Simple script execution #1.
set(TEST_NAME "embedded_perl_run_simple_1")
add_executable("${TEST_NAME}"
"${TEST_DIR}/embedded_perl/run_simple_1.cc")
target_link_libraries("${TEST_NAME}" ${CONNECTORLIB})
add_test("${TEST_NAME}" "${TEST_NAME}")
# Simple script execution #2.
set(TEST_NAME "embedded_perl_run_simple_2")
add_executable("${TEST_NAME}"
"${TEST_DIR}/embedded_perl/run_simple_2.cc")
target_link_libraries("${TEST_NAME}" ${CONNECTORLIB})
add_test("${TEST_NAME}" "${TEST_NAME}")
set(CONNECTOR_TEST_LIST
${TEST_DIR}/embedded_perl/run_simple_1.cc
${TEST_DIR}/embedded_perl/run_simple_2.cc
)
foreach (name ${CONNECTOR_TEST_LIST})
# name cc file => bin_name binary name
string(REGEX REPLACE "^${TEST_DIR}/" "" bin_name ${name})
string(REGEX REPLACE "/" "_" bin_name ${bin_name})
string(REGEX REPLACE ".cc$" "" bin_name ${bin_name})
add_executable("${bin_name}" "${name}")
target_link_libraries("${bin_name}" "${CONNECTORLIB}")
add_test("${bin_name}" "${bin_name}")
list(APPEND TEST_BIN_LIST ${bin_name})
endforeach ()
#
# Process tests.
#
# Help.
add_test("connector_help" "${CONNECTOR}" "--help")
list(APPEND TEST_BIN_TEST "connector_help")
# Version.
add_test("connector_version" "${CONNECTOR}" "--version")
list(APPEND TEST_BIN_TEST "connector_version")
# Invalid flag.
add_test("connector_invalid_flag" "${CONNECTOR}" "--merethis")
list(APPEND TEST_BIN_LIST "connector_invalid_flag")
set_tests_properties("connector_invalid_flag"
PROPERTIES WILL_FAIL TRUE)
# Execution library.
......@@ -227,60 +241,47 @@ if (WITH_TESTING)
"${TEST_DIR}/connector/misc.cc"
"${TEST_DIR}/connector/misc.hh")
set(TEST_LIBRARIES ${CLIB_LIBRARIES} "test_execute")
# EOF on stdin.
set(TEST_NAME "connector_eof_on_stdin")
add_executable("${TEST_NAME}"
"${TEST_DIR}/connector/eof_on_stdin.cc")
target_link_libraries("${TEST_NAME}" ${CLIB_LIBRARIES})
add_test("${TEST_NAME}" "${TEST_NAME}")
# Non-existent script.
set(TEST_NAME "connector_non_existent_script")
add_executable("${TEST_NAME}"
"${TEST_DIR}/connector/non_existent_script.cc")
target_link_libraries("${TEST_NAME}" ${TEST_LIBRARIES})
add_test("${TEST_NAME}" "${TEST_NAME}")
# Graceful timeout.
set(TEST_NAME "connector_timeout_term")
add_executable("${TEST_NAME}"
"${TEST_DIR}/connector/timeout_term.cc")
target_link_libraries("${TEST_NAME}" ${TEST_LIBRARIES})
add_test("${TEST_NAME}" "${TEST_NAME}")
# Forced timeout.
set(TEST_NAME "connector_timeout_kill")
add_executable("${TEST_NAME}"
"${TEST_DIR}/connector/timeout_kill.cc")
target_link_libraries("${TEST_NAME}" ${TEST_LIBRARIES})
add_test("${TEST_NAME}" "${TEST_NAME}")
# Single script execution.
set(TEST_NAME "connector_execute_single_script")
add_executable("${TEST_NAME}"
"${TEST_DIR}/connector/execute_single_script.cc")
target_link_libraries("${TEST_NAME}" ${TEST_LIBRARIES})
add_test("${TEST_NAME}" "${TEST_NAME}")
# Single script execution with log file.
set(TEST_NAME "connector_execute_single_script_log_file")
add_executable("${TEST_NAME}"
"${TEST_DIR}/connector/execute_single_script_log_file.cc")
target_link_libraries("${TEST_NAME}" ${TEST_LIBRARIES})
add_test("${TEST_NAME}" "${TEST_NAME}")
# Multiple script execution.
set(TEST_NAME "connector_execute_multiple_scripts")
add_executable("${TEST_NAME}"
"${TEST_DIR}/connector/execute_multiple_scripts.cc")
target_link_libraries("${TEST_NAME}" ${TEST_LIBRARIES})
add_test("${TEST_NAME}" "${TEST_NAME}")
# Additional code.
set(TEST_NAME "connector_execute_with_additional_code")
add_executable("${TEST_NAME}"
"${TEST_DIR}/connector/execute_with_additional_code.cc")
target_link_libraries("${TEST_NAME}" ${TEST_LIBRARIES})
add_test("${TEST_NAME}" "${TEST_NAME}")
# Module loading from script.
set(TEST_NAME "connector_execute_module_loading")
add_executable("${TEST_NAME}"
"${TEST_DIR}/connector/execute_module_loading.cc")
target_link_libraries("${TEST_NAME}" ${TEST_LIBRARIES})
add_test("${TEST_NAME}" "${TEST_NAME}")
list(APPEND TEST_BIN_LIST "connector_eof_on_stdin")
set(TEST_LIST
${TEST_DIR}/connector/non_existent_script.cc
${TEST_DIR}/connector/timeout_term.cc
${TEST_DIR}/connector/timeout_kill.cc
${TEST_DIR}/connector/execute_single_script.cc
${TEST_DIR}/connector/execute_single_script_log_file.cc
${TEST_DIR}/connector/execute_multiple_scripts.cc
${TEST_DIR}/connector/execute_with_additional_code.cc
${TEST_DIR}/connector/execute_module_loading.cc
)
foreach (name ${TEST_LIST})
# name cc file => bin_name binary name
string(REGEX REPLACE "^${TEST_DIR}/" "" bin_name ${name})
string(REGEX REPLACE "/" "_" bin_name ${bin_name})
string(REGEX REPLACE ".cc$" "" bin_name ${bin_name})
add_executable("${bin_name}" "${name}")
target_link_libraries("${bin_name}" "${TEST_LIBRARIES}")
add_test("${bin_name}" "${bin_name}")
list(APPEND TEST_BIN_LIST ${bin_name})
endforeach ()
if (WITH_COVERAGE)
set(COVERAGE_EXCLUDES '${PROJECT_BINARY_DIR}/*' '${PROJECT_SOURCE_DIR}/test/*' '/usr/include/*')
SETUP_TARGET_FOR_COVERAGE(
NAME test-coverage
EXECUTABLE ctest
DEPENDENCIES
${TEST_BIN_LIST}
)
endif ()
endif ()
......
# Copyright (c) 2012 - 2017, Lars Bilke
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# CHANGES:
#
# 2012-01-31, Lars Bilke
# - Enable Code Coverage
#
# 2013-09-17, Joakim Söderberg
# - Added support for Clang.
# - Some additional usage instructions.
#
# 2016-02-03, Lars Bilke
# - Refactored functions to use named parameters
#
# 2017-06-02, Lars Bilke
# - Merged with modified version from github.com/ufz/ogs
#
#
# USAGE:
#
# 1. Copy this file into your cmake modules path.
#
# 2. Add the following line to your CMakeLists.txt:
# include(CodeCoverage)
#
# 3. Append necessary compiler flags:
# APPEND_COVERAGE_COMPILER_FLAGS()
#
# 4. If you need to exclude additional directories from the report, specify them
# using the COVERAGE_EXCLUDES variable before calling SETUP_TARGET_FOR_COVERAGE.
# Example:
# set(COVERAGE_EXCLUDES 'dir1/*' 'dir2/*')
#
# 5. Use the functions described below to create a custom make target which
# runs your test executable and produces a code coverage report.
#
# 6. Build a Debug build:
# cmake -DCMAKE_BUILD_TYPE=Debug ..
# make
# make my_coverage_target
#
include(CMakeParseArguments)
# Check prereqs
find_program( GCOV_PATH gcov )
find_program( LCOV_PATH lcov )
find_program( GENHTML_PATH genhtml )
find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
find_program( SIMPLE_PYTHON_EXECUTABLE python )
if(NOT GCOV_PATH)
message(FATAL_ERROR "gcov not found! Aborting...")
endif() # NOT GCOV_PATH
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3)
message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
endif()
elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
endif()
set(COVERAGE_COMPILER_FLAGS "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
CACHE INTERNAL "")
set(CMAKE_CXX_FLAGS_COVERAGE
${COVERAGE_COMPILER_FLAGS}
CACHE STRING "Flags used by the C++ compiler during coverage builds."
FORCE )
set(CMAKE_C_FLAGS_COVERAGE
${COVERAGE_COMPILER_FLAGS}
CACHE STRING "Flags used by the C compiler during coverage builds."
FORCE )
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
""
CACHE STRING "Flags used for linking binaries during coverage builds."
FORCE )
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
""
CACHE STRING "Flags used by the shared libraries linker during coverage builds."
FORCE )
mark_as_advanced(
CMAKE_CXX_FLAGS_COVERAGE
CMAKE_C_FLAGS_COVERAGE
CMAKE_EXE_LINKER_FLAGS_COVERAGE
CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
link_libraries(gcov)
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
endif()
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# SETUP_TARGET_FOR_COVERAGE(
# NAME testrunner_coverage # New target name
# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES testrunner # Dependencies to build first
# )
function(SETUP_TARGET_FOR_COVERAGE)
set(options NONE)
set(oneValueArgs NAME)
set(multiValueArgs EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT LCOV_PATH)
message(FATAL_ERROR "lcov not found! Aborting...")
endif() # NOT LCOV_PATH
if(NOT GENHTML_PATH)
message(FATAL_ERROR "genhtml not found! Aborting...")
endif() # NOT GENHTML_PATH
# Setup target
add_custom_target(${Coverage_NAME}
# Cleanup lcov
COMMAND ${LCOV_PATH} --directory . --zerocounters
# Run tests
COMMAND ${Coverage_EXECUTABLE}
# Capturing lcov counters and generating report
COMMAND ${LCOV_PATH} --directory . --capture --output-file ${Coverage_NAME}.info
COMMAND ${LCOV_PATH} --remove ${Coverage_NAME}.info ${COVERAGE_EXCLUDES} --output-file ${Coverage_NAME}.info.cleaned
COMMAND ${GENHTML_PATH} -o ${Coverage_NAME} ${Coverage_NAME}.info.cleaned
COMMAND ${CMAKE_COMMAND} -E remove ${Coverage_NAME}.info ${Coverage_NAME}.info.cleaned
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
)
# Show info where to find the report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
)
endfunction() # SETUP_TARGET_FOR_COVERAGE
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# SETUP_TARGET_FOR_COVERAGE_COBERTURA(
# NAME ctest_coverage # New target name
# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES executable_target # Dependencies to build first
# )
function(SETUP_TARGET_FOR_COVERAGE_COBERTURA)
set(options NONE)
set(oneValueArgs NAME)
set(multiValueArgs EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT SIMPLE_PYTHON_EXECUTABLE)
message(FATAL_ERROR "python not found! Aborting...")
endif() # NOT SIMPLE_PYTHON_EXECUTABLE
if(NOT GCOVR_PATH)
message(FATAL_ERROR "gcovr not found! Aborting...")
endif() # NOT GCOVR_PATH
# Combine excludes to several -e arguments
set(COBERTURA_EXCLUDES "")
foreach(EXCLUDE ${COVERAGE_EXCLUDES})
set(COBERTURA_EXCLUDES "-e ${EXCLUDE} ${COBERTURA_EXCLUDES}")
endforeach()
add_custom_target(${Coverage_NAME}
# Run tests
${Coverage_EXECUTABLE}
# Running gcovr
COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} ${COBERTURA_EXCLUDES}
-o ${Coverage_NAME}.xml
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
COMMENT "Running gcovr to produce Cobertura code coverage report."
)
# Show info where to find the report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml."
)
endfunction() # SETUP_TARGET_FOR_COVERAGE_COBERTURA
function(APPEND_COVERAGE_COMPILER_FLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
endfunction() # APPEND_COVERAGE_COMPILER_FLAGS
......@@ -17,60 +17,57 @@
*/
#ifndef CCCP_CHECKS_CHECK_HH
# define CCCP_CHECKS_CHECK_HH
#define CCCP_CHECKS_CHECK_HH
# include <string>
# include <sys/types.h>
# include "com/centreon/connector/perl/namespace.hh"
# include "com/centreon/connector/perl/pipe_handle.hh"
# include "com/centreon/handle_listener.hh"
#include <sys/types.h>
#include <string>
#include "com/centreon/connector/perl/namespace.hh"
#include "com/centreon/connector/perl/pipe_handle.hh"
#include "com/centreon/handle_listener.hh"
CCCP_BEGIN()
namespace checks {
// Forward declarations.
class listener;
class result;
namespace checks {
// Forward declarations.
class listener;
class result;
/**
* @class check check.hh "com/centreon/connector/perl/checks/check.hh"
* @brief Perl check.
*
* Class wrapping a Perl check as requested by the monitoring engine.
*/
class check : public handle_listener {
public:
check();
~check() throw ();
void error(handle& h);
pid_t execute(
unsigned long long cmd_id,
std::string const& cmd,
time_t tmt);
void listen(listener* listnr);
void on_timeout(bool final = true);
void read(handle& h);
void terminated(int exit_code);
void unlisten(listener* listnr);
bool want_read(handle& h);
void write(handle& h);
/**
* @class check check.hh "com/centreon/connector/perl/checks/check.hh"
* @brief Perl check.
*
* Class wrapping a Perl check as requested by the monitoring engine.
*/
class check : public handle_listener {
public:
check();
~check() throw();
void error(handle& h);
pid_t execute(unsigned long long cmd_id, std::string const& cmd, time_t tmt);
void listen(listener* listnr);
void on_timeout(bool final = true);
void read(handle& h);
void terminated(int exit_code);
void unlisten(listener* listnr);
bool want_read(handle& h);
void write(handle& h);
private:
check(check const& c);
check& operator=(check const& c);
void _send_result_and_unregister(result const& r);
private:
check(check const& c);
check& operator=(check const& c);
void _send_result_and_unregister(result const& r);
pid_t _child;
unsigned long long _cmd_id;
pipe_handle _err;
listener* _listnr;
pipe_handle _out;
std::string _stderr;
std::string _stdout;
unsigned long _timeout;
};
}
pid_t _child;
unsigned long long _cmd_id;
pipe_handle _err;
listener* _listnr;
pipe_handle _out;
std::string _stderr;
std::string _stdout;
unsigned long _timeout;
};
} // namespace checks
CCCP_END()
#endif // !CCCP_CHECKS_CHECK_HH
#endif // !CCCP_CHECKS_CHECK_HH
......@@ -17,30 +17,30 @@
*/
#ifndef CCCP_CHECKS_LISTENER_HH
# define CCCP_CHECKS_LISTENER_HH
#define CCCP_CHECKS_LISTENER_HH
# include "com/centreon/connector/perl/checks/result.hh"
# include "com/centreon/connector/perl/namespace.hh"
#include "com/centreon/connector/perl/checks/result.hh"
#include "com/centreon/connector/perl/namespace.hh"
CCCP_BEGIN()
namespace checks {
/**
* @class listener listener.hh "com/centreon/connector/perl/checks/listener.hh"
* @brief Check listener.
*
* Listen check events.
*/
class listener {
public:
listener();
listener(listener const& l);
virtual ~listener();
listener& operator=(listener const& l);
virtual void on_result(result const& result) = 0;
};
}
namespace checks {
/**
* @class listener listener.hh "com/centreon/connector/perl/checks/listener.hh"
* @brief Check listener.
*
* Listen check events.
*/
class listener {
public:
listener() = default;
listener(listener const& l) = delete;
virtual ~listener() = default;
listener& operator=(listener const& l) = delete;
virtual void on_result(result const& result) = 0;
};
} // namespace checks
CCCP_END()
#endif // !CCCP_CHECKS_LISTENER_HH
#endif // !CCCP_CHECKS_LISTENER_HH
......@@ -17,48 +17,48 @@
*/
#ifndef CCCP_CHECKS_RESULT_HH
# define CCCP_CHECKS_RESULT_HH
#define CCCP_CHECKS_RESULT_HH
# include <string>
# include "com/centreon/connector/perl/namespace.hh"
#include <string>
#include "com/centreon/connector/perl/namespace.hh"
CCCP_BEGIN()
namespace checks {
/**
* @class result result.hh "com/centreon/connector/perl/checks/result.hh"
* @brief Check result.
*
* Store check result.
*/
class result {
public:
result();
result(result const& r);
~result();
result& operator=(result const& r);
unsigned long long get_command_id() const throw ();
std::string const& get_error() const throw ();
bool get_executed() const throw ();
int get_exit_code() const throw ();
std::string const& get_output() const throw ();
void set_command_id(unsigned long long cmd_id) throw ();
void set_error(std::string const& error);