[omd-commits] OMD Git: omd: tests: fixed check for valid symlink of /omd

git version control git at mathias-kettner.de
Sat Dec 18 17:43:47 CET 2010


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

Author: Sven Nierlein <sven at nierlein.de>
Date:   Sat Dec 18 17:43:19 2010 +0100

tests: fixed check for valid symlink of /omd

---

 t/TestUtils.pm |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/t/TestUtils.pm b/t/TestUtils.pm
index ae39a2d..e3510bb 100644
--- a/t/TestUtils.pm
+++ b/t/TestUtils.pm
@@ -56,11 +56,18 @@ sub get_omd_bin {
     else {
         if(-s '/omd') {
             my $target = readlink('/omd');
-            if($target ne getcwd()."/destdir/omd") {
-                BAIL_OUT('symlink for /omd already exists but is wrong: should be: '.getcwd().'/destdir/omd but got: '.$target);
+            if($omd_bin eq '/usr/bin/omd') {
+                if($target ne "/opt/omd") {
+                    BAIL_OUT('symlink for /omd already exists but is wrong: should be: /opt/omd but got: '.$target);
+                }
+            }
+            elsif($omd_bin eq 'destdir/opt/omd/versions/default/bin/omd') {
+                if($target ne getcwd()."/destdir/omd") {
+                    BAIL_OUT('symlink for /omd already exists but is wrong: should be: '.getcwd().'/destdir/omd but got: '.$target);
+                }
             }
         } else {
-            BAIL_OUT('cannot run tests, /omd has to be a symlink to '.getcwd().'/destdir/omd in order to run tests for the source version');
+            BAIL_OUT('cannot run tests, /omd has to be a symlink to '.getcwd().'/destdir/omd (or /opt/omd for testing packages) in order to run tests for the source version');
         }
     }
 



More information about the omd-commits mailing list