From bbebc8e342906c9e0edf4b0a59d31e91bd84e368 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Wed, 4 May 2011 09:41:01 +0000 Subject: [PATCH] New common test for server version --- org.glite.testsuites.ctb/LB/tests/lb-common.sh | 29 ++++++++++++++++++++++ .../LB/tests/lb-test-changeacl.sh | 12 +++++++-- .../LB/tests/lb-test-notif-stream.sh | 19 ++++++++++---- 3 files changed, 53 insertions(+), 7 deletions(-) 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 }'` -- 1.8.2.3