Merge branch 'master' of mathias-kettner.de:omd
[omd.git] / t / 20-package_jmx4perl.t
blob6847685142b52c22a80714e566645bfa18cfa0fe
1 #!/usr/bin/env perl
3 use warnings;
4 use strict;
5 use Test::More;
7 BEGIN {
8 use lib('t');
9 require TestUtils;
10 import TestUtils;
11 use FindBin;
12 use lib "$FindBin::Bin/lib/lib/perl5";
15 plan( tests => 22 );
17 ##################################################
18 # create our test site
19 my $omd_bin = TestUtils::get_omd_bin();
20 my $site = TestUtils::create_test_site() or TestUtils::bail_out_clean("no further testing without site");
22 ##################################################
23 # execute some checks
24 my $tests = [
25 { cmd => "/bin/su - $site -c 'lib/nagios/plugins/check_jmx4perl'", exit => 3, like => '/No Server/' },
26 { cmd => "/bin/su - $site -c 'jmx4perl --help'", like => '/jmx4perl/' },
27 { cmd => "/bin/su - $site -c 'jolokia --help'", like => '/jolokia/' },
28 { cmd => "/bin/su - $site -c 'j4psh --version'", like => '/j4psh/' },
30 for my $test (@{$tests}) {
31 TestUtils::test_command($test);
34 # Test download and management of Jolokia agent
35 #TestUtils::test_command({cmd => "/bin/su - $site -c 'jolokia'", like => '/Saved/'});
36 #TestUtils::test_command({cmd => "/bin/su - $site -c 'jolokia jolokia.war'", like => '/Type.*war/'});
37 #TestUtils::test_command({cmd => "/bin/su - $site -c 'jolokia repack --security jolokia.war'", like => '/Added security/'});
38 #TestUtils::test_command({cmd => "/bin/su - $site -c 'jolokia jolokia.war'", like => '/Authentication\*enabled/'});
39 # Clean up
40 #`/bin/su - $site -c 'rm jolokia.war'`;
42 ##################################################
43 # cleanup test site
44 TestUtils::remove_test_site($site);