Debian support.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Sun, 4 Mar 2012 22:21:33 +0000 (22:21 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Sun, 4 Mar 2012 22:21:33 +0000 (22:21 +0000)
org.glite.testsuites.ctb/LB/tests/lb-common.sh
org.glite.testsuites.ctb/LB/tests/lb-test-ws.sh

index d4be7d6..874f941 100755 (executable)
@@ -125,6 +125,7 @@ SYS_RPM=rpm
 SYS_WC=wc
 SYS_LS=ls
 SYS_STAT=stat
+SYS_DPKG_QUERY=dpkg-query
 
 # not used at the moment
 DEBUG=2
index 0c165f3..6d35f4f 100755 (executable)
@@ -211,19 +211,25 @@ fi
                        localname=`$SYS_HOSTNAME -f`
 
                        if [ "$servername" = "$localname" ]; then
-                               printf "Get rpm version... "
-                               rpmversion=`$SYS_RPM -qi glite-lb-ws-interface | $SYS_GREP -E "^Version" | $SYS_SED 's/^Version\s*:\s*//' | $SYS_SED 's/\s.*$//'`
+                               egrep -i "Debian|Ubuntu" /etc/issue >/dev/null 2>&1
+                               if [ $? = 0 ]; then
+                                       printf "Get dpkg version... "
+                                       sysversion=`$SYS_DPKG_QUERY -W glite-lb-ws-interface | $SYS_SED 's/^[^\s]*\s\+//' | $SYS_SED 's/-.*//'`
+                               else
+                                       printf "Get rpm version... "
+                                       sysversion=`$SYS_RPM -qi glite-lb-ws-interface | $SYS_GREP -E "^Version" | $SYS_SED 's/^Version\s*:\s*//' | $SYS_SED 's/\s.*$//'`
+                               fi
 
-                               if [ "$rpmversion" = "" ]; then
-                                       printf "Unable to detect rpm version"
+                               if [ "$sysversion" = "" ]; then
+                                       printf "Unable to detect installed package version"
                                        test_skipped
                                else
-                                       printf "$rpmversion"
+                                       printf "$sysversion"
                                        test_done
 
-                                       printf "Comparing versions ($wsglifver = $rpmversion)... "
+                                       printf "Comparing versions ($wsglifver = $sysversion)... "
 
-                                       if [ "$wsglifver" = "$rpmversion" ]; then
+                                       if [ "$wsglifver" = "$sysversion" ]; then
                                                test_done
                                        else
                                                test_failed