Re: [Nagios-devel] Libtap to include in Nagios code

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Libtap to include in Nagios code

Post by Guest »


--Apple-Mail-4-533227186
Content-Type: text/plain;
charset=US-ASCII;
format=flowed;
delsp=yes
Content-Transfer-Encoding: 7bit


On 19 May 2009, at 23:54, Andreas Ericsson wrote:

> Go right ahead imo.

OK, libtap is now included. I've updated the developer documentation
so that it includes general information about testing and how it all
fits together:
http://community.nagios.org/wiki/index. ... es#Testing

As an example, I've added in testing for the logging.c:rotate_log_file
subroutine in t-tap/test_logging.c. I've also merged in a patch from
the Opsview version of Nagios where the nagios.log file is recreated
after a rotate and is given the same permissions as the existing
nagios.log (required in Opsview due to security reasons). The last
test in test_logging.c fails before the patch, but now works correctly
with the patch.

Take a look at test_logging.c for how to write tests and how to pass
dummy data in and checking for correctness.

As of now, running "make test" does 47 tests which all pass. And only
takes 1.5s on my macbook to run. Hooray!

Can I encourage all developers and all patch submitters to include
test cases with their changes to beef up the testing.

Let me know if there are any problems because I am super keen on
adding more testing into Nagios.

Ton


--Apple-Mail-4-533227186
Content-Type: text/html;
charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On 19 May 2009, =
at 23:54, Andreas Ericsson wrote:Go =
right ahead imo.OK, libtap is now =
included. I've updated the developer documentation so that it includes =
general information about testing and how it all fits =
together:  http://community.nagios.org/wiki/index. ... lines#Tes=
tingAs an example, I've added in testing =
for the logging.c:rotate_log_file subroutine in t-tap/test_logging.c. =
I've also merged in a patch from the Opsview version of Nagios where the =
nagios.log file is recreated after a rotate and is given the same =
permissions as the existing nagios.log (required in Opsview due to =
security reasons). The last test in test_logging.c fails before the =
patch, but now works correctly with the =
patch.Take a look at test_logging.c for how to =
write tests and how to pass dummy data in and checking for =
correctness.As of now, running "make test" =
does 47 tests which all pass. And only takes 1.5s on my macbook to run. =
Hooray!Can I encourage all developers and all =
patch submitters to include test cases with their changes to beef up the =
testing.Let me know if there are any problems =
because I am super keen on adding more testing into =
Nagios.Ton=

--Apple-Mail-4-533227186--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked