From: Zdeněk Šustr Date: Wed, 4 May 2011 09:41:01 +0000 (+0000) Subject: New common test for server version X-Git-Tag: glite-px-proxyrenewal_R_1_3_20_1~9 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=bbebc8e342906c9e0edf4b0a59d31e91bd84e368;p=jra1mw.git New common test for server version --- diff --git a/org.glite.testsuites.ctb/LB/tests/lb-common.sh b/org.glite.testsuites.ctb/LB/tests/lb-common.sh index a8a862d..a45a74e 100755 --- a/org.glite.testsuites.ctb/LB/tests/lb-common.sh +++ b/org.glite.testsuites.ctb/LB/tests/lb-common.sh @@ -279,3 +279,32 @@ function check_credentials() fi return 0 } + +function check_srv_version() +{ + check_binaries $LBWSGETVERSION + if [ $? -gt 0 ]; then + return 2 + else + servername=`echo ${GLITE_WMS_QUERY_SERVER} | ${SYS_SED} "s/:.*//"` + wsglservver=`$LBWSGETVERSION -m ${servername}:${GLITE_LB_SERVER_WPORT} | $SYS_SED 's/^.*Server version:\s*//'` + if [ "$wsglservver" == "" ]; then + return 2 + else + + SRVVER=`$SYS_ECHO $wsglservver | $SYS_GREP -o -E "^[0-9]+\.[0-9]+"` + CHKVER=`$SYS_ECHO $2 | $SYS_GREP -o -E "^[0-9]*\.[0-9*]"` + + printf "Srv. version $SRVVER $1 $CHKVER? " + cresult=`$SYS_EXPR $SRVVER $1 $CHKVER` + if [ "$cresult" -eq "1" ]; then + printf "yes " + return 0 + else + printf "no " + return 1 + fi + fi + fi + return 0 +} diff --git a/org.glite.testsuites.ctb/LB/tests/lb-test-changeacl.sh b/org.glite.testsuites.ctb/LB/tests/lb-test-changeacl.sh index 3bd415e..9f4bcdf 100755 --- a/org.glite.testsuites.ctb/LB/tests/lb-test-changeacl.sh +++ b/org.glite.testsuites.ctb/LB/tests/lb-test-changeacl.sh @@ -101,7 +101,6 @@ change_acl() ##################### identity="ThisIsJustATestingIdentity" -test_tag_acl=${TEST_TAG_ACL:-"no"} { test_start @@ -134,6 +133,15 @@ while [ "$CONT" = "yes" ]; do fi test_done + check_srv_version '>=' "2.2" + if [ $? -gt 0 ]; then + test_tag_acl="no" + test_done + else + test_tag_acl="yes" + test_done + fi + printf "Testing Tags permissions... " if [ "$test_tag_acl" != "yes" ]; then printf "Capability not detected..." @@ -150,6 +158,7 @@ while [ "$CONT" = "yes" ]; do print_error "Failed to register job" break fi + printf " $jobid" test_done printf "Changing ACL..." @@ -168,7 +177,6 @@ while [ "$CONT" = "yes" ]; do fi test_done - printf "Checking ACL for new values... " ops="read" [ "$test_tag_acl" = "yes" ] && ops="$ops write" diff --git a/org.glite.testsuites.ctb/LB/tests/lb-test-notif-stream.sh b/org.glite.testsuites.ctb/LB/tests/lb-test-notif-stream.sh index 7ec2508..7ea4727 100755 --- a/org.glite.testsuites.ctb/LB/tests/lb-test-notif-stream.sh +++ b/org.glite.testsuites.ctb/LB/tests/lb-test-notif-stream.sh @@ -77,11 +77,11 @@ do done # redirecting all output to $logfile -touch $logfile -if [ ! -w $logfile ]; then - echo "Cannot write to output file $logfile" - exit $TEST_ERROR -fi +#touch $logfile +#if [ ! -w $logfile ]; then +# echo "Cannot write to output file $logfile" +# exit $TEST_ERROR +#fi DEBUG=2 RETURN=2 @@ -122,6 +122,15 @@ while true; do RETURN=1 + check_srv_version '>=' "2.2" + if [ $? -gt 0 ]; then + printf "Capability not detected. This test will be" + test_skipped + break + else + test_done + fi + # Register job: printf "Registering job " jobid=`${LBJOBREG} -m ${GLITE_WMS_QUERY_SERVER} -s application 2>&1 | $SYS_GREP "new jobid" | ${SYS_AWK} '{ print $3 }'`