[icinga-checkins] icinga.org: icinga-core/master: fix broken t-tap tests

git at icinga.org git at icinga.org
Fri Nov 5 08:30:55 CET 2010


Module: icinga-core
Branch: master
Commit: 260c624c133a92d1c59d4af85ab567b7fdea8d03
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=260c624c133a92d1c59d4af85ab567b7fdea8d03

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Mon Oct 25 18:35:07 2010 +0200

fix broken t-tap tests

$ ./configure --enable-libtap
$ make all
$ make test

will give numerous errors, but will compile at least.

more fixing needed then.

---

 t-tap/test_checks.c        |    8 +++++++
 t-tap/test_icinga_config.c |   46 +++++++++++++++++++++++++++++++++++--------
 t-tap/test_logging.c       |   15 +++++++++----
 t-tap/test_timeperiods.c   |   16 +++++++++++++++
 t-tap/var/.gitignore       |    2 +
 5 files changed, 73 insertions(+), 14 deletions(-)

diff --git a/t-tap/test_checks.c b/t-tap/test_checks.c
index 59517e3..7e97bfe 100644
--- a/t-tap/test_checks.c
+++ b/t-tap/test_checks.c
@@ -93,6 +93,10 @@ int      time_change_threshold;
 host     *host_list;
 service  *service_list;
 
+/* Icinga special */
+int      stalking_event_handlers_for_hosts;
+int      stalking_event_handlers_for_services;
+
 int check_for_expired_comment(unsigned long temp_long) {}
 void broker_timed_event(int int1, int int2, int int3, timed_event *timed_event1, struct timeval *timeval1) {}
 int check_for_expired_downtime(void) {}
@@ -220,6 +224,10 @@ int enable_predictive_host_dependency_checks=DEFAULT_ENABLE_PREDICTIVE_HOST_DEPE
 int log_host_event(host *hst){}
 int handle_host_state(host *hst){}
 
+/* Icinga special */
+int has_shell_metachars(const char *s){}
+int handle_host_event(host *hst){}
+
 
 void
 setup_objects(time_t time) {
diff --git a/t-tap/test_icinga_config.c b/t-tap/test_icinga_config.c
index 9c141b2..5c4507d 100644
--- a/t-tap/test_icinga_config.c
+++ b/t-tap/test_icinga_config.c
@@ -121,13 +121,6 @@ int             auto_rescheduling_window=DEFAULT_AUTO_RESCHEDULING_WINDOW;
 
 int             additional_freshness_latency=DEFAULT_ADDITIONAL_FRESHNESS_LATENCY;
 
-int             check_for_updates=DEFAULT_CHECK_FOR_UPDATES;
-int             bare_update_check=DEFAULT_BARE_UPDATE_CHECK;
-time_t          last_update_check=0L;
-int             update_available=FALSE;
-char            *last_program_version=NULL;
-char            *new_program_version=NULL;
-
 time_t          last_command_check=0L;
 time_t          last_command_status_update=0L;
 time_t          last_log_rotation=0L;
@@ -261,18 +254,40 @@ int             debug_level=DEFAULT_DEBUG_LEVEL;
 int             debug_verbosity=DEFAULT_DEBUG_VERBOSITY;
 unsigned long   max_debug_file_size=DEFAULT_MAX_DEBUG_FILE_SIZE;
 
+/* Icinga special */
+int             use_daemon_log=DEFAULT_USE_DAEMON_LOG;
+
+int             use_syslog_local_facility=DEFAULT_USE_SYSLOG_LOCAL_FACILITY;
+int             syslog_local_facility=DEFAULT_SYSLOG_LOCAL_FACILITY;
+
+int             log_current_states=DEFAULT_LOG_CURRENT_STATES;
+
+int             log_external_commands_user=DEFAULT_LOG_EXTERNAL_COMMANDS_USER;
+
+int             log_long_plugin_output=DEFAULT_LOG_LONG_PLUGIN_OUTPUT;
+
+int             service_check_timeout_state=STATE_CRITICAL;
+
+int             stalking_event_handlers_for_hosts=DEFAULT_STALKING_EVENT_HANDLERS_FOR_HOSTS;
+int             stalking_event_handlers_for_services=DEFAULT_STALKING_EVENT_HANDLERS_FOR_SERVICES;
+
 
 /* Dummy variables */
 sched_info scheduling_info;
 timed_event event_list_low;
 timed_event event_list_high;
+timed_event *event_list_high_tail=NULL;
 
 /* Dummy functions */
 void logit(int data_type, int display, const char *fmt, ...) {}
 int my_sendall(int s, char *buf, int *len, int timeout) {}
-void free_comment_data(void) {}
 int write_to_log(char *buffer, unsigned long data_type, time_t *timestamp) {}
-int log_debug_info(int level,int verbosity,const char *fmt, ...) {}
+int log_debug_info(int level,int verbosity,const char *fmt, ...) {
+        va_list ap;
+        va_start(ap, fmt);
+        /* vprintf( fmt, ap ); */
+        va_end(ap);
+}
 
 int neb_free_callback_list(void) {}
 void broker_program_status(int type, int flags, int attr, struct timeval *timestamp){}
@@ -287,6 +302,19 @@ int schedule_new_event(int event_type, int high_priority, time_t run_time, int r
 int my_tcp_connect(char *host_name, int port, int *sd, int timeout){}
 int my_recvall(int s, char *buf, int *len, int timeout){}
 int neb_free_module_list(void){}
+void remove_event(timed_event *event, timed_event **event_list, timed_event **event_list_tail){}
+void check_for_service_flapping(service *svc, int update, int allow_flapstart_notification){}
+int update_host_status(host *hst,int aggregated_dump){}
+int update_contact_status(contact *cntct,int aggregated_dump){}
+time_t get_next_service_notification_time(service *temp_service, time_t time_t1) {}
+void broker_retention_data(int type, int flags, int attr, struct timeval *timestamp){}
+int host_notification(host *hst, int type, char *not_author, char *not_data, int options){}
+void broker_downtime_data(int type, int flags, int attr, int downtime_type, char *host_name, char *svc_description, time_t entry_time, char *author_name, char *comment_data, time_t start_time, time_t end_time, int fixed, unsigned long triggered_by, unsigned long duration, unsigned long downtime_id, struct timeval *timestamp){}
+int update_service_status(service *svc,int aggregated_dump){}
+time_t get_next_host_notification_time(host *temp_host,time_t time_t1) {}
+void check_for_host_flapping(host *hst, int update, int actual_check, int allow_flapstart_notification){}
+int service_notification(service *svc, int type, char *not_author, char *not_data, int options){}
+
 
 int main(int argc, char **argv){
 	int result;
diff --git a/t-tap/test_logging.c b/t-tap/test_logging.c
index c56f785..6145f4f 100644
--- a/t-tap/test_logging.c
+++ b/t-tap/test_logging.c
@@ -1,19 +1,19 @@
 /*****************************************************************************
-* 
+*
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
-* 
+*
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
-* 
+*
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
-* 
-* 
+*
+*
 *****************************************************************************/
 
 #define NSCORE 1
@@ -28,9 +28,14 @@ char *log_archive_path="var";
 char *macro_x[1];
 host *host_list=NULL;
 service *service_list=NULL;
+int use_daemon_log=1;
 int use_syslog=0;
+int use_syslog_local_facility=0;
+int syslog_local_facility;
 int log_service_retries;
 int log_initial_states;
+int log_current_states;
+int log_long_plugin_output=0;
 unsigned long logging_options=NSLOG_PROCESS_INFO;
 unsigned long syslog_options;
 int verify_config;
diff --git a/t-tap/test_timeperiods.c b/t-tap/test_timeperiods.c
index 68ff441..dd1b946 100644
--- a/t-tap/test_timeperiods.c
+++ b/t-tap/test_timeperiods.c
@@ -254,6 +254,22 @@ int             debug_level=DEFAULT_DEBUG_LEVEL;
 int             debug_verbosity=DEFAULT_DEBUG_VERBOSITY;
 unsigned long   max_debug_file_size=DEFAULT_MAX_DEBUG_FILE_SIZE;
 
+/* Icinga special */
+int             use_daemon_log=DEFAULT_USE_DAEMON_LOG;
+
+int             use_syslog_local_facility=DEFAULT_USE_SYSLOG_LOCAL_FACILITY;
+int             syslog_local_facility=DEFAULT_SYSLOG_LOCAL_FACILITY;
+
+int             log_current_states=DEFAULT_LOG_CURRENT_STATES;
+
+int             log_external_commands_user=DEFAULT_LOG_EXTERNAL_COMMANDS_USER;
+
+int             log_long_plugin_output=DEFAULT_LOG_LONG_PLUGIN_OUTPUT;
+
+int             service_check_timeout_state=STATE_CRITICAL;
+
+int             stalking_event_handlers_for_hosts=DEFAULT_STALKING_EVENT_HANDLERS_FOR_HOSTS;
+int             stalking_event_handlers_for_services=DEFAULT_STALKING_EVENT_HANDLERS_FOR_SERVICES;
 
 /* Dummy variables */
 sched_info scheduling_info;
diff --git a/t-tap/var/.gitignore b/t-tap/var/.gitignore
new file mode 100644
index 0000000..8ea1c42
--- /dev/null
+++ b/t-tap/var/.gitignore
@@ -0,0 +1,2 @@
+icinga.log
+icinga-05-22-2009-00.log





More information about the icinga-checkins mailing list