small fixes
authorGianni Pucciani <Gianni.Pucciani@cern.ch>
Mon, 1 Sep 2008 12:10:25 +0000 (12:10 +0000)
committerGianni Pucciani <Gianni.Pucciani@cern.ch>
Mon, 1 Sep 2008 12:10:25 +0000 (12:10 +0000)
org.glite.testsuites.ctb/LB/lb-common.sh
org.glite.testsuites.ctb/LB/lb-test-logger-remote.sh

index 509c7ef..5e31f6b 100755 (executable)
@@ -74,12 +74,23 @@ function check_exec()
                return $TEST_ERROR
        fi
        # XXX: maybe use bash's command type?
-       local ret=`which $1`
-       if [ $? -eq 0 ] && [ -x $ret ]; then 
-               return $TEST_OK
-       else
-               return $TEST_ERROR
-       fi
+       which $1 > /dev/null 2>&1
+    if [ $? -eq 0 ]; then
+        local ret=`which $1`
+        if [ -x "$ret" ]; then
+            return $TEST_OK
+        else 
+            return $TEST_ERROR
+        fi
+    else 
+        return $TEST_ERROR
+    fi
+    
+#      if [ $? -eq 0 ] && [ -x "$ret" ]; then 
+#        return $TEST_OK
+#      else
+#              return $TEST_ERROR
+#      fi
 }
 
 function check_binaries()
index 33942ed..e421c69 100755 (executable)
@@ -73,15 +73,20 @@ source ${COMMON}
 
 DEBUG=2
 
-##
-#  Starting the test
-#####################
+if [ -z "$SAME_SENSOR_HOME" ]; then
+    echo "SAME_SENSOR_HOME not set"
+    exit 2
+fi
+
+######################
+# Starting the test  #
+######################
 
 {
 test_start
 
 # check_binaries
-printf "Testing if all binaries are available"
+printf "Testing if all binaries are available\n"
 check_binaries
 if [ $? -gt 0 ]; then
         test_failed
@@ -90,7 +95,7 @@ else
 fi
 
 # ping_host:
-printf "Testing ping to LB logger ${LB_HOST}"
+printf "Testing ping to LB logger ${LB_HOST}\n"
 ping_host ${LB_HOST}
 if [ $? -gt 0 ]; then
        test_failed
@@ -100,7 +105,7 @@ else
 fi
  
 # check_services
-printf "Testing LB logger at ${LB_HOST}:${GLITE_LB_LOGGER_PORT} (logging)"
+printf "Testing LB logger at ${LB_HOST}:${GLITE_LB_LOGGER_PORT} (logging)\n"
 check_socket ${LB_HOST} ${GLITE_LB_LOGGER_PORT}
 if [ $? -gt 0 ]; then
        test_failed