I had to write a testing suite for a few servers. The most rudimentary test I had to do was ping. Each server had various IPs and since I'm not the one who configured them, I had to make sure whoever did configure them did a good job. Also, some programs ({open,}ssh) do not check if a host is up before trying to connect, so a later test could hang.
This was apparent when one of the servers' IPs' was changed, and all subsequent tests weren't run because the ping test failed. Thank you for regression tests.
Long story short, I wrote Test::Ping to make it easier to test pings on machines. It will support the different behavior and variables of Net::Ping. In fact, that's what it's based on. Here is a sample:
use Test::More tests => 3; use Test::Ping; foreach my $host ( qw( server1 server2 server3 ) ) { ping_ok( $host, "$host is up!" ); }
There is a working prototype already on GitHub and hopefully I'll get it out on CPAN soon enough.
It might seem too easy or mundane, but I like it and it's another testing module to make things a tad easier.
Do you have a link to your GitHub repo? Cheers.
Feel free to ignore the first few initial releases. The GitHub address is: http://github.com/xsawyerx/test-ping/tree/master.
I also got approved to post it to CPAN so I'll be doing it tomorrow and update the blog entry.
Thanks!
Actually, that's the web - here's the git clone
xsawyerx on 2009-04-22T21:41:31
git://github.com/xsawyerx/test-ping.git