From 3b69f134671e60eb5de0ca895177064294b6eb78 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Tue, 20 Jan 2009 23:55:34 -0500 Subject: [PATCH] Some platform are missing setenv Instead of adding the gnulib module for solving tests only I split the test in two, setting environment from Perl for the later. --- configure.in | 2 +- lib/tests/Makefile.am | 6 +- lib/tests/test_opts.t | 6 - lib/tests/test_opts1 | Bin 0 -> 34139 bytes lib/tests/{test_opts.c => test_opts1.c} | 90 +------------- lib/tests/test_opts1.t | 6 + lib/tests/test_opts2 | Bin 0 -> 35227 bytes lib/tests/test_opts2.c | 151 ++++++++++++++++++++++++ lib/tests/test_opts2.t | 7 ++ 9 files changed, 169 insertions(+), 99 deletions(-) delete mode 100755 lib/tests/test_opts.t create mode 100755 lib/tests/test_opts1 rename lib/tests/{test_opts.c => test_opts1.c} (61%) create mode 100755 lib/tests/test_opts1.t create mode 100755 lib/tests/test_opts2 create mode 100644 lib/tests/test_opts2.c create mode 100755 lib/tests/test_opts2.t diff --git a/configure.in b/configure.in index eb27d6a..107cfd9 100644 --- a/configure.in +++ b/configure.in @@ -188,7 +188,7 @@ AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"]) if test "$enable_extra_opts" = "yes" ; then AC_DEFINE(NP_EXTRA_OPTS,[1],[Enable INI file parsing.]) if test "$enable_libtap" = "yes"; then - EXTRA_TEST="$EXTRA_TEST test_ini test_opts" + EXTRA_TEST="$EXTRA_TEST test_ini test_opts1 test_opts2" AC_SUBST(EXTRA_TEST) fi fi diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am index a59a653..f36c0be 100644 --- a/lib/tests/Makefile.am +++ b/lib/tests/Makefile.am @@ -7,9 +7,9 @@ check_PROGRAMS = @EXTRA_TEST@ INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins -EXTRA_PROGRAMS = test_utils test_disk test_tcp test_cmd test_base64 test_ini test_opts +EXTRA_PROGRAMS = test_utils test_disk test_tcp test_cmd test_base64 test_ini test_opts1 test_opts2 -np_test_scripts = test_base64.t test_cmd.t test_disk.t test_ini.t test_opts.t test_tcp.t test_utils.t +np_test_scripts = test_base64.t test_cmd.t test_disk.t test_ini.t test_opts1.t test_opts2.t test_tcp.t test_utils.t np_test_files = config-dos.ini config-opts.ini config-tiny.ini plugin.ini plugins.ini EXTRA_DIST = $(np_test_scripts) $(np_test_files) @@ -28,7 +28,7 @@ AM_CFLAGS = -g -I$(top_srcdir)/lib -I$(top_srcdir)/gl $(tap_cflags) AM_LDFLAGS = $(tap_ldflags) -ltap LDADD = $(top_srcdir)/lib/libnagiosplug.a $(top_srcdir)/gl/libgnu.a -SOURCES = test_utils.c test_disk.c test_tcp.c test_cmd.c test_base64.c test_ini.c test_opts.c +SOURCES = test_utils.c test_disk.c test_tcp.c test_cmd.c test_base64.c test_ini.c test_opts1.c test_opts2.c test: ${noinst_PROGRAMS} perl -MTest::Harness -e '$$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS) diff --git a/lib/tests/test_opts.t b/lib/tests/test_opts.t deleted file mode 100755 index d69b8f1..0000000 --- a/lib/tests/test_opts.t +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/perl -use Test::More; -if (! -e "./test_opts") { - plan skip_all => "./test_opts not compiled - please install tap library and/or enable parse-ini to test"; -} -exec "./test_opts"; diff --git a/lib/tests/test_opts1 b/lib/tests/test_opts1 new file mode 100755 index 0000000000000000000000000000000000000000..cab0f2a0e54efef62bbefa1525dff77117851a15 GIT binary patch literal 34139 zcmdsg3w%`7wfC8s41{L_h$7ND$U|Z!1QZM}9l*gsQBc6*m3t?XWI|H&YGwwZH5D6U znNHKvTCRS!x24w4Vt?%|y|-4hg~Ue<+E=Q*8eg}mReQ#uH?`WPO3nBGuf6xonL`5J zd;8tr_xm=?S$nO$*4k^Y{XF~ZlXG)u{aUZbW0~N!F1Cp6ofH(3x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Lr z6xm+iR2i+0$WyOKG`Z8l6RqZYd~>wAbjiZ<3#?{>g_e3^R-J5U*kv*ZU3F7u0z z7g-Tx8KIA@NL76-+K3OqMq)ehE-jp)Gm!TWy>(*F&TB$x1>pTspJ{B7cI=>04 zKPro3aWEE-OdFf=*<8NKT~`y~n}rtM3XI63N0q6{2weC^ZLUywV%dn2=c~?svp1hy z7uV&7_Z`id?P{1$1~VIe$Tk_5Z~W$~;+JmoDXI|qd%yWfVq*i=(az$lcS!ST@`d4i z(g~m5btThD{P-~rK-5=fKSZ3*#5S#)RCOI5d^AwOHnX$DIUAcxS%eQA%g3AZN#^h&+HGS56@|C>&1ahP z866!$#s&3d=X@TN4PStE(d1jrE*eHKJxZu91VOxnEH&7;!^N9u!Dp!RX^{vH9O!=R z{-|}1^Fqsf96Lv&7tkbb#9Pno$vAPLd$W8>I-ifd$n-J!9Cd!OX<0G^I)(!^5~#sK zN{5jX)uBFtov%W=Uh}SeV)kR;`DFb8?tCI`h*w3MF(_*nIzAwt&x+=Nw}Ra?`DC|? unBQmBr?>N2^!LK^iIJF`1(E4S`2h0@ztIg!J||4U%lY{ "./test_opts1 not compiled - please install tap library and/or enable parse-ini to test"; +} +exec "./test_opts1"; diff --git a/lib/tests/test_opts2 b/lib/tests/test_opts2 new file mode 100755 index 0000000000000000000000000000000000000000..226fe9190cec87f2bd53b08830c26adba1b2a310 GIT binary patch literal 35227 zcmeHw3w&HvwfCNxOq)KF(iRG>GNmmvg{Em~p%03amMK#RP@$C~=wzBq+R(hr%=DpF z9%-<1hiFBsTt2TaBhv6>Sq9lEU>~gZPMwpW)>_W9l^^XapqR|G)O$lQSo2 z%e|l9{e6$S+nlx6+H0-7_S(<0&z^H`i&U-i`+Uj ztA?TY0`v_prD_@9e+{_^!v(O41wpXT%Do$MwDau-Yv-bd`Yo3%UDQy!u%W&wy=&pF z<(DkHWNCS_xqOM(UkZiH^2%$q1FS!+{5+&B!rxi=n~gtPUx=zRctN-be;43yKK@GZ z$8fd=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qXF|5CrjKWU0ZX9Uk6PD?VdiNQ=dA;K1}_ zX%y&}HQTnwIOYv=E>-d5Xk8mkVkdt6%$|%B7p6DMr|5@e=`Hpm+sEW{_Jzr|Wyuie z8V>YGpa%;n9Y#)6M_o-rb8=)`XsT)1U8onwL~FKl^eZIer^hYv8V`{+$eUPdVW_we zCm=_cM{~fhg9~*+re?GXb2r7ho%oryCtHl%{Hb}NvRFdSg2;5EeSmodt*{l8LQa^1 OAL$p;. +* +*****************************************************************************/ + +#include "common.h" +#include "utils_base.h" +#include "extra_opts.h" + +#include "tap.h" + +void my_free(int *argc, char **argv) { + int i; + printf (" Arg(%i): ", *argc); + for (i=1; i<*argc; i++) printf ("'%s' ", argv[i]); + printf ("\n"); + free(argv); + *argc=0; +} + +int array_diff(int i1, char **a1, int i2, char **a2) { + int i; + + if (i1 != i2) { + printf(" Argument count doesn't match!\n"); + return 0; + } + for (i=0; i<=i1; i++) { + if (a1[i]==NULL && a2[i]==NULL) continue; + if (a1[i]==NULL || a2[i]==NULL) { + printf(" Argument # %i null in one array!\n", i); + return 0; + } + if (strcmp(a1[i], a2[i])) { + printf(" Argument # %i doesn't match!\n", i); + return 0; + } + } + return 1; +} + +int +main (int argc, char **argv) +{ + char **argv_test=NULL, **argv_known=NULL; + int i, argc_test; + + plan_tests(5); + + argv_test=(char **)malloc(6*sizeof(char **)); + argv_test[0] = "prog_name"; + argv_test[1] = "arg1"; + argv_test[2] = "--extra-opts"; + argv_test[3] = "--arg3"; + argv_test[4] = "val2"; + argv_test[5] = NULL; + argc_test=5; + argv_known=(char **)realloc(argv_known, 6*sizeof(char **)); + argv_known[0] = "prog_name"; + argv_known[1] = "--foo=bar"; + argv_known[2] = "arg1"; + argv_known[3] = "--arg3"; + argv_known[4] = "val2"; + argv_known[5] = NULL; + argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); + ok(array_diff(argc_test, argv_test, 5, argv_known), "Default section 1"); + + argv_test=(char **)malloc(3*sizeof(char **)); + argv_test[0] = "prog_name"; + argv_test[1] = "--extra-opts"; + argv_test[2] = NULL; + argc_test=2; + argv_known=(char **)realloc(argv_known, 3*sizeof(char **)); + argv_known[0] = "prog_name"; + argv_known[1] = "--foo=bar"; + argv_known[2] = NULL; + argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); + ok(array_diff(argc_test, argv_test, 2, argv_known), "Default section 2"); + my_free(&argc_test,argv_test); + + argv_test=(char **)malloc(6*sizeof(char **)); + argv_test[0] = "prog_name"; + argv_test[1] = "arg1"; + argv_test[2] = "--extra-opts=section1"; + argv_test[3] = "--arg3"; + argv_test[4] = "val2"; + argv_test[5] = NULL; + argc_test=5; + argv_known=(char **)realloc(argv_known, 6*sizeof(char **)); + argv_known[0] = "prog_name"; + argv_known[1] = "--foobar=baz"; + argv_known[2] = "arg1"; + argv_known[3] = "--arg3"; + argv_known[4] = "val2"; + argv_known[5] = NULL; + argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); + ok(array_diff(argc_test, argv_test, 5, argv_known), "Default section 3"); + my_free(&argc_test,argv_test); + + argv_test=(char **)malloc(6*sizeof(char **)); + argv_test[0] = "prog_name"; + argv_test[1] = "arg1"; + argv_test[2] = "--extra-opts"; + argv_test[3] = "-arg3"; + argv_test[4] = "val2"; + argv_test[5] = NULL; + argc_test=5; + argv_known=(char **)realloc(argv_known, 6*sizeof(char **)); + argv_known[0] = "prog_name"; + argv_known[1] = "--foo=bar"; + argv_known[2] = "arg1"; + argv_known[3] = "-arg3"; + argv_known[4] = "val2"; + argv_known[5] = NULL; + argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); + ok(array_diff(argc_test, argv_test, 5, argv_known), "Default section 4"); + my_free(&argc_test,argv_test); + + argv_test=(char **)malloc(4*sizeof(char **)); + argv_test[0] = "check_tcp"; + argv_test[1] = "--extra-opts"; + argv_test[2] = "--extra-opts=tcp_long_lines"; + argv_test[3] = NULL; + argc_test=3; + argv_known=(char **)realloc(argv_known, 7*sizeof(char **)); + argv_known[0] = "check_tcp"; + argv_known[1] = "--timeout=10"; + argv_known[2] = "--escape"; + argv_known[3] = "--send=Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda"; + argv_known[4] = "--expect=Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda"; + argv_known[5] = "--jail"; + argv_known[6] = NULL; + argv_test=np_extra_opts(&argc_test, argv_test, "check_tcp"); + ok(array_diff(argc_test, argv_test, 6, argv_known), "Long lines test"); + my_free(&argc_test,argv_test); + + return exit_status(); +} + diff --git a/lib/tests/test_opts2.t b/lib/tests/test_opts2.t new file mode 100755 index 0000000..f7444f6 --- /dev/null +++ b/lib/tests/test_opts2.t @@ -0,0 +1,7 @@ +#!/usr/bin/perl +use Test::More; +if (! -e "./test_opts2") { + plan skip_all => "./test_opts2 not compiled - please install tap library and/or enable parse-ini to test"; +} +$ENV{"NAGIOS_CONFIG_PATH"} = "."; +exec "./test_opts2"; -- 2.30.2