From 4f32b629906f078ea81637829dde136a27b214e5 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 13 Jun 2008 17:21:03 +0200 Subject: begun building a testbench --- tests/rt-init.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/rt-init.c (limited to 'tests/rt-init.c') diff --git a/tests/rt-init.c b/tests/rt-init.c new file mode 100644 index 00000000..aaac7ed1 --- /dev/null +++ b/tests/rt-init.c @@ -0,0 +1,44 @@ +/* This test checks runtime initialization and exit. Other than that, it + * also serves as the most simplistic sample of how a test can be coded. + * + * Part of the testbench for rsyslog. + * Copyright 2008 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of rsyslog. + * + * Rsyslog 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. + * + * Rsyslog 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 Rsyslog. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + */ +#include + +#include "rsyslog.h" +#include "testbench.h" + +MODULE_TYPE_TESTBENCH + + +BEGINInit +CODESTARTInit +ENDInit + +BEGINExit +CODESTARTExit +ENDExit + +BEGINTest +CODESTARTTest +finalize_it: + /* room for custom error reporter, leave blank if not needed */ +ENDTest -- cgit v1.2.3 From d080ffe467f6f58be82ee14dbeed94026002f1e0 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 3 Mar 2010 09:24:40 +0100 Subject: reordered some include, because otherwise we get zlib-related errors on some platforms (namely Debian sid). This smells like a bug in zlib. Thanks to Michael Biebl for reporting the issue. --- tests/rt-init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests/rt-init.c') diff --git a/tests/rt-init.c b/tests/rt-init.c index aaac7ed1..b9c4ce2e 100644 --- a/tests/rt-init.c +++ b/tests/rt-init.c @@ -21,10 +21,9 @@ * * A copy of the GPL can be found in the file "COPYING" in this distribution. */ -#include - #include "rsyslog.h" #include "testbench.h" +#include /* must be last, else we get a zlib compile error on some platforms */ MODULE_TYPE_TESTBENCH -- cgit v1.2.3 From cd8c6abcc8cea54924e55dffe820364ad98a40df Mon Sep 17 00:00:00 2001 From: Yann Droneaud Date: Thu, 4 Mar 2010 08:00:39 +0100 Subject: Includes "config.h" before any other header. For consistency, ./configure generated "config.h" must be the first header include through out the project. Signed-off-by: Rainer Gerhards --- tests/rt-init.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/rt-init.c') diff --git a/tests/rt-init.c b/tests/rt-init.c index b9c4ce2e..66a9ad32 100644 --- a/tests/rt-init.c +++ b/tests/rt-init.c @@ -21,6 +21,7 @@ * * A copy of the GPL can be found in the file "COPYING" in this distribution. */ +#include "config.h" #include "rsyslog.h" #include "testbench.h" #include /* must be last, else we get a zlib compile error on some platforms */ -- cgit v1.2.3 From 2cd132eebb84dbcffcf0c20b9354c14f797c29cd Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 7 Apr 2010 12:42:41 +0200 Subject: enhanced nettester tool so that it re-uses it's callers environment this enables us to work with the "usual" environment tweaks (for debugging and other purposes), without the need for any special handling in nettester itself --- tests/rt-init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/rt-init.c') diff --git a/tests/rt-init.c b/tests/rt-init.c index 66a9ad32..dbe94b4a 100644 --- a/tests/rt-init.c +++ b/tests/rt-init.c @@ -39,6 +39,6 @@ ENDExit BEGINTest CODESTARTTest -finalize_it: +/*finalize_it:*/ /* room for custom error reporter, leave blank if not needed */ ENDTest -- cgit v1.2.3 From d1eb6e0edc51a78f3209448e800b25eda50340f2 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Wed, 23 Feb 2011 11:25:43 +0100 Subject: added work-around for bug in gtls, which causes fd leak when using TLS The capability has been added for module to specify that they do not like being unloaded. related bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=222 Signed-off-by: Rainer Gerhards --- tests/rt-init.c | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/rt-init.c') diff --git a/tests/rt-init.c b/tests/rt-init.c index dbe94b4a..2d43943f 100644 --- a/tests/rt-init.c +++ b/tests/rt-init.c @@ -28,7 +28,6 @@ MODULE_TYPE_TESTBENCH - BEGINInit CODESTARTInit ENDInit -- cgit v1.2.3 From d348558a51402d08310d95cfd6e8a2d6b9fce1b2 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 19 Apr 2011 11:26:37 +0200 Subject: milestone: conf obj interface now utilzes rsconf_t --- tests/rt-init.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/rt-init.c') diff --git a/tests/rt-init.c b/tests/rt-init.c index 2d43943f..d3cf4698 100644 --- a/tests/rt-init.c +++ b/tests/rt-init.c @@ -26,6 +26,7 @@ #include "testbench.h" #include /* must be last, else we get a zlib compile error on some platforms */ +rsconf_t *ourConf; MODULE_TYPE_TESTBENCH BEGINInit -- cgit v1.2.3