#!/bin/csh -f set attended=1 if ( $#argv >= 1 ) then if ( "$argv[1]" == "-unattended" ) then if ( $#argv < 2 ) then echo "ERROR: Must supply password with -unattended." exit endif set attended=0 set passwd="$argv[2]" shift shift endif endif if ( ( $#argv < 2 ) | ( $1 =~ -* ) ) then echo "usage: regression.test [-unattended PASS] host.domain jobmanager-pbs [testport]" echo " default testport at remote site is 40050" exit endif set host="$argv[1]" set jobmanager="$argv[2]" if ( $#argv >= 3 ) then set port="$argv[3]" else set port="40050" endif set gatekeeper1="$host" set gatekeeper2="${host}/${jobmanager}" set gsiftp="gsiftp://${host}" echo '######### Testing some non-service Globus components...' if ($attended) then echo -n '(enter to continue) ' ; set ans="$<" endif echo '> globus-domainname' globus-domainname echo '> globus-hostname' globus-hostname echo '> grid-cert-info -subject -issuer -startdate -enddate' grid-cert-info -subject -issuer -startdate -enddate if ($attended) then echo '> grid-proxy-init' grid-proxy-init else echo '> grid-proxy-init -pwstdin' grid-proxy-init -pwstdin << EOF $passwd EOF endif echo '> grid-proxy-info' grid-proxy-info echo '######### Testing some remote-service Globus components (MDS/Gatekeeper)...' if ($attended) then echo -n '(enter to continue) ' ; set ans="$<" endif echo '> grid-info-search -h '$gatekeeper1' '"'"'(objectClass=MdsHost)'"'"' Mds-Host-hn' grid-info-search -x -h $gatekeeper1 '(objectClass=MdsHost)' Mds-Host-hn echo '> globusrun -a -r '$gatekeeper1 globusrun -a -r $gatekeeper1 echo '> globusrun -o -r '$gatekeeper1' '"'"'&(executable=/bin/hostname)'"'" globusrun -o -r $gatekeeper1 '&(executable=/bin/hostname)' echo '> globus-job-run '$gatekeeper2' /bin/hostname' globus-job-run $gatekeeper2 /bin/hostname echo '> globus-job-submit '$gatekeeper2' /bin/hostname' set output="`globus-job-submit $gatekeeper2 /bin/hostname`" echo $output echo '> globus-job-status '"$output" globus-job-status "$output" set output3="" foreach sec (5 10 15 20 25 30 35 40 45 50 55 60 65 70) sleep 4 echo '> globus-job-status '"$output"' (at '$sec' seconds)' set output2="`globus-job-status $output`" echo "$output2" if ( ( "$output2" == "DONE" ) && ( "$output3" == "DONE" ) ) then break endif set output3="$output2" end echo '> globus-job-get-output '"$output" globus-job-get-output "$output" echo '> globus-job-clean '"$output" echo '### REGRESSION NOTE: Do not press Y or any key. It is done automatically.' globus-job-clean "$output" << EOF Y EOF echo '######### Testing some remote-service Globus components (GSIFTP/GASS)...' if ($attended) then echo -n '(enter to continue) ' ; set ans="$<" endif echo '> globus-url-copy '$gsiftp'/etc/hosts -' globus-url-copy $gsiftp/etc/hosts - echo '** Constructing script with remote GASS server...' cat << EOF > gasstestscript.$$ #!/bin/csh setenv LD_LIBRARY_PATH "\$GLOBUS_LOCATION/lib" \$GLOBUS_LOCATION/bin/globus-gass-server -r -p $port -c EOF chmod ugo+x gasstestscript.$$ echo '** Submitting script to remote host...' globus-job-run $gatekeeper2 -s gasstestscript.$$ & set url=https://${gatekeeper1}:${port} echo '** Waiting for remote GASS startup (guessing 20 seconds)...' sleep 20 echo '> globus-url-copy '"$url"'/etc/hosts -' globus-url-copy $url/etc/hosts - echo '> globus-gass-server-shutdown '"$url" globus-gass-server-shutdown $url echo '** Waiting for remote GASS shutdown...' wait /bin/rm gasstestscript.$$ echo '** Done.' #echo '> globus-gass-server -r -p 46562 -c' #globus-gass-server -r -p 46562 -c & #set url=https://localhost:46562 #sleep 5 #echo '> globus-url-copy '"$url"'/etc/hosts -' #globus-url-copy $url/etc/hosts - #echo '> globus-gass-cache -add '$url'/etc/passwd' #globus-gass-cache -add $url/etc/passwd #echo '> globus-gass-cache -list' #globus-gass-cache -list #echo '> globus-gass-cache -query '$url'/etc/passwd' #globus-gass-cache -query $url/etc/passwd #echo '> cat `globus-gass-cache -query '$url'/etc/passwd`' #cat `globus-gass-cache -query $url/etc/passwd` #echo '> globus-gass-cache -delete '$url'/etc/passwd' #globus-gass-cache -delete $url/etc/passwd #echo '> globus-gass-server-shutdown '"$url" #globus-gass-server-shutdown $url echo '######### Testing a complex job with GASS file staging...' if ($attended) then echo -n '(enter to continue) ' ; set ans="$<" endif echo '** Constructing job file with staging...' cat << EOF > regression.test.job$$ #!/bin/csh -f setenv LD_LIBRARY_PATH "\$GLOBUS_LOCATION/lib" echo -n 'job: Start Date ' /bin/date echo -n 'job: Hostname ' /bin/hostname echo 'job: Passed environment JOBID='\$JOBID echo 'job: Job requesting stage in of /etc/hosts ...' \$GLOBUS_LOCATION/bin/globus-url-copy \${GLOBUSRUN_GASS_URL}/etc/hosts - > regression.test.temp1 echo 'job: /tmp/regression.test.temp2..........................................' /bin/cat regression.test.temp1 echo 'job: ........................................../tmp/regression.test.temp2' /bin/rm regression.test.temp1 echo 'job: Running some process to generate /tmp/regression.test.temp2...' @ i = 1 while ( \$i <= 40 ) echo 'job: iteration' \$i echo data file iteration \$i >> /tmp/regression.test.temp2 @ j = 1 while ( \$j <= 10000 ) @ k = \$j + 15 @ k = \$j + 234532 * 10 / 234 @ k = \$k + 234532 * 10 / 234 @ j++ end #sleep 1 @ i++ end echo 'job: Process ended.' echo 'job: Job requesting stage out of /tmp/regression.test.temp2 to temp3 ...' \$GLOBUS_LOCATION/bin/globus-url-copy - \${GLOBUSRUN_GASS_URL}/tmp/regression.test.temp3 < /tmp/regression.test.temp2 /bin/rm /tmp/regression.test.temp2 echo -n 'job: End Date ' /bin/date EOF echo '** Running job file with staging (may take several minutes)...' globus-job-run -stdout -s regression.test.stdout \ -stderr -s regression.test.stderr \ $gatekeeper2 \ -x '("environment"=("JOBID" "rtest1")("GLOBUSRUN_GASS_URL" $("GLOBUSRUN_GASS_URL")))' \ -s regression.test.job$$ echo '** Testing standard error...' ls -l regression.test.stderr echo '-----------------------------------------------------------------------' cat regression.test.stderr echo '-----------------------------------------------------------------------' echo '** Testing standard output...' ls -l regression.test.stdout echo '-----------------------------------------------------------------------' cat regression.test.stdout echo '-----------------------------------------------------------------------' echo '** Testing staged back file...' ls -l /tmp/regression.test.temp3 echo '-----------------------------------------------------------------------' cat /tmp/regression.test.temp3 echo '-----------------------------------------------------------------------' echo '** Cleaning up...' /bin/rm regression.test.stdout /bin/rm regression.test.stderr /bin/rm /tmp/regression.test.temp3 /bin/rm regression.test.job$$ echo '** Done.' echo '######### Finishing...' echo '> grid-proxy-destroy' grid-proxy-destroy echo '######### Finished!'