Skip to content

Commit

Permalink
fixed tests after ghttps upgrade - added new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
enricovianello committed Dec 20, 2013
1 parent 5ac251e commit 95eb7f6
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 29 deletions.
6 changes: 3 additions & 3 deletions lib/variables.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ ${userproxy} $X509_USER_PROXY
${trustdir} /etc/grid-security/certificates

${anonymousRWStorageArea} noauth
${anonymousBisRWStorageArea} noauth-bis
${anonymousBisRWStorageArea} noauth
${vomsproxyRWStorageArea} testers.eu-emi.eu
${vomsproxyBisRWStorageArea} testers.eu-emi.eu
${gridproxyRWStorageArea} igi
${gridproxyBisRWStorageArea} igi-bis
${gridproxyBisRWStorageArea} igi
${personalcertRWStorageArea} igi
${personalcertBisRWStorageArea} igi-bis
${personalcertBisRWStorageArea} igi
${tapeStorageArea} ${vomsproxyRWStorageArea}

${ldapEndpoint} ${backEndHost}:2170
Expand Down
26 changes: 0 additions & 26 deletions tests/filetransfer/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,30 +152,4 @@ File-Transfer get file with personal certificate
${output} Perform rm using clientSRM ${surl}
Should contain ${output} SRM_SUCCESS
Remove local file ${filename}
[Teardown] Clear all credentials

File-Transfer upload file as anonymous without ptp
[Tags] filetransfer put
[Setup] Init certificate and voms proxy test0 ${vo}
${filename} Get a unique name
${options} Set variable --verbose -X PUT
${turl} Build file transfer TURL ${anonymousRWStorageArea} ${filename}
${output} Execute Curl with options ${turl} ${options}
Should Contain ${output} 412 File not exist! You must do a prepare-to-put on surl
Remove local file ${filename}
[Teardown] Clear all credentials

File-Transfer get file as anonymous without ptg
[Tags] filetransfer get
[Setup] Init certificate and voms proxy test0 ${vo}
${filename} Create local file
${surl} Build surl ${anonymousRWStorageArea} ${filename}
Copy-out file using lcg-utils ${filename} ${surl}
${options} Set variable --verbose -X GET
${turl} Build file transfer TURL ${anonymousRWStorageArea} ${filename}
${output} Execute Curl with options ${turl} ${options}
Should Contain ${output} 412 You must do a prepare-to-get on surl
${output} Perform rm using clientSRM ${surl}
Should contain ${output} SRM_SUCCESS
Remove local file ${filename}
[Teardown] Clear all credentials
91 changes: 91 additions & 0 deletions tests/filetransfer/unauthorized.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
*** Settings ***
Resource lib/stormlib.txt
Resource lib/clientSRM.txt
Resource lib/credentials.txt
Resource lib/lcg_util.txt

*** Test Cases ***

File-Transfer upload file as anonymous without ptp
[Tags] filetransfer put
[Setup] Init certificate and voms proxy test0 ${vo}
${filename} Get a unique name
${options} Set variable --verbose -X PUT
${turl} Build file transfer TURL ${anonymousRWStorageArea} ${filename}
${output} Execute Curl with options ${turl} ${options}
Should Contain ${output} 401 Unauthorized
Remove local file ${filename}
[Teardown] Clear all credentials

File-Transfer get file as anonymous without ptg
[Tags] filetransfer get
[Setup] Init certificate and voms proxy test0 ${vo}
${filename} Create local file
${surl} Build surl ${anonymousRWStorageArea} ${filename}
Copy-out file using lcg-utils ${filename} ${surl}
${options} Set variable --verbose -X GET
${turl} Build file transfer TURL ${anonymousRWStorageArea} ${filename}
${output} Execute Curl with options ${turl} ${options}
Should Contain ${output} 200 OK
${output} Perform rm using clientSRM ${surl}
Should contain ${output} SRM_SUCCESS
Remove local file ${filename}
[Teardown] Clear all credentials

File-Transfer get file over https with not sufficient credentials
[Tags] filetransfer get
[Setup] Init certificate and voms proxy test0 ${vo}
${filename} Create local file
${surl} Build surl ${vomsproxyRWStorageArea} ${filename}
Copy-out file using lcg-utils ${filename} ${surl}
Clear all credentials
Init certificate with unencrypted key test0
${options} Set variable --verbose
${turl} Build file transfer secure TURL ${vomsproxyRWStorageArea} ${filename}
Log ${turl}
${output} Execute Curl with certificate and options ${turl} ${options}
Log ${output}
Should Contain ${output} 403 You are not authorized to access the requested resource
Clear all credentials
Init certificate and plain proxy test0
${output} Execute Curl with proxy and options ${turl} ${options}
Log ${output}
Should Contain ${output} 403 You are not authorized to access the requested resource
Clear all credentials
${turl} Build file transfer TURL ${vomsproxyRWStorageArea} ${filename}
Log ${turl}
${output} Execute Curl with options ${turl} ${options}
Log ${output}
Should Contain ${output} 403 Unauthorized: Anonymous users are not authorized to read
Init certificate and voms proxy test0 ${vo}
${output} Perform rm using clientSRM ${surl}
Should contain ${output} SRM_SUCCESS
Remove local file ${filename}
[Teardown] Clear all credentials

File-Transfer put file over https with not sufficient credentials
[Tags] filetransfer put
[Setup] Init certificate and voms proxy test0 ${vo}
${filename} Create local file
${surl} Build surl ${vomsproxyRWStorageArea} ${filename}
Clear all credentials
Init certificate with unencrypted key test0
${options} Set variable --verbose -T /tmp/${filename}
${turl} Build file transfer secure TURL ${vomsproxyRWStorageArea} ${filename}
Log ${turl}
${output} Execute Curl with certificate and options ${turl} ${options}
Log ${output}
Should Contain ${output} 403 You are not authorized to access the requested resource
Clear all credentials
Init certificate and plain proxy test0
${output} Execute Curl with proxy and options ${turl} ${options}
Log ${output}
Should Contain ${output} 403 You are not authorized to access the requested resource
Clear all credentials
${turl} Build file transfer TURL ${vomsproxyRWStorageArea} ${filename}
Log ${turl}
${output} Execute Curl with options ${turl} ${options}
Log ${output}
Should Contain ${output} 403 Unauthorized: Anonymous users are not authorized to read
Remove local file ${filename}
[Teardown] Clear all credentials
18 changes: 18 additions & 0 deletions tests/webdav/get.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,22 @@ WebDAV GET file with personal certificate
Remove file using clientSRM ${personalcertRWStorageArea} ${filename}
Remove local file ${filename}
Remove local file ${filename}_2
[Teardown] Clear all credentials

WebDAV GET SURL in SRM_SPACE_AVAILABLE status
[Tags] webdav put vomsproxy
[Setup] Init certificate and voms proxy test0 ${vo}
${filename} Get a unique name
${surl} Build surl ${vomsproxyRWStorageArea} ${filename}
${output} ${token} Perform ptp using clientSRM ${surl} -p
Should Contain ${output} SRM_SPACE_AVAILABLE
${options} Set variable -X GET -v -o /tmp/${filename}_2
${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${filename}
${output} Execute Curl with proxy and options ${url} ${options}
Should Contain ${output} 503 SRM_FILE_BUSY: Requested file is busy (in an incompatible state with PTG)
${output} Perform pd using clientSRM ${surl} ${token}
Should Contain ${output} SRM_SUCCESS
Remove file using clientSRM ${vomsproxyRWStorageArea} ${filename}
Remove local file ${filename}
Remove local file ${filename}_2
[Teardown] Clear all credentials

0 comments on commit 95eb7f6

Please sign in to comment.