Commit 7d88781d authored by Edita Kizinevic's avatar Edita Kizinevic
Browse files

Include backup proxies for pilots tests and exclude backup proxies for SAM tests

parent 7aa25eff
......@@ -2,7 +2,21 @@
shopt -s expand_aliases
SCRIPT_REVISION="2019-09-18, Dave Dykstra and Edita Kizinevic"
SCRIPT_REVISION="2020-02-17, Dave Dykstra and Edita Kizinevic"
# Script does not use backupproxyurl if it is SAM test, but script uses backupproxyurl if it is pilot
includebackups=false
while getopts ":b" opt; do
case ${opt} in
b)
includebackups=true
;;
\?)
echo "Invalid Option: -$OPTARG" 1>&2
exit 1
;;
esac
done
# Source the CMS environment
if [ -n "$OSG_GRID" ] ; then
......@@ -109,18 +123,24 @@ if [ $? -ne 0 ] ; then
echo "ERROR: $CMSREL not available"
exit $SAME_WARNING
fi
echo "Set up CMSSW ... completed"
echo "Set up of $CMSREL completed"
echo
cd $CMSREL/src
cmsenv
# Function to check proxies
# $1 - list of proxies
# $2 - $includebackups
check_proxies() {
if $2; then
backupproxyurl="*(backupproxyurl=*"
else
backupproxyurl="NONE"
fi
for PART in $1; do
proxy=`echo $PART | sed 's/^.*(/(/'`
case $proxy in
*"(proxyurl="*)
*"(proxyurl="* | $backupproxyurl)
found_proxy=true
hostname=${proxy#*//}
hostname=${hostname%:*}
......@@ -128,6 +148,8 @@ check_proxies() {
IP_addresses=`getent ahostsv4 $hostname | awk '/STREAM/{print $1}'`
if [ -z "$IP_addresses" ]; then
IP_addresses=$hostname
else
IP_addresses="$IP_addresses $hostname"
fi
for IP_address in $IP_addresses; do
proxy_IP=`echo $proxy | sed "s/$hostname/$IP_address/g"`
......@@ -148,15 +170,17 @@ check_proxies() {
*"(proxyconfigurl="*)
if [ "$found_proxyconfig" == false ]; then
proxy_config_url=$proxy
echo "Converting $proxy_config_url proxyconfigurl to proxyurl started:" `date`
echo "Converting $proxy_config_url proxyconfigurl to proxyurl/backupproxyurl started:" `date`
echo
echo 'select 1 from dual' | FRONTIER_LOG_LEVEL=debug FRONTIER_SERVER="$proxy(serverurl=http://cmsfrontier.cern.ch:8000/FrontierProd)(failovertoserver=no)" fn-req > $debug_output 2>&1
if grep -q "FindProxyForURL" $debug_output ; then
found_proxyconfig=true
PROXYLIST="`sed -n '/returned "PROXY/{s/.*returned "//;s/PROXY /(proxyurl=/g;s/;/)/g;s/"/)/;p;q}' $debug_output`"
check_proxies "$PROXYLIST"
PROXYLIST=`echo $PROXYLIST | sed "s/(proxyurl=http:\/\/cmsbpfrontier.cern.ch/(backupproxyurl=http:\/\/cmsbpfrontier.cern.ch/g"`
PROXYLIST=`echo $PROXYLIST | sed "s/(proxyurl=http:\/\/cmsbproxy.fnal.gov/(backupproxyurl=http:\/\/cmsbproxy.fnal.gov/g"`
check_proxies "$PROXYLIST" $2
fi
echo "Converting $proxy_config_url proxyconfigurl to proxyurl ended:" `date`
echo "Converting $proxy_config_url proxyconfigurl to proxyurl/backupproxyurl ended:" `date`
echo
fi
;;
......@@ -177,7 +201,7 @@ ever_failed=false
ever_succeeded=false
found_proxyconfig=false
found_proxy=false
check_proxies "$FNCONNECT"
check_proxies "$FNCONNECT" $includebackups
#Check test results
if [ "$failover" == true ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment