[Nagiosplug-devel] [Fwd: [Nagiosplug-checkins] SF.net SVN: nagiosplug: [1889] nagiosplug/trunk/lib/tests/test_cmd.c]
Thomas Guyot-Sionnest
dermoth at aei.ca
Sun Jan 6 08:25:19 CET 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Just a note about this, On all tested systems (Ubuntu, FreeBSD, Solaris)
/bin/sh returned 2 except for Solaris where it returned 1.
Also Bash is installed on Solaris and Ubuntu and using /bin/bash
returned 127.
All shells tested returned 127 when calling a non-existent file from
within the shell though.
If we want to specifically test the return status I suggest we do it as
a separate test, like doing something like:
strcpy(command, "/bin/sh -c 'exit 7'");
result = cmd_run (command, &chld_out, &chld_err, 0);
ok (result == 7, "Get return code 7 from /bin/sh");
Which seems to work well on all shells tested
Thomas
- -------- Original Message --------
Subject: [Nagiosplug-checkins] SF.net SVN: nagiosplug: [1889]
nagiosplug/trunk/lib/tests/test_cmd.c
Date: Sat, 05 Jan 2008 23:04:10 -0800
From: dermoth at users.sourceforge.net
Reply-To: nagiosplug-devel at lists.sourceforge.net
To: nagiosplug-checkins at lists.sourceforge.net
Revision: 1889
http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1889&view=rev
Author: dermoth
Date: 2008-01-05 23:04:10 -0800 (Sat, 05 Jan 2008)
Log Message:
- -----------
Fix tinderbox breakage
Modified Paths:
- --------------
nagiosplug/trunk/lib/tests/test_cmd.c
Modified: nagiosplug/trunk/lib/tests/test_cmd.c
===================================================================
- --- nagiosplug/trunk/lib/tests/test_cmd.c 2008-01-06 00:10:49 UTC (rev
1888)
+++ nagiosplug/trunk/lib/tests/test_cmd.c 2008-01-06 07:04:10 UTC (rev 1889)
@@ -202,7 +202,7 @@
ok (chld_err.lines == 1,
"...but does give an error line");
ok (strstr(chld_err.line[0],"non-existant-file") != NULL, "And missing
filename is in error message");
- - ok (result == 127, "Get return code 127 from /bin/sh");
+ ok (result != 0, "Get non-zero return code from /bin/sh");
/* ensure everything is empty again */
This was sent by the SourceForge.net collaborative development platform,
the world's largest Open Source development site.
- -------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagiosplug-checkins mailing list
Nagiosplug-checkins at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagiosplug-checkins
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHgIJf6dZ+Kt5BchYRAgnHAJwJQKLCoeq1bV920XFOnoCTE5mDvACeJVQf
abBfZskBd7bfWXxhNTmhhpI=
=MmPC
-----END PGP SIGNATURE-----
More information about the Devel
mailing list