Skip to content

Commit

Permalink
Merge branch 'nightly'
Browse files Browse the repository at this point in the history
  • Loading branch information
enricovianello committed Jan 10, 2019
2 parents f853cbf + 320b521 commit 11b1431
Show file tree
Hide file tree
Showing 25 changed files with 257 additions and 217 deletions.
5 changes: 3 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ pipeline {
parameters {
string(defaultValue: "omii006-vm03.cnaf.infn.it", description: '', name: 'STORM_BE_HOST')
string(defaultValue: "omii003-vm01.cnaf.infn.it:8888", description: '', name: 'CDMI_ENDPOINT')
string(defaultValue: "v1.11.14", description: '', name: 'TESTSUITE_BRANCH')
string(defaultValue: "master", description: '', name: 'TESTSUITE_BRANCH')
string(defaultValue: "to-be-fixed", description: '', name: 'TESTSUITE_EXCLUDE')
string(defaultValue: "tests", description: '', name: 'TESTSUITE_SUITE')
string(defaultValue: "/storage", description: '', name: 'STORM_STORAGE_ROOT_DIR')
string(defaultValue: "${env.DOCKER_REGISTRY_HOST}/italiangrid/storm-testsuite:centos7", description: '', name: 'STORM_TESTSUITE_IMAGE')
}

stages {
Expand All @@ -32,7 +33,7 @@ pipeline {
usernamePassword(credentialsId: 'a5ca708a-eca8-4fc0-83cd-eb3695f083a1', passwordVariable: 'IAM_USER_PASSWORD', usernameVariable: 'IAM_USER_NAME')
]) {

def image = "italiangrid/storm-testsuite"
def image = "${params.STORM_TESTSUITE_IMAGE}"
echo "image: ${image}"

sh "docker pull ${image}"
Expand Down
3 changes: 2 additions & 1 deletion lib/cdmi.robot
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Get CDMI Status [Arguments] ${path} ${credentials}
[Return] ${data}

Get Json Data [Arguments] ${url} ${options}
${output} ${stderr} Curl GET ${url} ${options}
${output} ${rc} Curl GET ${url} ${options}
Should Be Equal As Integers ${rc} 0
${jsonData} = Get Line ${output} -1
${parsedData} Parse Json ${jsonData}
[Return] ${parsedData}
6 changes: 3 additions & 3 deletions lib/curl.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
### COMMAND ###

Curl [Arguments] ${method} ${url} ${options}=${EMPTY}
${output} ${stderr} Execute and Check Success curl ${options} ${url} -X ${method} -s -L -iv
${rc} ${output} Run And Return Rc And Output curl ${options} ${url} -X ${method} -s -L -iv
Log ${output}
Log ${stderr}
[Return] ${output} ${stderr}
Log ${rc}
[Return] ${output} ${rc}

### OPTIONS ###

Expand Down
11 changes: 7 additions & 4 deletions lib/filetransfer.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ Build FileTransfer URL [Arguments] ${endpoint} ${path}

FileTransfer GET [Arguments] ${endpoint} ${storageArea} ${relativePath} ${credentials}=${EMPTY}
${url} Build FileTransfer URL ${endpoint} ${storageArea}/${relativePath}
${output} Curl GET ${url} ${credentials} -iv
${output} ${rc} Curl GET ${url} ${credentials} -iv
Should Be Equal As Integers ${rc} 0
[Return] ${output}

FileTransfer PUT file [Arguments] ${endpoint} ${storageArea} ${relativePath} ${localFilePath} ${credentials}=${EMPTY}
${url} Build FileTransfer URL ${endpoint} ${storageArea}/${relativePath}
${output} Curl PUT ${url} -T ${localFilePath} -iv ${credentials}
${output} ${rc} Curl PUT ${url} -T ${localFilePath} -iv ${credentials}
Should Be Equal As Integers ${rc} 0
[Return] ${output}

FileTransfer PUT data [Arguments] ${endpoint} ${storageArea} ${relativePath} ${data} ${credentials}=${EMPTY}
${body} Set body ${data}
${url} Build FileTransfer URL ${endpoint} ${storageArea}/${relativePath}
${output} Curl PUT ${url} ${body} -iv ${credentials}
[Return] ${output}
${output} ${rc} Curl PUT ${url} ${body} -iv ${credentials}
Should Be Equal As Integers ${rc} 0
[Return] ${output}
47 changes: 47 additions & 0 deletions lib/gfal_util.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
*** Keywords ***

List files in directory using gfal-utils [Arguments] ${surl} ${expectedRc}=0 ${expectedContent}=${EMPTY}
${rc} ${output} Run And Return Rc And Output gfal-ls -laH ${surl}
Log ${output}
Should Be Equal As Integers ${rc} ${expectedRc}
Should Contain ${output} ${expectedContent}
[Return] ${output}

Check surl exists using gfal-utils [Arguments] ${surl}
${rc} ${output} Run And Return Rc And Output gfal-stat ${surl}
Log ${output}
Should Be Equal As Integers ${rc} 0
[Return] ${output}

Check surl does not exists using gfal-utils [Arguments] ${surl}
${rc} ${output} Run And Return Rc And Output gfal-stat ${surl}
Log ${output}
Should Be Equal As Integers ${rc} 2
Should Contain ${output} No such file or directory
Should Contain ${output} SRM_INVALID_PATH
[Return] ${output}

Copy-out file using gfal-utils [Arguments] ${localFileName} ${surl} ${options}=${EMPTY}
${rc} ${output} Run And Return Rc And Output gfal-copy -v ${options} file:///tmp/${TESTDIR}/${localFileName} ${surl}
Log ${output}
Run Keyword If ${rc}!=0 Fail "Exit code value is ${rc} instead of 0"
[Return] ${output}

Copy-in file using gfal-utils [Arguments] ${surl} ${localFileName}
${rc} ${output} Run And Return Rc And Output gfal-copy -v ${surl} file:///tmp/${TESTDIR}/${localFileName}
Log ${output}
Run Keyword If ${rc}!=0 Fail "Exit code value is ${rc} instead of 0"
[Return] ${output}

Copy file using gfal-utils [Arguments] ${srcSurl} ${destSurl} ${options}=${EMPTY}
${rc} ${output} Run And Return Rc And Output gfal-copy -v ${options} ${srcSurl} ${destSurl}
Log ${output}
Run Keyword If ${rc}!=0 Fail "Exit code value is ${rc} instead of 0"
[Return] ${output}

Get checksum of remote file using gfal-utils [Arguments] ${surl} ${algorithm}=adler32
${rc} ${output} Run And Return Rc And Output gfal-sum ${surl} ${algorithm}
Log ${output}
Should Be Equal As Integers ${rc} 0
${rest} ${last}= Split String From Right ${output}
[Return] ${last}
4 changes: 2 additions & 2 deletions lib/import.robot
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Resource dcache.robot
Resource filetransfer.robot
Resource globus_util.robot
Resource infosystem.robot
Resource lcg_util.robot
Resource gfal_util.robot
Resource metadata.robot
Resource oidc.robot
Resource recall.robot
Resource setup.robot
Resource stormlib.robot
Resource webdav_util.robot
Resource webdav.robot
Resource webdav.robot
6 changes: 4 additions & 2 deletions lib/metadata.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ Get metadata of [Arguments] ${sa} ${path}
[Return] ${data}

Request Metadata For [Arguments] ${sa} ${path}
${output} ${stderr} Curl GET http://${recallEndpoint}/metadata/${sa}/${path} -H "Token:${xmlrpcToken}"
${output} ${rc} Curl GET http://${recallEndpoint}/metadata/${sa}/${path} -H "Token:${xmlrpcToken}"
Should Be Equal As Integers ${rc} 0
[Return] ${output}

Unauthorized Request Metadata For [Arguments] ${sa} ${path}
${output} ${stderr} Curl GET http://${recallEndpoint}/metadata/${sa}/${path}
${output} ${rc} Curl GET http://${recallEndpoint}/metadata/${sa}/${path}
Should Be Equal As Integers ${rc} 0
[Return] ${output}

Parse Metadata [Arguments] ${httpRepsonse}
Expand Down
3 changes: 2 additions & 1 deletion lib/oidc.robot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Get Access Token [Arguments] ${clientId} ${clientSecret} ${username} ${pass
${contentType}= Set Variable -H "Content-Type: application/x-www-form-urlencoded"
${credentials}= Set Variable -u "${clientId}:${clientSecret}"
${data}= Set Variable -d "grant_type=password" -d "scope=${scopes}" -d "username=${username}" -d "password=${password}"
${out} ${err} Curl POST ${tokenUrl} ${contentType} ${credentials} ${data}
${out} ${rc} Curl POST ${tokenUrl} ${contentType} ${credentials} ${data}
Should Be Equal As Integers ${rc} 0
${jsonData} = Get Line ${out} -1
${parsedData} Parse Json ${jsonData}
[Return] ${parsedData["access_token"]}
30 changes: 15 additions & 15 deletions lib/recall.robot
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
*** Keywords ***

Get recall requests in progress [Arguments] ${maxResults}
${output} ${stderr} Curl GET http://${recallEndpoint}/recalltable/task?maxResults=${maxResults} -i -H "Token:${xmlrpcToken}"
Log ${output}
${output} ${rc} Curl GET http://${recallEndpoint}/recalltable/task?maxResults=${maxResults} -i -H "Token:${xmlrpcToken}"
Should Be Equal As Integers ${rc} 0
[Return] ${output}

Get and update to progress recall tasks ready for being taken over [Arguments] ${maxResults}
${output} ${stderr} Curl PUT http://${recallEndpoint}/recalltable/tasks -i -s -S -H "Content-Type:text/plain" -H "Token:${xmlrpcToken}" -d first=${maxResults}
Log ${output}
${output} ${rc} Curl PUT http://${recallEndpoint}/recalltable/tasks -i -s -S -H "Content-Type:text/plain" -H "Token:${xmlrpcToken}" -d first=${maxResults}
Should Be Equal As Integers ${rc} 0
[Return] ${output}

Update a recall task status using a groupTaskId [Arguments] ${groupTaskId} ${status}
${output} ${stderr} Curl PUT http://${recallEndpoint}/recalltable/task/${groupTaskId} -i -s -S -H "Content-Type:text/plain" -H "Token:${xmlrpcToken}" -d status=${status}
Log ${output}
${output} ${rc} Curl PUT http://${recallEndpoint}/recalltable/task/${groupTaskId} -i -s -S -H "Content-Type:text/plain" -H "Token:${xmlrpcToken}" -d status=${status}
Should Be Equal As Integers ${rc} 0
[Return] ${output}

Check for a completed recall task [Arguments] ${requestToken} ${fileName}
${output} ${stderr} Curl PUT http://${recallEndpoint}/recalltable/task -i -H "Content-Type:text/plain" -H "Token:${xmlrpcToken}" -d $'requestToken=${requestToken}\nsurl=srm://${srmEndpoint}/srm/managerv2?SFN=/${TAPE_SA}/${fileName}'
Log ${output}
${output} ${rc} Curl PUT http://${recallEndpoint}/recalltable/task -i -H "Content-Type:text/plain" -H "Token:${xmlrpcToken}" -d $'requestToken=${requestToken}\nsurl=srm://${srmEndpoint}/srm/managerv2?SFN=/${TAPE_SA}/${fileName}'
Should Be Equal As Integers ${rc} 0
[Return] ${output}

Insert new recall request [Arguments] ${absoluteFilePath} ${userId}
${output} ${stderr} Curl POST http://${recallEndpoint}/recalltable/task -i -H "Content-Type:application/json" -H "Token:${xmlrpcToken}" -d '{fileName:${absoluteFilePath},userId:${userId}}'
Log ${output}
${output} ${rc} Curl POST http://${recallEndpoint}/recalltable/task -i -H "Content-Type:application/json" -H "Token:${xmlrpcToken}" -d '{fileName:${absoluteFilePath},userId:${userId}}'
Should Be Equal As Integers ${rc} 0
[Return] ${output}

Get first recall task
${output} ${stderr} Curl PUT http://${recallEndpoint}/recalltable/tasks -s -S -H "Content-Type:text/plain" -H "Token:${xmlrpcToken}" -d first=1
Log ${output}
${output} ${rc} Curl PUT http://${recallEndpoint}/recalltable/tasks -s -S -H "Content-Type:text/plain" -H "Token:${xmlrpcToken}" -d first=1
Should Be Equal As Integers ${rc} 0
${data} = Get Line ${output} -1
Log ${data}
[Return] ${data}

Set success for taskid [Arguments] ${taskId}
${output} ${stderr} Curl PUT http://${recallEndpoint}/recalltable/task/${taskId} -s -S -H "Content-Type:text/plain" -H "Token:${xmlrpcToken}" -d "status=0"
Log ${output}
[Return] ${output}
${output} ${rc} Curl PUT http://${recallEndpoint}/recalltable/task/${taskId} -s -S -H "Content-Type:text/plain" -H "Token:${xmlrpcToken}" -d "status=0"
Should Be Equal As Integers ${rc} 0
[Return] ${output}
105 changes: 59 additions & 46 deletions lib/webdav.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,112 +3,125 @@
##### HTTP/WEBDAV METHODS - CURL KEYWORDS

Do CURL HEAD [Arguments] ${url} ${options}=${EMPTY}
${output} ${stderr} Curl HEAD ${url} --head ${options}
[Return] ${output} ${stderr}
${output} ${rc} Curl HEAD ${url} --head ${options}
[Return] ${output} ${rc}

Do CURL HEAD and check success [Arguments] ${url} ${options}=${EMPTY}
${output} ${stderr} Do CURL HEAD ${url} ${options}
${output} ${rc} Do CURL HEAD ${url} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 200 OK
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

Do CURL GET [Arguments] ${url} ${options}=${EMPTY}
${output} ${stderr} Curl GET ${url} ${options}
[Return] ${output} ${stderr}
${output} ${rc} Curl GET ${url} ${options}
[Return] ${output} ${rc}

Do CURL GET and check success [Arguments] ${url} ${options}=${EMPTY}
${output} ${stderr} Do CURL GET ${url} ${options}
${output} ${rc} Do CURL GET ${url} ${options}
Should Contain ${output} 200 OK
[Return] ${output} ${stderr}
Should Be Equal As Integers ${rc} 0
[Return] ${output} ${rc}

Do CURL partial GET [Arguments] ${url} ${rangelist} ${options}=${EMPTY}
${rangeheader} Get CURL header Range bytes=${rangelist}
${output} ${stderr} Do CURL GET ${url} ${rangeheader} ${options}
[Return] ${output} ${stderr}
${output} ${rc} Do CURL GET ${url} ${rangeheader} ${options}
[Return] ${output} ${rc}

Do CURL partial GET and check success [Arguments] ${url} ${rangelist} ${options}=${EMPTY}
${output} ${stderr} Do CURL partial GET ${url} ${rangelist} ${options}
${output} ${rc} Do CURL partial GET ${url} ${rangelist} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 206 Partial Content
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

Do CURL PUT [Arguments] ${url} ${localFilePath} ${options}=${EMPTY}
${output} ${stderr} Curl PUT ${url} -T ${localFilePath} ${options}
[Return] ${output} ${stderr}
${output} ${rc} Curl PUT ${url} -T ${localFilePath} ${options}
[Return] ${output} ${rc}

Do CURL PUT and check success [Arguments] ${url} ${localFilePath} ${options}=${EMPTY}
${output} ${stderr} Curl PUT ${url} -T ${localFilePath} ${options}
${output} ${rc} Curl PUT ${url} -T ${localFilePath} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 201 Created
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

Do CURL PUT and check overwrite success [Arguments] ${url} ${localFilePath} ${options}=${EMPTY}
${output} ${stderr} Curl PUT ${url} -T ${localFilePath} ${options}
${output} ${rc} Curl PUT ${url} -T ${localFilePath} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 204 No Content
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

Do CURL MKCOL [Arguments] ${url} ${options}=${EMPTY}
${output} ${stderr} Curl MKCOL ${url} ${options}
[Return] ${output} ${stderr}
${output} ${rc} Curl MKCOL ${url} ${options}
[Return] ${output} ${rc}

Do CURL MKCOL and check success [Arguments] ${url} ${options}=${EMPTY}
${output} ${stderr} Do CURL MKCOL ${url} ${options}
${output} ${rc} Do CURL MKCOL ${url} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 201 Created
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

Do CURL DELETE [Arguments] ${url} ${options}=${EMPTY}
${output} ${stderr} Curl DELETE ${url} ${options}
[Return] ${output} ${stderr}
${output} ${rc} Curl DELETE ${url} ${options}
[Return] ${output} ${rc}

Do CURL DELETE and check success [Arguments] ${url} ${options}=${EMPTY}
${output} ${stderr} Do CURL DELETE ${url} ${options}
${output} ${rc} Do CURL DELETE ${url} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 204 No Content
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

Do CURL COPY [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY}
${destHeader} Get CURL header Destination ${destURL}
${output} ${stderr} Curl COPY ${srcURL} ${destHeader} ${options}
[Return] ${output} ${stderr}
${output} ${rc} Curl COPY ${srcURL} ${destHeader} ${options}
[Return] ${output} ${rc}

Do CURL COPY and check success [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY}
${output} ${stderr} Do CURL COPY ${srcURL} ${destURL} ${options}
${output} ${rc} Do CURL COPY ${srcURL} ${destURL} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 201 Created
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

Do CURL COPY and check overwrite success [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY}
${output} ${stderr} Do CURL COPY ${srcURL} ${destURL} ${options}
${output} ${rc} Do CURL COPY ${srcURL} ${destURL} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 204 No Content
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

Do CURL MOVE [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY}
${destHeader} Get CURL header Destination ${destURL}
${output} ${stderr} Curl MOVE ${srcURL} ${destHeader} ${options}
[Return] ${output} ${stderr}
${output} ${rc} Curl MOVE ${srcURL} ${destHeader} ${options}
[Return] ${output} ${rc}

Do CURL MOVE and check success [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY}
${output} ${stderr} Do CURL MOVE ${srcURL} ${destURL} ${options}
${output} ${rc} Do CURL MOVE ${srcURL} ${destURL} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 201 Created
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

Do CURL MOVE and check overwrite success [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY}
${output} ${stderr} Do CURL MOVE ${srcURL} ${destURL} ${options}
${output} ${rc} Do CURL MOVE ${srcURL} ${destURL} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 204 No Content
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

Do CURL PROPFIND [Arguments] ${url} ${bodyContent} ${options}=${EMPTY}
${body} Get CURL body ${bodyContent}
${output} ${stderr} Curl PROPFIND ${url} ${body} ${options}
[Return] ${output} ${stderr}
${output} ${rc} Curl PROPFIND ${url} ${body} ${options}
[Return] ${output} ${rc}

Do CURL PROPFIND and check success [Arguments] ${url} ${bodyContent} ${options}=${EMPTY}
${output} ${stderr} Do CURL PROPFIND ${url} ${bodyContent} ${options}
${output} ${rc} Do CURL PROPFIND ${url} ${bodyContent} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 207 Multi-status
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

Do CURL OPTIONS [Arguments] ${url} ${options}=${EMPTY}
${output} ${stderr} Curl OPTIONS ${url} ${options}
[Return] ${output} ${stderr}
${output} ${rc} Curl OPTIONS ${url} ${options}
[Return] ${output} ${rc}

Do CURL OPTIONS and check success [Arguments] ${url} ${options}=${EMPTY}
${output} ${stderr} Do CURL OPTIONS ${url} ${options}
${output} ${rc} Do CURL OPTIONS ${url} ${options}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 200 OK
Should Contain ${output} DAV: 1
[Return] ${output} ${stderr}
[Return] ${output} ${rc}

4 changes: 2 additions & 2 deletions tests/filetransfer/get.robot
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ File-Transfer get VO file as anonymous with anonymous http read disabled
${token} ${turl} Do a prepareToGet ${surl} http
${out} ${err} Do CURL GET ${turl}
Should Not Contain ${out} 200 OK
Should Contain ${out} 403
[Teardown] Clear all credentials
Should Match Regexp ${out} (403|401 Unauthorized)
[Teardown] Clear all credentials
Loading

0 comments on commit 11b1431

Please sign in to comment.