Hopefully improve portability
authorZdeněk Šustr <sustr4@cesnet.cz>
Mon, 6 Feb 2012 15:44:45 +0000 (15:44 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Mon, 6 Feb 2012 15:44:45 +0000 (15:44 +0000)
org.glite.testsuites.ctb/LB/tests/lb-common-testbeds.sh
org.glite.testsuites.ctb/gridsite/tests/gridsite-common-testbeds.sh

index eef2c81..293236f 100755 (executable)
 # limitations under the License.
 #
 
+
 function gen_arrange_script()
 {
 remotehost=$1
 COPYPROXY=$2
 
+egrep -i "Debian|Ubuntu" /etc/issue
+if [ \$? = 0 ]; then
+       INSTALLCMD="apt-get install -q --yes"
+else
+       INSTALLCMD="yum install -q -y"
+fi
+
 cat << EndArrangeScript > arrange_lb_test_root.sh 
 CERTFILE=\$1
 GLITE_USER=\$2
@@ -34,16 +42,7 @@ echo "Output format:    \$OUTPUT_OPT "
 
 export LBTSTCOLS
 
-yum install -q -y globus-proxy-utils 
-yum install -q -y postgresql postgresql-server
-#Standard setup now uses production brokers. No need to install our own.
-#yum install -q -y activemq java-1.6.0-openjdk
-yum install -q -y emi-lb-nagios-plugins
-yum install -q -y voms-clients
-yum install -q -y curl
-yum install -q -y wget
-yum install -q -y sudo
-yum install -q -y bc
+${INSTALLCMD} globus-proxy-utils postgresql postgresql-server emi-lb-nagios-plugins voms-clients curl wget sudo bc
 
 /etc/init.d/postgresql initdb >/dev/null 2>&1
 /etc/init.d/postgresql start
@@ -69,14 +68,7 @@ CVSPATH=\`which cvs\`
 
 if [ "\$CVSPATH" = "" ]; then
         printf "CVS binary not present"
-        egrep -i "Debian|Ubuntu" /etc/issue
-
-        if [ \$? = 0 ]; then
-                apt-get install --yes cvs
-        else
-                yum install -y cvs
-        fi
-
+       ${INSTALLCMD} cvs
 fi
 
 glite_id=\`id -u \$GLITE_USER\`
index 4ad576e..162405b 100755 (executable)
@@ -30,6 +30,13 @@ for dir in /etc/httpd /etc/apache /etc/apache2; do
 done
 HTTPD_CONF=$HTTPD_CONFDIR/gridsite-webserver.conf
 
+egrep -i "Debian|Ubuntu" /etc/issue
+if [ \$? = 0 ]; then 
+        INSTALLCMD="apt-get install -q --yes"
+else
+        INSTALLCMD="yum install -q -y"
+fi
+
 cat << EndArrangeScript > arrange_gridsite_test_root.sh 
 CERTFILE=\$1
 GLITE_USER=\$2
@@ -43,9 +50,7 @@ echo "Output format:    \$OUTPUT_OPT "
 
 export GSTSTCOLS
 
-yum install -q -y voms-clients
-yum install -q -y httpd mod_ssl
-yum install -q -y curl wget nc lsof
+${INSTALLCMD} voms-clients httpd mod_ssl curl wget nc lsof
 
 
 sed -e '1,\$s!/usr/lib/httpd/modules/!modules/!' /usr/share/doc/gridsite-*/httpd-webserver.conf | sed 's!/var/www/html!/var/www/htdocs!' | sed "s/FULL.SERVER.NAME/\$(hostname -f)/" | sed "s/\(GridSiteGSIProxyLimit\)/# \1/"> $HTTPD_CONF
@@ -63,14 +68,7 @@ CVSPATH=\`which cvs\`
 
 if [ "\$CVSPATH" = "" ]; then
         printf "CVS binary not present"
-        egrep -i "Debian|Ubuntu" /etc/issue
-
-        if [ \$? = 0 ]; then
-                apt-get install --yes cvs
-        else
-                yum install -y cvs
-        fi
-
+       ${INSTALLCMD} cvs
 fi
 
 if [ $COPYPROXY -eq 1 ]; then