I use the perl Test framework to test lots-a-things. These are all crude test examples below -
# check webservice like( `lynx http://tiago.com -head -dump`, qr/200 OK/, 'HEAD request using lynx' ); # disk space for (`df`) { my ($filesystem, $use) = /^(\S+) .+ (\d+)%/; next unless ($filesystem && $use); ok($use < 70, "$use \%filesystem"); } # running daemons my @ps = `ps -e`; for my $daemon (qw(crond syslogd ntpd)) { my $cnt = grep /$daemon/, @ps; ok($cnt, "$daemon ($cnt)"); } # software version like( `nmap --version`, qr/\W3\.\d/, 'nmap version test' ); # binaries and path for my $bin ('ping','kill','pod2text', 'nslookup', 'tail') { my $loc = `which $bin`; chomp $loc; ok(stat($loc), $loc); ok(-x _, 'executable by effective uid/gid'); } # ping the machine $ip = '66.39.54.27'; my $ret = join('', `ping -c 5 -W 1 $ip`); like($ret, qr/ 0\% packet loss/, 'packet loss'); + # DNS $ip = '66.39.54.27'; $name = 'perlmonks.org'; like(`host $ip`, qr/$name/, 'DNS'); like(`host $name`, qr/$ip/, 'reverse DNS');
It's also not hard to make other languages output in the format usable by Test::Harness, so incidently, if anyone care to make a shell library of functions that mimic the Test::More module, drop me a note, I'm interested.

Tiago

In reply to Re: using Test::* modules for generic testing of non perl stuff? by tstock
in thread using Test::* modules for generic testing of non perl stuff? by jfroebe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.