12 use lib
"$FindBin::Bin/lib/lib/perl5";
16 ##################################################
17 # create our test site
18 my $omd_bin = TestUtils
::get_omd_bin
();
19 my $site = TestUtils
::create_test_site
() or TestUtils
::bail_out_clean
("no further testing without site");
21 ##################################################
24 { cmd
=> "/bin/su - $site -c '/usr/bin/env cpan.wrapper'", stdin
=> "yes\n", like
=> '/cpan\[1\]>/' },
25 { cmd
=> "/bin/su - $site -c '/usr/bin/env cpan'", stdin
=> "yes\n", like
=> '/cpan\[1\]>/' },
27 for my $test (@
{$tests}) {
28 TestUtils
::test_command
($test);
31 ##################################################
32 TestUtils
::test_command
({ cmd
=> "/bin/su - $site -c 'perl -e \"use RRDs 1.4004;\"'" });
34 ##################################################
35 for my $tarball (glob("packages/perl-modules/src/*.gz packages/perl-modules/src/*.zip")) {
36 $tarball =~ s/^.*\///mx
;
37 my($mod, $version) = BuildHelper
::file_to_module
($tarball);
40 if($mod eq 'Package::DeprecationManager') { $version .= ' -deprecations => { blah => foo }'; }
41 if($mod eq 'Filter::exec') { $version .= " 'test'"; }
42 if($mod eq 'Term::ReadLine::Gnu') { $mod = 'Term::ReadLine; use Term::ReadLine::Gnu' }
43 if($mod eq 'Module::Install') { $mod = 'inc::'.$mod; }
44 if($mod eq 'File::ChangeNotify') { next; }
45 if($mod eq 'UNIVERSAL::isa') { next; }
46 if($mod eq 'Filter::exec') { next; } # broken version string
47 if($mod eq 'Sub::Exporter::Progressive') { next; }
48 if($mod eq 'DBD::Oracle') { next; }
49 if($mod eq 'IO') { $version .= " qw/File/"; } # Parameterless "use IO" deprecated at...
50 if($mod =~ m/curl/imx) { next; } # broken
52 my $check = "use $mod";
53 # Use with version doesnt work here, because of weird version numbers
54 $check .= " $version" unless $mod =~ /^(Math::BaseCnv|XML::Tidy)$/;
56 TestUtils
::test_command
({ cmd
=> "/bin/su - $site -c 'perl -e \"$check;\"'" });
59 ##################################################
61 skip
('Author test. Set $ENV{TEST_AUTHOR} to a true value to run.', 4) unless $ENV{TEST_AUTHOR
};
63 { cmd
=> "/bin/su - $site -c '/usr/bin/env cpan'", stdin
=> "notest install Traceroute::Similar\n", like
=> '/install\s+\-\-\s+OK/' },
65 for my $author_test (@
{$author_tests}) {
66 TestUtils
::test_command
($author_test);
70 ##################################################
72 TestUtils
::remove_test_site
($site);