- Write bug numbers where functionality test acts also as a regression test
authorZdeněk Šustr <sustr4@cesnet.cz>
Wed, 12 Oct 2011 14:19:45 +0000 (14:19 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Wed, 12 Oct 2011 14:19:45 +0000 (14:19 +0000)
- Support in lb-run-test for generated proxies.

org.glite.testsuites.ctb/LB/tests/lb-run-tests.sh
org.glite.testsuites.ctb/LB/tests/lb-test-bdii.sh
org.glite.testsuites.ctb/LB/tests/lb-test-https.sh
org.glite.testsuites.ctb/LB/tests/lb-test-job-registration.sh
org.glite.testsuites.ctb/LB/tests/lb-test-notif.sh
org.glite.testsuites.ctb/LB/tests/lb-test-proxy-delivery.sh
org.glite.testsuites.ctb/LB/tests/lb-test-statistics.sh
org.glite.testsuites.ctb/LB/tests/lb-test-threaded.sh
org.glite.testsuites.ctb/LB/tests/lb-test-ws.sh

index baa3dac..040ecda 100755 (executable)
@@ -36,6 +36,7 @@ EndHelpHeader
        echo "Usage: $progname [OPTIONS] hostname"
        echo "Options:"
        echo " -h | --help            Show this help message."
+       echo " -P | --no-proxy        Do not copy existing user proxy."
        echo " hostname               L&B server to use for testing."
 }
 
@@ -47,12 +48,15 @@ if [ ! -r ${COMMON} ]; then
 fi
 source ${COMMON}
 
+COPYPROXY=1
+
 #logfile=$$.tmp
 #flag=0
 while test -n "$1"
 do
        case "$1" in
                "-h" | "--help") showHelp && exit 2 ;;
+               "-P" | "--no-proxy") COPYPROXY=0 ;;
                *) remotehost=$1 
                        shift
                        outformat=$1
@@ -74,40 +78,50 @@ else
        test_done
 fi
 
-printf "Testing credentials"
-
-timeleft=`${GRIDPROXYINFO} | ${SYS_GREP} -E "^timeleft" | ${SYS_SED} "s/timeleft\s*:\s//"`
-
-if [ "$timeleft" = "" ]; then
-        test_failed
-        print_error "No credentials"
-else
-        if [ "$timeleft" = "0:00:00" ]; then
-                test_failed
-                print_error "Credentials expired"
-        else
-                test_done
-
-               # Get path to the proxy cert
-               printf "Getting proxy cert path... "
-
-               PROXYCERT=`${GRIDPROXYINFO} | ${SYS_GREP} -E "^path" | ${SYS_SED} "s/path\s*:\s//"`
-
-               if [ "$PROXYCERT" = "" ]; then
-                       test_failed
-                       print_error "Unable to identify the path to your proxy certificate"
-               else
-                       printf "$PROXYCERT"
-                       test_done
-
-                       printf "L&B server: '$remotehost'"
+printf "L&B server: '$remotehost'\n"
+if [ "$remotehost" == "" ]; then
+       printf "L&B server not specified, exittig...\n\n"
+       exit 1
+fi
 
-                       if [ "$remotehost" = "" ]; then
-                               test_failed
-                       else
-                               test_done
+if [ $COPYPROXY -eq 1 ]; then
+       printf "Testing credentials... "
+       timeleft=`${GRIDPROXYINFO} | ${SYS_GREP} -E "^timeleft" | ${SYS_SED} "s/timeleft\s*:\s//" 2> /dev/null`
+
+       if [ "$timeleft" = "" ]; then
+               printf "No credentials"
+               COPYPROXY=0
+               test_skipped
+       else
+               if [ "$timeleft" = "0:00:00" ]; then
+                       printf "Credentials expired"
+                       COPYPROXY=0
+                       test_skipped
+               else
+                       test_done
+
+                       # Get path to the proxy cert
+                       printf "Getting proxy cert path... "
+
+                       PROXYCERT=`${GRIDPROXYINFO} | ${SYS_GREP} -E "^path" | ${SYS_SED} "s/path\s*:\s//"`
+
+                       if [ "$PROXYCERT" = "" ]; then
+                               printf "Unable to identify the path to your proxy certificate"
+                               COPYPROXY=0
+                               test_skipped
+                       else
+                               printf "$PROXYCERT"
+                               test_done
 
                                scp $PROXYCERT root@$remotehost:/tmp/
+                       fi
+               fi
+       fi
+fi
+
+if [ "$PROXYCERT" == "" ]; then
+       PROXYCERT="none"
+fi
 
 cat << EndArrangeScript > arrange_lb_test_root.sh 
 CERTFILE=\$1
@@ -115,7 +129,6 @@ GLITE_USER=\$2
 LBTSTCOLS=\$3
 OUTPUT_OPT=\$4
 
-
 export LBTSTCOLS
 
 yum install -q -y globus-proxy-utils 
@@ -123,6 +136,7 @@ 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
 
 /etc/init.d/postgresql start
 mv /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf.orig
@@ -141,15 +155,21 @@ createuser -U postgres -S -R -D rtm
 #      activemq start
 #fi
 
-
 cd /tmp
 
 glite_id=\`id -u \$GLITE_USER\`
 
 echo \$GLITE_USER user ID is \$glite_id
 
-mv \$CERTFILE x509up_u\$glite_id
-chown \$GLITE_USER:\$GLITE_USER x509up_u\${glite_id}
+if [ $COPYPROXY -eq 1 ]; then
+       mv \$CERTFILE x509up_u\$glite_id
+       chown \$GLITE_USER:\$GLITE_USER x509up_u\${glite_id}
+else
+       rm -rf /tmp/test-certs/grid-security
+       cvs -d :pserver:anonymous@glite.cvs.cern.ch:/cvs/jra1mw co org.glite.testsuites.ctb/LB
+       ./org.glite.testsuites.ctb/LB/tests/lb-generate-fake-proxy.sh
+       scp -rv /tmp/test-certs/grid-security/certificates/* /etc/grid-security/certificates/
+fi
 
 CVSPATH=\`which cvs\`
 
@@ -233,17 +253,14 @@ su -l \$GLITE_USER --command=/tmp/arrange_lb_test_user.sh
 echo "</verbatim>"
 
 EndArrangeScript
-                               TERMCOLS=`stty size | awk '{print $2}'`
 
-                               chmod +x arrange_lb_test_root.sh
+TERMCOLS=`stty size | awk '{print $2}'`
+
+chmod +x arrange_lb_test_root.sh
 
-                               scp arrange_lb_test_root.sh root@$remotehost:/tmp/
+scp arrange_lb_test_root.sh root@$remotehost:/tmp/
 
-                               ssh -l root $remotehost "sh /tmp/arrange_lb_test_root.sh $PROXYCERT glite $TERMCOLS $outformat"
+ssh -l root $remotehost "sh /tmp/arrange_lb_test_root.sh "$PROXYCERT" glite $TERMCOLS $outformat"
 
                
-                       fi
-               fi
-       fi
-fi
 
index 517198b..48f789d 100755 (executable)
@@ -22,8 +22,7 @@ showHelp()
 {
 cat << EndHelpHeader
 Script for testing correct reporting of LB server properties over BDII/LDAP.
-This should also be thought of as a regression test for bug #55482,
-and ggus ticket #62737.
+This should also be thought of as a regression test for ggus ticket #62737.
 
 Prerequisities:
    - LB server
@@ -139,7 +138,7 @@ else
        test_done
 fi
 
-printf "Checking ServiceStatus... "
+printf "Checking ServiceStatus (Regression into bug #76174)... "
 health=`$SYS_GREP GlueServiceStatus: ldap.$$.out | $SYS_SED 's/^[^:]*: *//'`
 if [ "$health" == "" ]; then
        print_error "GlueServiceStatus not specified"
@@ -154,7 +153,7 @@ else
 fi
 
 printf "Checking Glue 2.0 entry with 'o=glue'... "
-$SYS_LDAPSEARCH -x -H ldap://${server}:2170 -b 'o=glue' 'GLUE2EndpointInterfaceName=org.glite.lb.Server' > ldap.$$.out
+$SYS_LDAPSEARCH -x -H ldap://${server}:2170 -b 'o=glue' -S GLUE2EntityCreationTime 'GLUE2EndpointInterfaceName=org.glite.lb.Server' > ldap.$$.out
 if [ $? -gt 0 ]; then  
        test_failed
        print_error "No reply"
@@ -162,8 +161,8 @@ else
        test_done
 fi
 
-printf "Checking GLUE2 HealthStatus... "
-health=`$SYS_GREP GLUE2EndpointHealthState: ldap.$$.out | $SYS_SED 's/^[^:]*: *//'`
+printf "Checking GLUE2 HealthStatus (Regression into bug #76173)... "
+health=`$SYS_GREP GLUE2EndpointHealthState: ldap.$$.out | $SYS_TAIL -n 1 | $SYS_SED 's/^[^:]*: *//'`
 if [ "$health" == "" ]; then
        print_error "GLUE2EndpointHealthState not specified"
        test_failed
@@ -176,8 +175,8 @@ else
        fi
 fi
 
-printf "Checking GlueServiceVersion... "
-glservver=`$SYS_GREP GLUE2EndpointImplementationVersion ldap.$$.out | $SYS_SED 's/^.*GLUE2EndpointImplementationVersion:\s*//'`
+printf "Checking GlueServiceVersion (Regression into bug #55482)... "
+glservver=`$SYS_GREP GLUE2EndpointImplementationVersion ldap.$$.out | $SYS_TAIL -n 1 | $SYS_SED 's/^.*GLUE2EndpointImplementationVersion:\s*//'`
 if [ "$glservver" == "" ]; then        
        print_error "GLUE2EndpointImplementationVersion not specified"
        test_failed
index 39af160..6ad68c9 100755 (executable)
@@ -234,7 +234,7 @@ X509_USER_PROXY=`${GRIDPROXYINFO} | ${SYS_GREP} -E "^path" | ${SYS_SED} "s/path\
 
                        fi
 
-                       printf "Trying excessively long request (regression-test bug #80263)..."
+                       printf "Trying excessively long request (Regression into bug #80263)..."
                        URL="https://${GLITE_WMS_QUERY_SERVER}/"
                        for i in {1..2000}
                        do
index dfeb33e..9c7e559 100755 (executable)
@@ -126,7 +126,7 @@ fi
                                print_error "Job has not been submitted"
                        fi
 
-                       printf "Trying to re-register job with the same jobid..."
+                       printf "Regression into bug #27268: Trying to re-register job with the same jobid..."
                        ${LBJOBREG} -m ${GLITE_WMS_QUERY_SERVER} -s application -j $jobid > /dev/null
 
                        noofevents=`${LBHISTORY} $jobid | $SYS_NL | $SYS_TAIL -n 1 | ${SYS_AWK} '{print $1}'`
index 59ea11b..912fb9c 100755 (executable)
@@ -169,7 +169,7 @@ else
                        $SYS_RM $$_notifications.txt
 
                        #Regress #86772
-                       printf "Trying to drop invalid NotiID (regression test for bug #86772)..."
+                       printf "Trying to drop invalid NotiID (Regression into bug #86772)..."
                        ${LBNOTIFY} drop ${jobid} 2>&1 | ${SYS_GREP} "Invalid" > /dev/null
                        if [ $? = 0 ]; then
                                printf " EINVAL"
index 6445e10..f0334ce 100755 (executable)
@@ -164,7 +164,7 @@ fi
                joblist=$$_jobs_to_purge.txt
                echo $jobid > ${joblist}
 
-               printf "Registering collection "
+               printf "Registering collection (Regression into bug #73206)"
                ${LBJOBREG} -X ${GLITE_WMS_LBPROXY_STORE_SOCK}store.sock -m ${GLITE_WMS_QUERY_SERVER} -s application -C -n 2 -S > $$_test_coll_registration.txt
                jobid=`$SYS_CAT $$_test_coll_registration.txt | ${SYS_GREP} "new jobid" | ${SYS_AWK} '{ print $3 }'`
                if [ -z $jobid  ]; then
@@ -184,7 +184,7 @@ fi
                                test_done
                        fi
 
-                       printf "Checking if subjob has stateEnterTime set and > 0... "
+                       printf "Checking if subjob has stateEnterTime set and > 0 (Regressison into bug #71913)... "
                        j1stateenter=`${LBJOBSTATUS} ${subjobs[0]} | $SYS_GREP "stateEnterTime :" | $SYS_SED 's/stateEnterTime :\s*//' `
                        cresult=`$SYS_EXPR $j1stateenter= \> 0`
                        if [ "$cresult" -eq "1" ]; then
index de6c05f..60a1554 100755 (executable)
@@ -250,7 +250,7 @@ fi
                        print_error "Done earlier than Running"
                fi
 
-               printf "Long term: Getting average 'Submitted' -> 'Running' transfer times (should be numbers >= 0):"
+               printf "Long term (Regression into bug #73716): Getting average 'Submitted' -> 'Running' transfer times (should be numbers >= 0):"
                $LB_FROMTO ALL 1 5 > fromto.out.$$
                averages=( $($SYS_CAT fromto.out.$$ | ${SYS_GREP} "Average duration" | ${SYS_SED} 's/^.*": //' | ${SYS_SED} 's/ s.*$//') )
                $SYS_CAT fromto.out.$$ | ${SYS_GREP} "Average duration" | $SYS_SED 's/":.*$//' | $SYS_SED 's/^.*"//' > fromto.out.ces.$$
index aeaadf5..6fd6115 100755 (executable)
@@ -123,7 +123,7 @@ fi
                        test_done
 
                        # Check results
-                       printf "Asking for states of all 30 jobs..."
+                       printf "Asking for states of all 30 jobs (Regression into bug #76175)..."
                        for i in {0..30}
                        do
                                jobids="$jobids ${jobid[$i]}"
index 6e3ee5a..d2f4c76 100755 (executable)
@@ -128,7 +128,7 @@ fi
                        fi
 
                        #(regresion-test Savannah Bug 77002)
-                       printf "Checking if doneCode unset for job not yet done... "
+                       printf "Checking if doneCode unset for job not yet done (Regression into bug #77002)... "
                        check_srv_version '>=' "2.2"
                        if [ $? = 0 ]; then
                                doneCode=`${LBWSJOBSTATUS} -m ${servername}:${GLITE_LB_SERVER_WPORT} -j ${jobid} | ${SYS_GREP} status | ${SYS_GREP} doneCode | ${SYS_SED} 's/^.*<doneCode>//' | ${SYS_SED} 's/<\/doneCode>.*$//'`
@@ -196,7 +196,7 @@ fi
                         test_done
                 fi
 
-               printf "Getting WS interface version... "
+               printf "Getting WS interface version (Regression into bug #37335)... "
                        check_srv_version '>=' "2.2"
                 if [ $? = 0 ]; then
                        wsglifver=`$LBWSGETVERSION -i -m ${servername}:${GLITE_LB_SERVER_WPORT} | $SYS_SED 's/^.*Interface version:\s*//'`