[omd-commits] OMD Git: omd: tests: fixed package installation on sles

git version control git at mathias-kettner.de
Tue Dec 21 23:25:32 CET 2010


Module: omd
Branch: master
Commit: 4d00c62401aeaec021ac0ebd53e8bcd75b20060a
URL:    http://omdistro.org/projects/omd/repository/revisions/4d00c62401aeaec021ac0ebd53e8bcd75b20060a

Author: Sven Nierlein <sven at nierlein.de>
Date:   Tue Dec 21 23:23:24 2010 +0100

tests: fixed package installation on sles

---

 t/TestUtils.pm |   10 ++++++----
 t/test_all.sh  |    2 ++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/t/TestUtils.pm b/t/TestUtils.pm
index 86dc2ff..42f1bff 100644
--- a/t/TestUtils.pm
+++ b/t/TestUtils.pm
@@ -99,10 +99,10 @@ sub read_distro_config {
 =cut
 sub test_command {
     my $test = shift;
-    my( $rc, $stderr);
+    my($rc, $stderr) = ( -1, '') ;
     my($prg,$arg) = split(/\s+/, $test->{'cmd'}, 2);
     my $t = Test::Cmd->new(prog => $prg, workdir => '') or die($!);
-    alarm(120);
+    alarm(300);
     eval {
         local $SIG{ALRM} = sub { die "timeout on cmd: ".$test->{'cmd'}."\n" };
         $t->run(args => $arg, stdin => $test->{'stdin'});
@@ -133,7 +133,7 @@ sub test_command {
     }
 
     # matches on stderr?
-    $test->{'errlike'} = '/^$/' unless exists $test->{'errlike'};
+    $test->{'errlike'} = '/^\s*$/' unless exists $test->{'errlike'};
     if(defined $test->{'errlike'}) {
         for my $expr (ref $test->{'errlike'} eq 'ARRAY' ? @{$test->{'errlike'}} : $test->{'errlike'} ) {
             like($stderr, $expr, "stderr like ".$expr) || diag("\ncmd: '".$test->{'cmd'}."' failed");
@@ -400,7 +400,9 @@ sub _get_url {
 =cut
 sub _clean_stderr {
     my $text = shift || '';
-    $text =~ s/\w+: Could not reliably determine the server's fully qualified domain name, using .*? for ServerName//;
+    $text =~ s/[\w\-]+: Could not reliably determine the server's fully qualified domain name, using .*? for ServerName//g;
+    $text =~ s/[\w\-]+: apr_sockaddr_info_get\(\) failed for \w+//gms;
+    $text =~ s/Syntax OK//g;
     return $text;
 }
 
diff --git a/t/test_all.sh b/t/test_all.sh
index 33143ce..9a3c6e4 100755
--- a/t/test_all.sh
+++ b/t/test_all.sh
@@ -14,6 +14,8 @@ fi
 if [ ! -z "$OMD_PACKAGE" ]; then
     echo "###################################################################"
 
+    OMD_PACKAGE=`ls -1 $OMD_PACKAGE | head -n 1`
+
     if [ ! -e "$OMD_PACKAGE" ]; then
         echo "cannot install $OMD_PACKAGE: no such file"
     fi



More information about the omd-commits mailing list