[Nagiosplug-checkins] SF.net SVN: nagiosplug:[2064] nagiosplug/trunk/lib/tests
dermoth at users.sourceforge.net
dermoth at users.sourceforge.net
Tue Nov 4 22:29:37 CET 2008
Revision: 2064
http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2064&view=rev
Author: dermoth
Date: 2008-11-04 21:29:36 +0000 (Tue, 04 Nov 2008)
Log Message:
-----------
Adding extra-opts check that crash on my prod servers (*** glibc detected *** malloc(): memory corruption: 0x0804e248 ***)
Modified Paths:
--------------
nagiosplug/trunk/lib/tests/plugins.ini
nagiosplug/trunk/lib/tests/test_opts.c
Modified: nagiosplug/trunk/lib/tests/plugins.ini
===================================================================
--- nagiosplug/trunk/lib/tests/plugins.ini 2008-11-04 17:41:53 UTC (rev 2063)
+++ nagiosplug/trunk/lib/tests/plugins.ini 2008-11-04 21:29:36 UTC (rev 2064)
@@ -5,3 +5,13 @@
[section1]
foobar=baz
+; defaults for check_tcp
+[check_tcp]
+timeout = 10
+
+[tcp_long_lines]
+escape =
+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
+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
+jail=
+
Modified: nagiosplug/trunk/lib/tests/test_opts.c
===================================================================
--- nagiosplug/trunk/lib/tests/test_opts.c 2008-11-04 17:41:53 UTC (rev 2063)
+++ nagiosplug/trunk/lib/tests/test_opts.c 2008-11-04 21:29:36 UTC (rev 2064)
@@ -273,6 +273,27 @@
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 at plugins.ini";
+ argv_test[3] = NULL;
+ argc_test=3;
+ argv_known=(char **)realloc(argv_known, 10*sizeof(char **));
+ argv_known[0] = "check_tcp";
+ argv_known[1] = "--timeout";
+ argv_known[2] = "10";
+ argv_known[3] = "--escape";
+ argv_known[4] = "--send";
+ argv_known[5] = "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[6] = "--expect";
+ argv_known[7] = "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[8] = "--jail";
+ argv_known[9] = NULL;
+ argv_test=np_extra_opts(&argc_test, argv_test, "check_tcp");
+ ok(array_diff(argc_test, argv_test, 9, argv_known), "Long lines test");
+ my_free(&argc_test,argv_test);
+
return exit_status();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list