From 0c0709fa82049d9f8b8e18f551db599ab2a03444 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Mon, 6 Feb 2012 15:44:45 +0000 Subject: [PATCH] Hopefully improve portability --- .../LB/tests/lb-common-testbeds.sh | 28 ++++++++-------------- .../gridsite/tests/gridsite-common-testbeds.sh | 20 +++++++--------- 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/org.glite.testsuites.ctb/LB/tests/lb-common-testbeds.sh b/org.glite.testsuites.ctb/LB/tests/lb-common-testbeds.sh index eef2c81..293236f 100755 --- a/org.glite.testsuites.ctb/LB/tests/lb-common-testbeds.sh +++ b/org.glite.testsuites.ctb/LB/tests/lb-common-testbeds.sh @@ -16,11 +16,19 @@ # 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\` diff --git a/org.glite.testsuites.ctb/gridsite/tests/gridsite-common-testbeds.sh b/org.glite.testsuites.ctb/gridsite/tests/gridsite-common-testbeds.sh index 4ad576e..162405b 100755 --- a/org.glite.testsuites.ctb/gridsite/tests/gridsite-common-testbeds.sh +++ b/org.glite.testsuites.ctb/gridsite/tests/gridsite-common-testbeds.sh @@ -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 -- 1.8.2.3