Learn to check and download common definitions
authorZdeněk Šustr <sustr4@cesnet.cz>
Mon, 27 Feb 2012 12:37:30 +0000 (12:37 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Mon, 27 Feb 2012 12:37:30 +0000 (12:37 +0000)
org.glite.testsuites.ctb/gridsite/tests/gridsite-test-packaging.sh

index 7fe1068..55f48d3 100755 (executable)
@@ -48,13 +48,20 @@ EndHelpHeader
 }
 
 # read common definitions and functions
-COMMON=gridsite-common.sh
-if [ ! -r ${COMMON} ]; then
-       printf "Common definitions '${COMMON}' missing!"
-       exit 2
-fi
-source ${COMMON}
-source lb-common.sh
+for COMMON in gridsite-common.sh lb-common.sh
+do
+        if [ ! -r ${COMMON} ]; then
+                printf "Downloading common definitions '${COMMON}'"
+                wget -O ${COMMON} http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi/org.glite.testsuites.ctb/gridsite/tests/$COMMON?view=co > /dev/null
+                if [ ! -r ${COMMON} ]; then
+                        exit 2
+                else
+                        chmod +x $COMMON
+                        test_done
+                fi
+        fi
+       source $COMMON
+done
 
 while test -n "$1"
 do