diff --git a/lib/clientSRM.txt b/lib/clientSRM.txt index 1f094c2..3b42df5 100644 --- a/lib/clientSRM.txt +++ b/lib/clientSRM.txt @@ -1,21 +1,24 @@ ** Settings *** Library OperatingSystem -Resource lib/credentials.txt Resource variables.txt *** Keywords *** Execute clientSRM Command [Arguments] ${cmd} ${options}=${EMPTY} - ${output} Execute and Check Success clientSRM ${cmd} ${options} -e ${srmEndpoint} + ${output} ${stderr} Execute and Check Success clientSRM ${cmd} ${options} -e ${srmEndpoint} [Return] ${output} Execute clientSRM Command on Surl [Arguments] ${cmd} ${surl} ${options}=${EMPTY} - ${output} Execute and Check Success clientSRM ${cmd} ${options} -e ${srmEndpoint} -s ${surl} + ${output} ${stderr} Execute and Check Success clientSRM ${cmd} ${options} -e ${srmEndpoint} -s ${surl} [Return] ${output} Execute clientSRM Command on Surl with Token [Arguments] ${cmd} ${surl} ${token} ${options}=${EMPTY} - ${output} Execute and Check Success clientSRM ${cmd} ${options} -e ${srmEndpoint} -s ${surl} -t ${token} + ${output} ${stderr} Execute and Check Success clientSRM ${cmd} ${options} -e ${srmEndpoint} -s ${surl} -t ${token} + [Return] ${output} + +Execute clientSRM Command with Token [Arguments] ${cmd} ${token} ${options}=${EMPTY} + ${output} ${stderr} Execute and Check Success clientSRM ${cmd} ${options} -e ${srmEndpoint} -t ${token} [Return] ${output} Perform mkdir using clientSRM [Arguments] ${surl} ${options}=${EMPTY} @@ -31,7 +34,7 @@ Perform rmdir using clientSRM [Arguments] ${surl} ${options}=${EMPTY} [Return] ${output} Perform ping using clientSRM - ${output} Execute clientSRM Command on Surl ping -e ${srmEndpoint} + ${output} Execute clientSRM Command ping -e ${srmEndpoint} [Return] ${output} Perform ptp using clientSRM [Arguments] ${surl} ${options}=${EMPTY} @@ -39,6 +42,12 @@ Perform ptp using clientSRM [Arguments] ${surl} ${options}=${EMPTY} ${result} ${token}= Should Match Regexp ${output} requestToken=(\".+\") [Return] ${output} ${token} +Perform ptp with transfer protocol using clientSRM [Arguments] ${surl} ${protocol} ${options}=${EMPTY} + ${output} Execute clientSRM Command on Surl ptp ${surl} -T -P ${protocol} ${options} + ${result} ${token}= Should Match Regexp ${output} requestToken=(\".+\") + ${result} ${turl}= Should Match Regexp ${output} TURL=(\".+\") + [Return] ${output} ${token} ${turl} + Perform sptp using clientSRM [Arguments] ${surl} ${token} ${options}=${EMPTY} ${output} Execute clientSRM Command on Surl with token sptp ${surl} ${token} ${options} [Return] ${output} @@ -52,6 +61,17 @@ Perform ptg using clientSRM [Arguments] ${surl} ${options}=${EMPTY} ${result} ${token}= Should Match Regexp ${output} requestToken=(\".+\") [Return] ${output} ${token} +Perform ptg with transfer protocol using clientSRM [Arguments] ${surl} ${protocol} ${options}=${EMPTY} + ${output} Execute clientSRM Command on Surl ptg ${surl} -T -P ${protocol} ${options} + ${result} ${token}= Should Match Regexp ${output} requestToken=(\".+\") + ${result} ${turl}= Should Match Regexp ${output} transferURL=(\".+\") + [Return] ${output} ${token} ${turl} + +Perform bol using clientSRM [Arguments] ${surl} ${options}=${EMPTY} + ${output} Execute clientSRM Command on Surl bol ${surl} ${options} + ${result} ${token}= Should Match Regexp ${output} requestToken=(\".+\") + [Return] ${output} ${token} + Perform sptg using clientSRM [Arguments] ${surl} ${token} ${options}=${EMPTY} ${output} Execute clientSRM Command on Surl with token sptg ${surl} ${token} ${options} [Return] ${output} @@ -64,6 +84,10 @@ Perform rf using clientSRM without token [Arguments] ${surl} ${options}=${EMP ${output} Execute clientSRM Command on Surl rf ${surl} ${options} [Return] ${output} +Perform rf using clientSRM without surl [Arguments] ${token} ${options}=${EMPTY} + ${output} Execute clientSRM Command with Token rf ${token} ${options} + [Return] ${output} + Perform abort request using clientSRM [Arguments] ${token} ${options}=${EMPTY} ${output} Execute clientSRM Command AbortRequest -t ${token} ${options} [Return] ${output} @@ -91,8 +115,8 @@ Get unused size using clientSRM [Arguments] ${storageAreaToken} ${result} ${unusedSize}= Should Match Regexp ${output} unusedSize=(.+) [Return] ${unusedSize} -Get space metadata using clientSRM [Arguments] ${token} - ${output} Execute clientSRM Command gsm -e httpg://${srmEndpoint}/ -s ${token} +Get space metadata using clientSRM [Arguments] ${storageAreaToken} + ${output} Execute clientSRM Command gsm -e httpg://${srmEndpoint}/ -s ${storageAreaToken} [Return] ${output} Get request summary using clientSRM [Arguments] ${token} @@ -136,8 +160,7 @@ Remove file using clientSRM [Arguments] ${storageArea} ${path} ${output} Perform rm using clientSRM ${surl} [Return] ${output} -Put without really putting using clientSRM [Arguments] ${storageArea} ${path} - ${surl} Build Surl ${storageArea} ${path} +Put without really putting using clientSRM [Arguments] ${surl} ${output} ${token} Perform ptp using clientSRM ${surl} -p Should Contain ${output} SRM_SPACE_AVAILABLE ${output} Perform pd using clientSRM ${surl} ${token} -p @@ -149,25 +172,11 @@ List files in directory using clientSRM [Arguments] ${storageArea} ${path} ${output} Perform ls using clientSRM ${surl} [Return] ${output} -Get space token using clientSRM [Arguments] ${token}=${storageAreaToken} +Get space token using clientSRM [Arguments] ${token} ${output} Execute clientSRM Command gst -v ES -e httpg://${srmEndpoint} -d ${token} ${result} ${token}= Should Match Regexp ${output} (\".+-.+-.+-.+-.+\") [Return] ${token} -Get space token output using clientSRM [Arguments] ${token}=${storageAreaToken} +Get space token output using clientSRM [Arguments] ${token} ${output} Execute clientSRM Command gst -v ES -e httpg://${srmEndpoint} -d ${token} - [Return] ${output} - -Init certificate and voms proxy [Arguments] ${certificate} ${vo} - Use certificate ${certificate} - Create proxy --voms ${vo} - -Init certificate and plain proxy [Arguments] ${certificate} - Use certificate ${certificate} - Create plain proxy - -Init certificate with unencrypted key [Arguments] ${certificate} - Use certificate with unencrypted key ${certificate} - -Clear all credentials - Stop using certificate + [Return] ${output} \ No newline at end of file diff --git a/lib/config.txt b/lib/config.txt new file mode 100644 index 0000000..dfa0e58 --- /dev/null +++ b/lib/config.txt @@ -0,0 +1,25 @@ +** Settings ** + +Resource variables.txt + +*** Keywords *** + +Get user voms proxy path [Arguments] ${user} ${voname} + ${path} Set Variable /tmp/${TESTDIR}/proxies/${voname}/${user} + [Return] ${path} + +Get user grid proxy path [Arguments] ${user} + ${path} Set Variable /tmp/${TESTDIR}/proxies/grid/${user} + [Return] ${path} + +Get user x509 p12 path [Arguments] ${user} + ${path} Set Variable /tmp/${TESTDIR}/certificates/${user}.p12 + [Return] ${path} + +Get user x509 cert path [Arguments] ${user} + ${path} Set Variable /tmp/${TESTDIR}/certificates/${user}.cert.pem + [Return] ${path} + +Get user x509 key path [Arguments] ${user} + ${path} Set Variable /tmp/${TESTDIR}/certificates/${user}.key.pem + [Return] ${path} \ No newline at end of file diff --git a/lib/credentials.txt b/lib/credentials.txt deleted file mode 100644 index c71afa3..0000000 --- a/lib/credentials.txt +++ /dev/null @@ -1,56 +0,0 @@ -*** Setting *** - -Library OperatingSystem -Library Collections -Resource lib/stormlib.txt - -*** Keywords *** - -Use certificate [Arguments] ${cert} - File Should Exist ${certsDir}/${cert}.cert.pem - File Should Exist ${certsDir}/${cert}.key.pem - Stop using certificate - Execute and Check Success cp ${certsDir}/${cert}.cert.pem %{HOME}/.globus/usercert.pem - Execute and Check Success cp ${certsDir}/${cert}.key.pem %{HOME}/.globus/userkey.pem - Execute and Check Success chmod 400 %{HOME}/.globus/userkey.pem - -Use certificate with unencrypted key [Arguments] ${cert} - File Should Exist ${certsDir}/${cert}.cert.pem - File Should Exist ${certsDir}/${cert}.key.pem - Stop using certificate - Execute and Check Success cp ${certsDir}/${cert}.cert.pem %{HOME}/.globus/usercert.pem - Execute and Check Success cp ${certsDir}/${cert}.key.pem %{HOME}/.globus/userkey.pem - Execute and Check Success openssl rsa -in %{HOME}/.globus/userkey.pem -out %{HOME}/.globus/userkey.pem -passin pass:${privateKeyPassword} - Execute and Check Success chmod 400 %{HOME}/.globus/userkey.pem - -Stop using certificate - Run rm %{HOME}/.globus/usercert.pem - Run rm -f %{HOME}/.globus/userkey.pem - Run voms-proxy-destroy - -Get options list [Arguments] @{params} - ${optionsList} Set Variable ${EMPTY} - :FOR ${option} IN @{params} - \ ${optionsList} = Catenate ${optionsList} ${option} - Log Many ${optionsList} - [Return] ${optionsList} - -Get proxy info [Arguments] @{params} - ${options}= Get options list @{params} - ${output}= Run voms-proxy-info ${options} - [Return] ${output} - -Create proxy [Arguments] @{params} - ${options}= Get options list @{params} - ${output} Execute and Check Success echo ${privateKeyPassword}|voms-proxy-init -pwstdin ${options} - [Return] ${output} - -Create plain proxy - Execute and Check Success echo ${privateKeyPassword} | voms-proxy-init -pwstdin - -Destroy proxy [Arguments] @{params} - ${options}= Get options list @{params} - Execute and Check Success voms-proxy-destroy ${options} - -Create voms proxy [Arguments] ${vo}=${vo1} - ${output} Execute and Check Success echo ${privateKeyPassword}|voms-proxy-init -pwstdin -voms ${vo} \ No newline at end of file diff --git a/lib/curl.txt b/lib/curl.txt new file mode 100644 index 0000000..7881b2d --- /dev/null +++ b/lib/curl.txt @@ -0,0 +1,51 @@ +** Settings *** + +Library OperatingSystem +Resource variables.txt +Resource config.txt + +*** Keywords *** + +### COMMAND ### + +Curl [Arguments] ${method} ${url} ${options}=${EMPTY} + ${output} ${stderr} Execute and Check Success curl ${options} ${url} -X ${method} -s -L -iv + Log ${output} + Log ${stderr} + [Return] ${output} ${stderr} + +### OPTIONS ### + +Get CURL x509 options [Arguments] ${user}=${DEFAULT_USER} + ${proxy} Get user grid proxy path ${user} + ${x509cert} Get user x509 cert path ${user} + ${options} Set variable --cert ${proxy} --cacert ${x509cert} --capath ${trustdir} + [Return] ${options} + +Get CURL x509 personal certificate options [Arguments] ${user}=${DEFAULT_USER} + ${x509cert} Get user x509 cert path ${user} + ${x509key} Get user x509 key path ${user} + ${options} Set variable --cert ${x509cert} --key ${x509key} --capath ${trustdir} + [Return] ${options} + +Get CURL VOMS proxy options [Arguments] ${user}=${DEFAULT_USER} ${voname}=${DEFAULT_VO} + ${proxy} Get user voms proxy path ${user} ${voname} + ${x509cert} Get user x509 cert path ${user} + ${options} Set variable --cert ${proxy} --cacert ${x509cert} --capath ${trustdir} + [Return] ${options} + +Get CURL default VOMS proxy options + ${options} Get CURL VOMS proxy options + [Return] ${options} + +Get CURL default x509 options + ${options} Get CURL x509 options + [Return] ${options} + +Get CURL header [Arguments] ${name} ${value} + ${output} Set variable --header "${name}: ${value}" + [Return] ${output} + +Get CURL body [Arguments] ${value} + ${output} Set variable --data-ascii "${value}" + [Return] ${output} diff --git a/lib/dcache.txt b/lib/dcache.txt index 3dc71d5..e85b65d 100644 --- a/lib/dcache.txt +++ b/lib/dcache.txt @@ -5,7 +5,7 @@ Resource variables.txt *** Keywords *** Execute dCache srm command [Arguments] ${cmd} ${url} - ${output} Execute and Check Success srm${cmd} -2 ${url} + ${output} ${stderr} Execute and Check Success srm${cmd} -2 ${url} [Return] ${output} Execute dCache srm command and check failure [Arguments] ${cmd} ${url} @@ -16,26 +16,26 @@ Ping using dCache client ${output} Execute dCache srm command ping srm://${srmEndpoint} [Return] ${output} -Create directory using dCache client [Arguments] ${storageArea} ${dirName} - ${output} Execute dCache srm command mkdir srm://${srmEndpoint}/${storageArea}/${dirName} +Create directory using dCache client [Arguments] ${surl} + ${output} Execute dCache srm command mkdir ${surl} Should Be Empty ${output} -Try to create directory using dCache client [Arguments] ${storageArea} ${dirName} - ${output} Execute dCache srm command and check failure mkdir srm://${srmEndpoint}/${storageArea}/${dirName} +Try to create directory using dCache client [Arguments] ${surl} + ${output} Execute dCache srm command and check failure mkdir ${surl} [Return] ${output} -Remove directory using dCache client [Arguments] ${storageArea} ${dirName} - ${output} Execute dCache srm command rmdir srm://${srmEndpoint}/${storageArea}/${dirName} +Remove directory using dCache client [Arguments] ${surl} + ${output} Execute dCache srm command rmdir ${surl} Should Be Empty ${output} -Try to remove directory using dCache client [Arguments] ${storageArea} ${dirName} - ${output} Execute dCache srm command and check failure rmdir srm://${srmEndpoint}/${storageArea}/${dirName} +Try to remove directory using dCache client [Arguments] ${surl} + ${output} Execute dCache srm command and check failure rmdir ${surl} [Return] ${output} -Remove file using dCache client [Arguments] ${storageArea} ${path} - ${output} Execute dCache srm command rm srm://${srmEndpoint}/${vo}/${path} +Remove file using dCache client [Arguments] ${surl} + ${output} Execute dCache srm command rm ${surl} Should Not Contain ${output} SRM_FAILURE -Try to remove file using dCache client [Arguments] ${storageArea} ${path} - ${output} Execute dCache srm command and check failure rm srm://${srmEndpoint}/${storageArea}/${path} +Try to remove file using dCache client [Arguments] ${surl} + ${output} Execute dCache srm command and check failure rm ${surl} [Return] ${output} diff --git a/lib/filetransfer.txt b/lib/filetransfer.txt new file mode 100644 index 0000000..b8c3f39 --- /dev/null +++ b/lib/filetransfer.txt @@ -0,0 +1,31 @@ +** Settings *** + +Library OperatingSystem +Resource curl.txt +Resource variables.txt + +*** Keywords *** + +##### URL BUILDING + +Build FileTransfer URL [Arguments] ${endpoint} ${path} + ${output} Set variable ${endpoint}/${path} + [Return] ${output} + +##### METHODS + +FileTransfer GET [Arguments] ${endpoint} ${storageArea} ${relativePath} ${credentials}=${EMPTY} + ${url} Build FileTransfer URL ${endpoint} ${storageArea}/${relativePath} + ${output} Curl GET ${url} ${credentials} -iv + [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} + [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} \ No newline at end of file diff --git a/lib/globus_util.txt b/lib/globus_util.txt index 13639e9..fbde713 100644 --- a/lib/globus_util.txt +++ b/lib/globus_util.txt @@ -5,15 +5,15 @@ Resource variables.txt *** Keywords *** -Copy-out file using globus-utils [Arguments] ${localPath} ${storageArea} ${remotePath} - Execute and Check Success globus-url-copy file:///tmp/${localPath} gsiftp://${globusEndpoint}/${storageAreaRoot}/${storageArea}/${remotePath} +Copy-out file using globus-utils [Arguments] ${localPath} ${turl} + Execute and Check Success globus-url-copy file:///tmp/${TESTDIR}/${localPath} ${turl} -Try to copy-out file using globus-utils [Arguments] ${localPath} ${storageArea} ${remotePath} - ${output} Execute and Check Failure globus-url-copy file:///tmp/${localPath} gsiftp://${globusEndpoint}/${storageAreaRoot}/${storageArea}/${remotePath} +Try to copy-out file using globus-utils [Arguments] ${localPath} ${turl} + ${output} Execute and Check Failure globus-url-copy file:///tmp/${TESTDIR}/${localPath} ${turl} [Return] ${output} -Copy-in file using globus-utils [Arguments] ${storageArea} ${remotePath} ${localPath} - Execute and Check Success globus-url-copy gsiftp://${globusEndpoint}/${storageAreaRoot}/${storageArea}/${remotePath} file:///tmp/${localPath} +Copy-in file using globus-utils [Arguments] ${turl} ${localPath} + Execute and Check Success globus-url-copy ${turl} file:///tmp/${TESTDIR}/${localPath} Copy-in file using gsiftp protocol [Arguments] ${turl} ${localPath} - Execute and Check Success globus-url-copy ${turl} file:///tmp/${localPath} + Execute and Check Success globus-url-copy ${turl} file:///tmp/${TESTDIR}/${localPath} diff --git a/lib/lcg_util.txt b/lib/lcg_util.txt index 882b47e..43fb728 100644 --- a/lib/lcg_util.txt +++ b/lib/lcg_util.txt @@ -5,25 +5,26 @@ Resource variables.txt *** Keywords *** -List files in directory using lcg_utils [Arguments] ${storageArea} ${path} - ${surl} Build surl ${storageArea} ${path} +List files in directory using lcg_utils [Arguments] ${surl} ${output} Run lcg-ls -l -b -D srmv2 ${surl} [Return] ${output} Check file exists using lcg-utils [Arguments] ${surl} - Execute and Check Success lcg-ls -l -b -D srmv2 ${surl} + ${output} Run lcg-ls -l -b -D srmv2 ${surl} + [Return] ${output} Check file does not exists using lcg-utils [Arguments] ${surl} ${output} Run lcg-ls -l -b -D srmv2 ${surl} Should Contain ${output} No such file or directory -Copy-out file using lcg-utils [Arguments] ${localPath} ${surl} ${options}=${EMPTY} - ${output} Execute and Check Success lcg-cp -b -D srmv2 file:///tmp/${localPath} ${surl} -v ${options} +Copy-out file using lcg-utils [Arguments] ${localFileName} ${surl} ${options}=${EMPTY} + ${output} Run lcg-cp -b -D srmv2 file:///tmp/${TESTDIR}/${localFileName} ${surl} -v ${options} [Return] ${output} -Copy-in file using lcg-utils [Arguments] ${surl} ${localPath} - Execute and Check Success lcg-cp -b -D srmv2 ${surl} file:///tmp/${localPath} -v +Copy-in file using lcg-utils [Arguments] ${surl} ${localFileName} + ${output} Run lcg-cp -b -D srmv2 ${surl} file:///tmp/${TESTDIR}/${localFileName} -v + [Return] ${output} Copy file using lcg-utils [Arguments] ${srcSurl} ${destSurl} ${options}=${EMPTY} - ${output} Execute and Check Success lcg-cp -b -D srmv2 ${srcSurl} ${destSurl} -v ${options} + ${output} Run lcg-cp -b -D srmv2 ${srcSurl} ${destSurl} -v ${options} [Return] ${output} diff --git a/lib/recall.txt b/lib/recall.txt index d571d9e..f67d118 100644 --- a/lib/recall.txt +++ b/lib/recall.txt @@ -3,22 +3,24 @@ Library OperatingSystem Resource lib/stormlib.txt Resource variables.txt +Resource lib/curl.txt + *** Keywords *** Get recall requests in progress [Arguments] ${maxResults} - ${output} Execute Curl with options http://${recallEndpoint}/recalltable/task?maxResults=${maxResults} -i + ${output} ${stderr} Curl GET http://${recallEndpoint}/recalltable/task?maxResults=${maxResults} -i [Return] ${output} Get and update to progress recall tasks ready for being taken over [Arguments] ${maxResults} - ${output} Execute Curl with options http://${recallEndpoint}/recalltable/tasks -i -s -S -H "Content-Type:text/plain" -X PUT -d first=${maxResults} + ${output} ${stderr} Curl PUT http://${recallEndpoint}/recalltable/tasks -i -s -S -H "Content-Type:text/plain" -d first=${maxResults} [Return] ${output} Update a recall task status using a groupTaskId [Arguments] ${groupTaskId} ${status} - ${output} Execute Curl with options http://${recallEndpoint}/recalltable/task/${groupTaskId} -i -s -S -H "Content-Type:text/plain" -X PUT -d status=${status} + ${output} ${stderr} Curl PUT http://${recallEndpoint}/recalltable/task/${groupTaskId} -i -s -S -H "Content-Type:text/plain" -d status=${status} [Return] ${output} Check for a completed recall task [Arguments] ${requestToken} ${fileName} - ${output} Execute Curl with options http://${recallEndpoint}/recalltable/task -i -H "Content-Type:text/plain" -X PUT -d $'requestToken=${requestToken}\nsurl=srm://${srmEndpoint}/srm/managerv2?SFN=/${tapeStorageArea}/${fileName}' + ${output} ${stderr} Curl PUT http://${recallEndpoint}/recalltable/task -i -H "Content-Type:text/plain" -d $'requestToken=${requestToken}\nsurl=srm://${srmEndpoint}/srm/managerv2?SFN=/${TAPE_SA}/${fileName}' [Return] ${output} diff --git a/lib/setup.txt b/lib/setup.txt new file mode 100644 index 0000000..c0c87e4 --- /dev/null +++ b/lib/setup.txt @@ -0,0 +1,198 @@ +*** Settings *** + +Library OperatingSystem +Resource lib/config.txt +Resource lib/stormlib.txt +Resource lib/clientSRM.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt + +*** Keywords *** + +Get timestamp + ${output} Run date +"%k%M%S%d%m%Y" + [Return] ${output} + +Get uid + ${output} Run id -u + [Return] ${output} + +Set Variable If It Does Not Exist [Arguments] ${name} ${value} + ${status} ${message} = Run Keyword And Ignore Error Variable Should Exist ${name} + Run Keyword If "${status}" == "FAIL" Set Global Variable ${name} ${value} + +Set credentials for [Arguments] ${user} ${voname} + ${proxypath} Get user voms proxy path ${user} ${voname} + File Should Exist ${proxypath} + Set Environment Variable X509_USER_PROXY ${proxypath} + +Create directory [Arguments] ${path} + ${output} ${stderr} Execute and Check Success mkdir ${path} + Log ${output} + Log ${stderr} + +Remove directory [Arguments] ${path} + ${output} ${stderr} Execute and Check Success rm -rf ${path} + Log ${output} + Log ${stderr} + +Add user [Arguments] ${user} + ${certPath} Get user x509 p12 path ${user} + Execute and Check Success cp ${certsDir}/${user}.p12 ${certPath} + Execute and Check Success chmod 600 ${certPath} + ${certPath} Get user x509 cert path ${user} + Execute and Check Success cp ${certsDir}/${user}.cert.pem ${certPath} + Execute and Check Success chmod 600 ${certPath} + ${keyPath} Get user x509 key path ${user} + Execute and Check Success cp ${certsDir}/${user}.key.pem ${keyPath} + Execute and Check Success chmod 400 ${keyPath} + +Create voms proxy [Arguments] ${user} ${vo} + ${usercert} Get user x509 p12 path ${user} + ${userpass} Set Variable pass + ${proxy} Get user voms proxy path ${user} ${vo} + ${output} ${stderr} Execute and Check Success echo ${userpass}|voms-proxy-init -pwstdin --voms ${vo} --cert ${usercert} --out ${proxy} + Log ${output} + Log ${stderr} + +Create grid proxy [Arguments] ${user} + ${usercert} Get user x509 p12 path ${user} + ${userpass} Set Variable pass + ${proxy} Get user grid proxy path ${user} + ${output} ${stderr} Execute and Check Success echo ${userpass}|voms-proxy-init -pwstdin --cert ${usercert} --out ${proxy} + Log ${output} + Log ${stderr} + +Use default voms proxy + ${proxy} Get user voms proxy path ${DEFAULT_USER} ${DEFAULT_VO} + Set Environment Variable X509_USER_PROXY ${proxy} + +Use voms proxy [Arguments] ${user} ${voname} + ${proxy} Get user voms proxy path ${user} ${voname} + Set Environment Variable X509_USER_PROXY ${proxy} + +Use default grid proxy + ${proxy} Get user grid proxy path ${DEFAULT_USER} + Set Environment Variable X509_USER_PROXY ${proxy} + +Use grid proxy [Arguments] ${user} + ${proxy} Get user grid proxy path ${user} + Set Environment Variable X509_USER_PROXY ${proxy} + +Clear all credentials + Set Environment Variable X509_USER_PROXY ${DEFAULT_X509_USER_PROXY} + +Create remote working directory [Arguments] ${storageArea} + ${surl} Build surl ${storageArea} ${TESTDIR} + ${output} Perform mkdir using clientSRM ${surl} + Log ${output} + Should Contain ${output} SRM_SUCCESS + +Create webdav remote working directory [Arguments] ${storageArea} ${options} + ${url} Build URL ${DAVSecureEndpoint} ${storageArea} + ${output} ${stderr} Do CURL MKCOL ${url} ${options} + Log ${output} + Should Contain ${output} 201 Created + +Clear remote working directory [Arguments] ${storageArea} + ${surl} Build surl ${storageArea} ${TESTDIR} + ${output} Perform rmdir using clientSRM ${surl} -r + Log ${output} + Should Contain ${output} SRM_SUCCESS + +Clear webdav remote working directory [Arguments] ${storageArea} ${options} + ${url} Build URL ${DAVSecureEndpoint} ${storageArea} + ${output} ${stderr} Do CURL DELETE ${url} ${options} + Log ${output} + Should Contain ${output} 204 No Content + +Setup local working directory + ${timestamp} Get timestamp + ${uid} Get uid + Set Variable If It Does Not Exist \${TESTDIR} storm-testsuite_${timestamp.strip()} + Set Variable If It Does Not Exist \${DEFAULT_X509_USER_PROXY} /tmp/x509up_u${uid} + Create directory /tmp/${TESTDIR} + Create directory /tmp/${TESTDIR}/proxies + Create directory /tmp/${TESTDIR}/certificates + Create directory /tmp/${TESTDIR}/proxies/${VO.1} + Create directory /tmp/${TESTDIR}/proxies/${VO.2} + Create directory /tmp/${TESTDIR}/proxies/grid + Add user test0 + Add user test1 + Add user apostrofe + Create voms proxy test0 test.vo + Create voms proxy test1 test.vo + Create voms proxy test0 testers.eu-emi.eu + Create voms proxy apostrofe test.vo + Create grid proxy test0 + +Setup remote working directories + Use voms proxy test0 test.vo + Create remote working directory test.vo + Create remote working directory igi + Create remote working directory noauth + Use voms proxy test0 testers.eu-emi.eu + Create remote working directory testers.eu-emi.eu + Create remote working directory alias + Create remote working directory test.vo.bis + Create remote working directory tape + Clear all credentials + +Setup webdav remote working directories + Use voms proxy test0 test.vo + ${options} Get CURL VOMS proxy options test0 test.vo + Create webdav remote working directory test.vo ${options} + Create webdav remote working directory igi ${options} + Create webdav remote working directory noauth ${options} + Use voms proxy test0 testers.eu-emi.eu + ${options} Get CURL VOMS proxy options test0 testers.eu-emi.eu + Create webdav remote working directory testers.eu-emi.eu ${options} + Create webdav remote working directory alias ${options} + Create webdav remote working directory test.vo.bis ${options} + Create webdav remote working directory tape ${options} + Clear all credentials + +Teardown local working directory + Remove directory /tmp/${TESTDIR} + +Teardown remote working directories + Use voms proxy test0 test.vo + Clear remote working directory test.vo + Clear remote working directory igi + Clear remote working directory noauth + Use voms proxy test0 testers.eu-emi.eu + Clear remote working directory testers.eu-emi.eu + Clear remote working directory test.vo.bis + Clear remote working directory alias + Clear remote working directory tape + Clear all credentials + +Teardown webdav remote working directories + Use voms proxy test0 test.vo + ${options} Get CURL VOMS proxy options test0 test.vo + Clear webdav remote working directory test.vo ${options} + Clear webdav remote working directory igi ${options} + Clear webdav remote working directory noauth ${options} + Use voms proxy test0 testers.eu-emi.eu + ${options} Get CURL VOMS proxy options test0 testers.eu-emi.eu + Clear webdav remote working directory testers.eu-emi.eu ${options} + Clear webdav remote working directory test.vo.bis ${options} + Clear webdav remote working directory alias ${options} + Clear webdav remote working directory tape ${options} + Clear all credentials + +Setup suite + Setup local working directory + Setup remote working directories + +Setup suite webdav + Setup local working directory + Setup webdav remote working directories + +Teardown suite + Teardown remote working directories + Teardown local working directory + +Teardown suite webdav + Teardown webdav remote working directories + Teardown local working directory diff --git a/lib/stormlib.txt b/lib/stormlib.txt index 88032d7..77c28c3 100644 --- a/lib/stormlib.txt +++ b/lib/stormlib.txt @@ -7,57 +7,56 @@ Resource variables.txt Execute and Check Success [Arguments] ${cmd} ${rc} ${output}= Run and Return RC And Output ${cmd} - Should Be Equal As Integers ${rc} 0 ${output} False - [Return] ${output} + Should Be Equal As Integers ${rc} 0 ${cmd} failed with ${output} False + [Return] ${output} ${EMPTY} Execute and Check Failure [Arguments] ${cmd} ${rc} ${output}= Run and Return RC And Output ${cmd} - Should Not Be Equal As Integers ${rc} 0 ${output} + Should Not Be Equal As Integers ${rc} 0 ${cmd} failed with ${output} [Return] ${output} Get a unique name - ${name} Execute and Check Success basename `mktemp` + ${name} ${stderr} Execute and Check Success basename `mktemp` + Execute and Check Success rm -f /tmp/${name} [Return] ${name} Create local file ${name} Get a unique name - Execute and Check Success dd if=/dev/urandom of=/tmp/${name} bs=1M count=1 + Execute and Check Success dd if=/dev/urandom of=/tmp/${TESTDIR}/${name} bs=1M count=1 [Return] ${name} +Create local file with text [Arguments] ${fileContent}=File di testo di prova + ${name} Get a unique name + ${path} Get local file path from name ${name} + Execute and Check Success echo -n "${fileContent}" > ${path} + [Return] ${name} + +Get local file path from name [Arguments] ${name} + [Return] /tmp/${TESTDIR}/${name} + Create local file with fake size [Arguments] ${megabytes} ${name} Get a unique name - Execute and Check Success dd if=/dev/null of=/tmp/${name} bs=1M count=1 seek=${megabytes} + Execute and Check Success dd if=/dev/null of=/tmp/${TESTDIR}/${name} bs=1M count=1 seek=${megabytes} [Return] ${name} Create local empty file ${name} Get a unique name - Execute and Check Success touch /tmp/${name} + Execute and Check Success touch /tmp/${TESTDIR}/${name} [Return] ${name} -Remove local file [Arguments] ${filename} - Execute and Check Success rm -f /tmp/${filename} - -Remove local directory [Arguments] ${dirname} - Execute and Check Success rm -rf /tmp/${dirname} - Create local file with checksum that starts with zero ${name} Get a unique name - Execute and Check Success echo "a" > /tmp/${name} + Execute and Check Success echo "a" > /tmp/${TESTDIR}/${name} [Return] ${name} -Execute Curl with proxy and options [Arguments] ${url} ${options}=${EMPTY} - [Documentation] This keyword should be used when invoking CURL with a proxy certificate - ${output} Execute and Check Success curl --cert ${userproxy} --cacert ${usercert} --capath ${trustdir} ${options} ${url} -L - [Return] ${output} +Create local directory [Arguments] ${dirname} + Execute and Check Success mkdir /tmp/${dirname} -Execute Curl with certificate and options [Arguments] ${url} ${options}=${EMPTY} - [Documentation] This keyword should be used when invoking CURL with an EEC - ${output} Execute and Check Success curl --cert ${usercert} --key ${userkey} --capath ${trustdir} ${options} ${url} -L - [Return] ${output} +Remove local file [Arguments] ${filename} + Execute and Check Success rm -f /tmp/${TESTDIR}/${filename} -Execute Curl with options [Arguments] ${url} ${options}=${EMPTY} - ${output} Execute and Check Success curl ${options} ${url} -L - [Return] ${output} +Remove local directory [Arguments] ${dirname} + Execute and Check Success rm -rf /tmp/${dirname} Build surl [Arguments] ${storageArea} ${relativePath} ${output} Set variable srm://${srmEndpoint}/srm/managerv2?SFN=/${storageArea}/${relativePath} @@ -67,18 +66,10 @@ Build simple surl [Arguments] ${storageArea} ${relativePath} ${output} Set variable srm://${srmEndpoint}/${storageArea}/${relativePath} [Return] ${output} -Build file transfer TURL [Arguments] ${storageArea} ${relativePath} - ${output} Set variable http://${filetransferEndpoint}/fileTransfer/${storageArea}/${relativePath} +Build gsiftp TURL [Arguments] ${storageArea} ${relativePath} + ${output} Set variable gsiftp://${globusEndpoint}/${storageAreaRoot}/${storageArea}/${relativePath} [Return] ${output} -Build file transfer secure TURL [Arguments] ${storageArea} ${relativePath} - ${output} Set variable https://${filetransferSecureEndpoint}/fileTransfer/${storageArea}/${relativePath} - [Return] ${output} - -Build webdav secure URL [Arguments] ${storageArea} ${relativePath}=${EMPTY} - ${output} Set variable https://${davSecureEndpoint}${davContextPath}/${storageArea}/${relativePath} - [Return] ${output} - -Build webdav unsecure URL [Arguments] ${storageArea} ${relativePath}=${EMPTY} - ${output} Set variable http://${davEndpoint}${davContextPath}/${storageArea}/${relativePath} - [Return] ${output} +Get SA Token [Arguments] ${saname}=${DEFAULT_SA} + ${output} ${error} Execute and Check Success echo "${saname}" | sed "s/[^A-Za-z0-99]//g" + [Return] ${output.upper()}_TOKEN diff --git a/lib/variables.txt b/lib/variables.txt index f4b1dd6..50cd644 100644 --- a/lib/variables.txt +++ b/lib/variables.txt @@ -1,56 +1,74 @@ *** Variables *** +##### ENDPOINTS ##### + ${backEndHost} omii005-vm03.cnaf.infn.it ${frontEndHost} ${backEndHost} ${frontEndPort} 8444 -${gridHTTPsHost} ${backEndHost} -${gridHTTPsPort} 8085 -${gridHTTPsSecurePort} 8443 - ${gridFTPHost} ${frontEndHost} ${srmEndpoint} ${frontEndHost}:${frontEndPort} ${globusEndpoint} ${frontEndHost}:2811 ${recallEndpoint} ${backEndHost}:9998 -${davEndpoint} ${gridHTTPsHost}:${gridHTTPsPort} -${davSecureEndpoint} ${gridHTTPsHost}:${gridHTTPsSecurePort} -${davContextPath} /webdav +${DAVHost} ${backEndHost} +${DAVPort} 8085 +${DAVSecurePort} 8443 -${filetransferEndpoint} ${gridHTTPsHost}:${gridHTTPsPort} -${filetransferSecureEndpoint} ${gridHTTPsHost}:${gridHTTPsSecurePort} +${DAVContextPath} /webdav -${storageAreaRoot} /storage +${DAVEndpoint} http://${DAVHost}:${DAVPort}${DAVContextPath} +${DAVSecureEndpoint} https://${DAVHost}:${DAVSecurePort}${DAVContextPath} + +${ldapEndpoint} ${backEndHost}:2170 -${vo} testers.eu-emi.eu +##### CREDENTIALS ##### -${storageAreaToken} TESTERSEUEMIEU_TOKEN +${DEFAULT_USER} test0 ${certsDir} /usr/share/igi-test-ca ${privateKeyPassword} pass - -${usercert} $HOME/.globus/usercert.pem -${userkey} $HOME/.globus/userkey.pem -${userproxy} $X509_USER_PROXY ${trustdir} /etc/grid-security/certificates -${anonymousRWStorageArea} noauth -${anonymousBisRWStorageArea} noauth -${vomsproxyRWStorageArea} testers.eu-emi.eu -${vomsproxyBisRWStorageArea} testers.eu-emi.eu -${gridproxyRWStorageArea} igi -${gridproxyBisRWStorageArea} igi -${personalcertRWStorageArea} igi -${personalcertBisRWStorageArea} igi -${tapeStorageArea} ${vomsproxyRWStorageArea} - -${ldapEndpoint} ${backEndHost}:2170 +##### GLUE ##### ${baseDNGlue} mds-vo-name=resource,o=grid ${baseDNGlue2} GLUE2GroupID=resource,o=glue -${symlinkSURL} srm://${srmEndpoint}/${gridproxyRWStorageArea}/${vomsproxyRWStorageArea} -${symlinkSURL2} srm://${srmEndpoint}/${gridproxyRWStorageArea}/grid-security -${symlinkSURL3} srm://${srmEndpoint}/${gridproxyRWStorageArea}/storm +##### VOs ###### + +${VO.1} test.vo +${VO.2} testers.eu-emi.eu + +${DEFAULT_VO} ${VO.1} + +##### STORAGE AREAS ##### + +${storageAreaRoot} /storage + +${SA.1} test.vo +${SA.2} testers.eu-emi.eu +${SA.4} testers.eu-emi.eu/nested +${SA.5} alias +${SA.6} tape +${SA.7} igi +${SA.8} test.vo.bis +${SA.9} noauth + +${DEFAULT_SA} ${SA.1} +${DEFAULT_SA_VONAME} ${VO.1} + +${TAPE_SA} ${SA.6} +${TAPE_SA_VONAME} ${VO.2} + +${NESTED_SA} ${SA.4} +${NESTED_SA_VONAME} ${VO.2} + +${ALIASED_SA} ${SA.5} +${ALIASED_SA_VONAME} ${VO.2} + +##### LINKS + +${SYMLINK.1} testvo_to_testerseuemieu \ No newline at end of file diff --git a/lib/webdav.txt b/lib/webdav.txt new file mode 100644 index 0000000..35f8f0a --- /dev/null +++ b/lib/webdav.txt @@ -0,0 +1,120 @@ +** Settings *** + +Library OperatingSystem +Resource curl.txt +Resource variables.txt + +*** Keywords *** + +##### HTTP/WEBDAV METHODS - CURL KEYWORDS + +Do CURL HEAD [Arguments] ${url} ${options}=${EMPTY} + ${output} ${stderr} Curl HEAD ${url} --head ${options} + [Return] ${output} ${stderr} + +Do CURL HEAD and check success [Arguments] ${url} ${options}=${EMPTY} + ${output} ${stderr} Do CURL HEAD ${url} ${options} + Should Contain ${output} 200 OK + [Return] ${output} ${stderr} + +Do CURL GET [Arguments] ${url} ${options}=${EMPTY} + ${output} ${stderr} Curl GET ${url} ${options} + [Return] ${output} ${stderr} + +Do CURL GET and check success [Arguments] ${url} ${options}=${EMPTY} + ${output} ${stderr} Do CURL GET ${url} ${options} + Should Contain ${output} 200 OK + [Return] ${output} ${stderr} + +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} + +Do CURL partial GET and check success [Arguments] ${url} ${rangelist} ${options}=${EMPTY} + ${output} ${stderr} Do CURL partial GET ${url} ${rangelist} ${options} + Should Contain ${output} 206 Partial Content + [Return] ${output} ${stderr} + +Do CURL PUT [Arguments] ${url} ${localFilePath} ${options}=${EMPTY} + ${output} ${stderr} Curl PUT ${url} -T ${localFilePath} ${options} + [Return] ${output} ${stderr} + +Do CURL PUT and check success [Arguments] ${url} ${localFilePath} ${options}=${EMPTY} + ${output} ${stderr} Curl PUT ${url} -T ${localFilePath} ${options} + Should Contain ${output} 201 Created + [Return] ${output} ${stderr} + +Do CURL PUT and check overwrite success [Arguments] ${url} ${localFilePath} ${options}=${EMPTY} + ${output} ${stderr} Curl PUT ${url} -T ${localFilePath} ${options} + Should Contain ${output} 204 No Content + [Return] ${output} ${stderr} + +Do CURL MKCOL [Arguments] ${url} ${options}=${EMPTY} + ${output} ${stderr} Curl MKCOL ${url} ${options} + [Return] ${output} ${stderr} + +Do CURL MKCOL and check success [Arguments] ${url} ${options}=${EMPTY} + ${output} ${stderr} Do CURL MKCOL ${url} ${options} + Should Contain ${output} 201 Created + [Return] ${output} ${stderr} + +Do CURL DELETE [Arguments] ${url} ${options}=${EMPTY} + ${output} ${stderr} Curl DELETE ${url} ${options} + [Return] ${output} ${stderr} + +Do CURL DELETE and check success [Arguments] ${url} ${options}=${EMPTY} + ${output} ${stderr} Do CURL DELETE ${url} ${options} + Should Contain ${output} 204 No Content + [Return] ${output} ${stderr} + +Do CURL COPY [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY} + ${destHeader} Get CURL header Destination ${destURL} + ${output} ${stderr} Curl COPY ${srcURL} ${destHeader} ${options} + [Return] ${output} ${stderr} + +Do CURL COPY and check success [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY} + ${output} ${stderr} Do CURL COPY ${srcURL} ${destURL} ${options} + Should Contain ${output} 201 Created + [Return] ${output} ${stderr} + +Do CURL COPY and check overwrite success [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY} + ${output} ${stderr} Do CURL COPY ${srcURL} ${destURL} ${options} + Should Contain ${output} 204 No Content + [Return] ${output} ${stderr} + +Do CURL MOVE [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY} + ${destHeader} Get CURL header Destination ${destURL} + ${output} ${stderr} Curl MOVE ${srcURL} ${destHeader} ${options} + [Return] ${output} ${stderr} + +Do CURL MOVE and check success [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY} + ${output} ${stderr} Do CURL MOVE ${srcURL} ${destURL} ${options} + Should Contain ${output} 201 Created + [Return] ${output} ${stderr} + +Do CURL MOVE and check overwrite success [Arguments] ${srcURL} ${destURL} ${options}=${EMPTY} + ${output} ${stderr} Do CURL MOVE ${srcURL} ${destURL} ${options} + Should Contain ${output} 204 No Content + [Return] ${output} ${stderr} + +Do CURL PROPFIND [Arguments] ${url} ${bodyContent} ${options}=${EMPTY} + ${body} Get CURL body ${bodyContent} + ${output} ${stderr} Curl PROPFIND ${url} ${body} ${options} + [Return] ${output} ${stderr} + +Do CURL PROPFIND and check success [Arguments] ${url} ${bodyContent} ${options}=${EMPTY} + ${output} ${stderr} Do CURL PROPFIND ${url} ${bodyContent} ${options} + Should Contain ${output} 207 Multi-status + [Return] ${output} ${stderr} + +Do CURL OPTIONS [Arguments] ${url} ${options}=${EMPTY} + ${output} ${stderr} Curl OPTIONS ${url} ${options} + [Return] ${output} ${stderr} + +Do CURL OPTIONS and check success [Arguments] ${url} ${options}=${EMPTY} + ${output} ${stderr} Do CURL OPTIONS ${url} ${options} + Should Contain ${output} 200 OK + Should Contain ${output} DAV: 1 + [Return] ${output} ${stderr} + diff --git a/lib/webdav_util.txt b/lib/webdav_util.txt new file mode 100644 index 0000000..1b54f74 --- /dev/null +++ b/lib/webdav_util.txt @@ -0,0 +1,97 @@ +*** Settings *** + +Resource setup.txt +Resource stormlib.txt +Resource curl.txt + + +*** Keywords *** + +##### TEST SETUP AND TEARDOWN + +Setup default SA + Use default voms proxy + ${options} Get CURL default VOMS proxy options + ${dirname} Get a unique name + ${filename} Create local file with text test123456789 + ${localfilepath} Get local file path from name ${filename} + Set Test Variable ${TEST_CURL_OPTIONS} ${options} + Set Test Variable ${TEST_REMOTE_DIRNAME} ${dirname} + Set Test Variable ${TEST_FILENAME} ${filename} + Set Test Variable ${TEST_LOCAL_FILEPATH} ${localfilepath} + Set Test Variable ${TEST_SA} ${DEFAULT_SA} + Set Test Variable ${TEST_ENDPOINT} ${DAVSecureEndpoint} + +Teardown default SA + Clear all credentials + +Setup SA and VO [Arguments] ${endpoint} ${sa} ${user} ${voname} + Use voms proxy ${user} ${voname} + ${options} Get CURL VOMS proxy options ${user} ${voname} + ${dirname} Get a unique name + ${filename} Create local file with text + ${localfilepath} Get local file path from name ${filename} + Set Test Variable ${TEST_CURL_OPTIONS} ${options} + Set Test Variable ${TEST_REMOTE_DIRNAME} ${dirname} + Set Test Variable ${TEST_FILENAME} ${filename} + Set Test Variable ${TEST_LOCAL_FILEPATH} ${localfilepath} + Set Test Variable ${TEST_SA} ${sa} + Set Test Variable ${TEST_ENDPOINT} ${endpoint} + +Teardown SA and VO + Clear all credentials + +Setup SA [Arguments] ${endpoint} ${sa} + Clear all credentials + ${dirname} Get a unique name + ${filename} Create local file with text + ${localfilepath} Get local file path from name ${filename} + Set Test Variable ${TEST_CURL_OPTIONS} ${EMPTY} + Set Test Variable ${TEST_REMOTE_DIRNAME} ${dirname} + Set Test Variable ${TEST_FILENAME} ${filename} + Set Test Variable ${TEST_LOCAL_FILEPATH} ${localfilepath} + Set Test Variable ${TEST_SA} ${sa} + Set Test Variable ${TEST_ENDPOINT} ${endpoint} + +Teardown SA + Clear all credentials + +### TEST INITIALIZATION + +Create empty working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + Do CURL MKCOL and check success ${url} ${TEST_CURL_OPTIONS} + +Create working directory + Create empty working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + Do CURL PUT and check success ${url} ${TEST_LOCAL_FILEPATH} ${TEST_CURL_OPTIONS} + +##### TEST UTILS + +Upload file with CURL [Arguments] ${urlDir} ${credentials}=${EMPTY} + ${filename} Create local file with text + ${path} Get local file path from name ${filename} + Do CURL PUT and check success ${urlDir}/${filename} ${path} ${credentials} + Do CURL HEAD and check success ${urlDir}/${filename} ${credentials} + [Return] ${filename} + +##### URL BUILDING + +Build URL [Arguments] ${endpoint}=${DAVSecureEndpoint} ${storagearea}=${DEFAULT_SA} ${path}=${EMPTY} + ${output} Run Keyword If '${path}'=='${EMPTY}' Set Variable ${endpoint}/${storagearea}/${TESTDIR} ELSE Set variable ${endpoint}/${storagearea}/${TESTDIR}/${path} + [Return] ${output} + +##### PROPFIND UTILS + +Get PROPFIND ALLPROP body + ${output} Set variable + [Return] ${output} + +Get PROPFIND PROPNAME body + ${output} Set variable + [Return] ${output} + +Get PROPFIND PROP body [Arguments] ${propname} + ${output} Set variable <${propname}/> + [Return] ${output} diff --git a/tests/filetransfer/__init__.txt b/tests/filetransfer/__init__.txt new file mode 100644 index 0000000..7fc5dc0 --- /dev/null +++ b/tests/filetransfer/__init__.txt @@ -0,0 +1,6 @@ +*** Settings *** + +Resource lib/setup.txt + +Suite Setup Setup suite +Suite Teardown Teardown suite \ No newline at end of file diff --git a/tests/filetransfer/get.txt b/tests/filetransfer/get.txt new file mode 100644 index 0000000..d947ec8 --- /dev/null +++ b/tests/filetransfer/get.txt @@ -0,0 +1,59 @@ +*** Settings *** + +Resource lib/clientSRM.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt +Resource lib/setup.txt + +*** Keywords *** + +Do a prepareToPut [Arguments] ${surl} + ${output} ${token} Perform ptp using clientSRM ${surl} -p + Should contain ${output} SRM_SPACE_AVAILABLE + [Return] ${token} + +Do a putDone [Arguments] ${surl} ${token} + ${output} Perform pd using clientSRM ${surl} ${token} + Should contain ${output} SRM_SUCCESS + +Do a prepareToGet [Arguments] ${surl} ${tprotocol} + ${output} ${token} ${turl} Perform ptg with transfer protocol using clientSRM ${surl} ${tprotocol} -p + Should contain ${output} SRM_FILE_PINNED + [Return] ${token} ${turl} + +Do a releaseFile [Arguments] ${surl} ${token} + ${output} Perform rf using clientSRM ${surl} ${token} + Should contain ${output} SRM_SUCCESS + +*** Test Cases *** + +File-Transfer get VO file with proxy + [Tags] filetransfer get + [Setup] Setup default SA + Create working directory + ${surl} Build surl ${TEST_SA} ${TESTDIR}/${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${token} ${turl} Do a prepareToGet ${surl} https + Do CURL GET and check success ${turl} ${TEST_CURL_OPTIONS} + Do a releaseFile ${surl} ${token} + [Teardown] Clear all credentials + +File-Transfer get VO file as anonymous with anonymous http read enabled + [Tags] filetransfer get + [Setup] Setup SA and VO ${DAVSecureEndpoint} ${SA.9} ${DEFAULT_USER} ${VO.1} + Create working directory + ${surl} Build surl ${TEST_SA} ${TESTDIR}/${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${token} ${turl} Do a prepareToGet ${surl} http + Do CURL GET and check success ${turl} + Do a releaseFile ${surl} ${token} + [Teardown] Clear all credentials + +File-Transfer get VO file as anonymous with anonymous http read disabled + [Tags] filetransfer get + [Setup] Setup default SA + Create working directory + ${surl} Build surl ${TEST_SA} ${TESTDIR}/${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${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 \ No newline at end of file diff --git a/tests/filetransfer/put.txt b/tests/filetransfer/put.txt new file mode 100644 index 0000000..36a059a --- /dev/null +++ b/tests/filetransfer/put.txt @@ -0,0 +1,42 @@ +*** Settings *** + +Resource lib/clientSRM.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt +Resource lib/setup.txt + +*** Keywords *** + +Do a prepareToPut [Arguments] ${surl} ${tprotocol} + ${output} ${token} ${turl} Perform ptp with transfer protocol using clientSRM ${surl} ${tprotocol} -p + Should contain ${output} SRM_SPACE_AVAILABLE + [Return] ${token} ${turl} + +Do a putDone [Arguments] ${surl} ${token} + ${output} Perform pd using clientSRM ${surl} ${token} + Should contain ${output} SRM_SUCCESS + +*** Test Cases *** + +File-Transfer put VO file with proxy + [Tags] filetransfer put + [Setup] Setup default SA + Create empty working directory + ${surl} Build surl ${TEST_SA} ${TESTDIR}/${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${token} ${turl} Do a prepareToPut ${surl} https + ${out} ${err} Do CURL PUT ${turl} ${TEST_LOCAL_FILEPATH} ${TEST_CURL_OPTIONS} + Should Contain ${out} 204 No Content + Do a putDone ${surl} ${token} + [Teardown] Clear all credentials + +File-Transfer PUT VO file as anonymous + [Tags] filetransfer put + [Setup] Setup default SA + Create empty working directory + ${surl} Build surl ${TEST_SA} ${TESTDIR}/${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${token} ${turl} Do a prepareToPut ${surl} http + ${out} ${err} Do CURL PUT ${turl} ${TEST_LOCAL_FILEPATH} + Should Not Contain ${out} 200 OK + Should Contain ${out} 403 + Do a putDone ${surl} ${token} + [Teardown] Clear all credentials diff --git a/tests/filetransfer/tests.txt b/tests/filetransfer/tests.txt deleted file mode 100644 index f0a9606..0000000 --- a/tests/filetransfer/tests.txt +++ /dev/null @@ -1,155 +0,0 @@ -*** 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 - [Tags] filetransfer put - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${surl} Build surl ${anonymousRWStorageArea} ${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p - Should contain ${output} SRM_SPACE_AVAILABLE - ${options} Set variable --verbose -X PUT - ${turl} Build file transfer TURL ${anonymousRWStorageArea} ${filename} - ${output} Execute Curl with options ${turl} ${options} - Should Contain ${output} 204 No Content - ${output} Perform pd using clientSRM ${surl} ${token} - Should contain ${output} SRM_SUCCESS - ${output} Perform rm using clientSRM ${surl} - Should contain ${output} SRM_SUCCESS - Remove local file ${filename} - [Teardown] Clear all credentials - -File-Transfer upload file with voms proxy - [Tags] filetransfer put - [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 --verbose -X PUT - ${turl} Build file transfer secure TURL ${vomsproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${turl} ${options} - Should Contain ${output} 204 No Content - ${output} Perform pd using clientSRM ${surl} ${token} - Should contain ${output} SRM_SUCCESS - ${output} Perform rm using clientSRM ${surl} - Should contain ${output} SRM_SUCCESS - Remove local file ${filename} - [Teardown] Clear all credentials - -File-Transfer upload file with plain proxy - [Tags] filetransfer put - [Setup] Init certificate and plain proxy test0 - ${filename} Get a unique name - ${surl} Build surl ${gridproxyRWStorageArea} ${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p - Should contain ${output} SRM_SPACE_AVAILABLE - ${options} Set variable --verbose -X PUT - ${turl} Build file transfer secure TURL ${gridproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${turl} ${options} - Should Contain ${output} 204 No Content - ${output} Perform pd using clientSRM ${surl} ${token} - Should contain ${output} SRM_SUCCESS - ${output} Perform rm using clientSRM ${surl} - Should contain ${output} SRM_SUCCESS - Remove local file ${filename} - [Teardown] Clear all credentials - -File-Transfer upload file with personal certificate - [Tags] filetransfer put - [Setup] Init certificate with unencrypted key test0 - ${filename} Get a unique name - ${surl} Build surl ${personalcertRWStorageArea} ${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p - Should contain ${output} SRM_SPACE_AVAILABLE - ${options} Set variable --verbose -X PUT - ${turl} Build file transfer secure TURL ${personalcertRWStorageArea} ${filename} - ${output} Execute Curl with certificate and options ${turl} ${options} - Should Contain ${output} 204 No Content - ${output} Perform pd using clientSRM ${surl} ${token} - Should contain ${output} SRM_SUCCESS - ${output} Perform rm using clientSRM ${surl} - Should contain ${output} SRM_SUCCESS - Remove local file ${filename} - [Teardown] Clear all credentials - -File-Transfer get file as anonymous - [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} - ${output} ${token} Perform ptg using clientSRM ${surl} -p - Should contain ${output} SRM_FILE_PINNED - ${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 rf using clientSRM ${surl} ${token} - Should contain ${output} SRM_SUCCESS - ${output} Perform rm using clientSRM ${surl} - Should contain ${output} SRM_SUCCESS - Remove local file ${filename} - [Teardown] Clear all credentials - -File-Transfer get file with voms proxy - [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} - ${output} ${token} Perform ptg using clientSRM ${surl} -p - Should contain ${output} SRM_FILE_PINNED - ${options} Set variable --verbose -X GET - ${turl} Build file transfer secure TURL ${vomsproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${turl} ${options} - Should Contain ${output} 200 OK - ${output} Perform rf using clientSRM ${surl} ${token} - Should contain ${output} SRM_SUCCESS - ${output} Perform rm using clientSRM ${surl} - Should contain ${output} SRM_SUCCESS - Remove local file ${filename} - [Teardown] Clear all credentials - -File-Transfer get file with plain proxy - [Tags] filetransfer get - [Setup] Init certificate and plain proxy test0 - ${filename} Create local file - ${surl} Build surl ${gridproxyRWStorageArea} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${output} ${token} Perform ptg using clientSRM ${surl} -p - Should contain ${output} SRM_FILE_PINNED - ${options} Set variable --verbose -X GET - ${turl} Build file transfer secure TURL ${gridproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${turl} ${options} - Should Contain ${output} 200 OK - ${output} Perform rf using clientSRM ${surl} ${token} - Should contain ${output} SRM_SUCCESS - ${output} Perform rm using clientSRM ${surl} - Should contain ${output} SRM_SUCCESS - Remove local file ${filename} - [Teardown] Clear all credentials - -File-Transfer get file with personal certificate - [Tags] filetransfer get - [Setup] Init certificate with unencrypted key test0 - ${filename} Create local file - ${surl} Build surl ${personalcertRWStorageArea} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${output} ${token} Perform ptg using clientSRM ${surl} -p - Should contain ${output} SRM_FILE_PINNED - ${options} Set variable --verbose -X GET - ${turl} Build file transfer secure TURL ${personalcertRWStorageArea} ${filename} - ${output} Execute Curl with certificate and options ${turl} ${options} - Should Contain ${output} 200 OK - ${output} Perform rf using clientSRM ${surl} ${token} - Should contain ${output} SRM_SUCCESS - ${output} Perform rm using clientSRM ${surl} - Should contain ${output} SRM_SUCCESS - Remove local file ${filename} - [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/filetransfer/unauthorized.txt b/tests/filetransfer/unauthorized.txt deleted file mode 100644 index 4b7ab21..0000000 --- a/tests/filetransfer/unauthorized.txt +++ /dev/null @@ -1,91 +0,0 @@ -*** 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 \ No newline at end of file diff --git a/tests/glue/2_0/glue_2_0.txt b/tests/glue/2_0/glue_2_0.txt index b7b2b9c..7ad746c 100644 --- a/tests/glue/2_0/glue_2_0.txt +++ b/tests/glue/2_0/glue_2_0.txt @@ -81,7 +81,7 @@ Check that GLUE2StorageServiceCapacityTotalSize for the online capacity type is ${output} Get attribute value using ldapsearch ${lurl} ${baseDNGlue2} ${filterGlue2StorageServiceCapacity} GLUE2StorageServiceCapacityTotalSize ${lines} Get Lines Containing String ${output} GLUE2StorageServiceCapacityTotalSize :FOR ${line} in ${lines} - \ ${first} ${others} Split String ${lines} :${SPACE} + \ ${first} ${others}= Split String ${line} :${SPACE} 1 \ ${val} Get From List ${others} 1 \ Should Not Be Equal '${val}' '0' diff --git a/tests/gsiftp/gsiftp.txt b/tests/gsiftp/gsiftp.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tests/srm/__init__.txt b/tests/srm/__init__.txt new file mode 100644 index 0000000..7fc5dc0 --- /dev/null +++ b/tests/srm/__init__.txt @@ -0,0 +1,6 @@ +*** Settings *** + +Resource lib/setup.txt + +Suite Setup Setup suite +Suite Teardown Teardown suite \ No newline at end of file diff --git a/tests/srm/commands/srmAbort.txt b/tests/srm/commands/srmAbort.txt index c1741e5..d06cb37 100644 --- a/tests/srm/commands/srmAbort.txt +++ b/tests/srm/commands/srmAbort.txt @@ -1,16 +1,31 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt +Resource lib/setup.txt *** Test Cases *** +A user cannot abort the request of another user + [Tags] storm-client abort + [Setup] Use default voms proxy + ${filename} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Put without really putting using clientSRM ${surl} + ${output} ${token} Perform ptg using clientSRM ${surl} + Should Contain ${output} SRM_REQUEST_QUEUED + ${output} ${token} Perform ptg using clientSRM ${surl} -t ${token} -p + Should Contain ${output} SRM_FILE_PINNED + Use voms proxy test1 ${DEFAULT_VO} + ${output} Perform abort request using clientSRM ${token} + Should Contain ${output} SRM_AUTHORIZATION_FAILURE + [Teardown] Clear all credentials Abort of a prepare to get done on an existent file [Tags] storm-client abort - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - Put without really putting using clientSRM ${vo} ${filename} - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Put without really putting using clientSRM ${surl} ${output} ${token} Perform ptg using clientSRM ${surl} -p Should Contain ${output} SRM_FILE_PINNED ${output} Perform abort request using clientSRM ${token} @@ -18,16 +33,14 @@ Abort of a prepare to get done on an existent file ${output} Perform sptg using clientSRM ${surl} ${token} Should Not Contain ${output} SRM_FILE_PINNED Should Contain ${output} SRM_ABORTED - Perform rm using clientSRM ${surl} - Remove local file ${filename} [Teardown] Clear all credentials Duplicated ptg abort [Tags] storm-client abort - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - Put without really putting using clientSRM ${vo} ${filename} - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Put without really putting using clientSRM ${surl} ${output} ${token} Perform ptg using clientSRM ${surl} -p Should Contain ${output} SRM_FILE_PINNED ${output} Perform abort request using clientSRM ${token} @@ -37,50 +50,55 @@ Duplicated ptg abort ${output} Perform sptg using clientSRM ${surl} ${token} Should Not Contain ${output} SRM_FILE_PINNED Should Contain ${output} SRM_ABORTED - Perform rm using clientSRM ${surl} - Remove local file ${filename} [Teardown] Clear all credentials Abort multiple files - [Tags] storm-client ptp - [Setup] Init certificate and voms proxy test0 ${vo} - ${testdir} Get a unique name - ${dirsurl} Build surl ${vo} ${testdir} - ${output} Perform mkdir using clientSRM ${dirsurl} - Should Contain ${output} SRM_SUCCESS + [Tags] storm-client abort + [Setup] Use default voms proxy + ${dirname} Get a unique name ${filename} Get a unique name - ${surl} Build surl ${vo} ${testdir}/${filename}_1 - ${surllist} = Set Variable ${surl} + ${surlDir} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${surlFile} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${filename}_1 + ${output} Perform mkdir using clientSRM ${surlDir} + Should Contain ${output} SRM_SUCCESS + ${surlFileList} = Set Variable ${surlFile} :FOR ${index} IN RANGE 2 10 - \ ${surl} Build surl ${vo} ${testdir}/${filename}_${index} - \ ${surllist} Catenate ${surllist} ${surl} - Log ${surllist} - ${output} ${token} Perform ptp using clientSRM ${surllist} -p + \ ${current} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${filename}_${index} + \ ${surlFileList} Catenate ${surlFileList} ${current} + Log ${surlFileList} + ${output} ${token} Perform ptp using clientSRM ${surlFileList} -p Log ${output} Should Contain ${output} SRM_SUCCESS Should Not Contain ${output} SRM_FAILURE - ${output} Perform abort file using clientSRM ${surllist} ${token} + ${output} Perform abort file using clientSRM ${surlFileList} ${token} Log ${output} Should Contain ${output} SRM_SUCCESS Should Not Contain ${output} SRM_ABORTED Should Not Contain ${output} SRM_FAILURE - Remove local file ${filename} - Remove local directory ${testdir} [Teardown] Clear all credentials -Abort request with unexistent token - [Tags] storm-client abort to-be-fixed - [Documentation] Regression test for https://issues.infn.it/jira/browse/STOR-234. Storm BE does not manage correctly abort requests of expired tokens. - [Setup] Init certificate and voms proxy test0 ${vo} +Abort request with non existent fake token + [Tags] storm-client abort + [Setup] Use default voms proxy ${output} Perform abort request using clientSRM fake_token Should Contain ${output} SRM_INVALID_REQUEST + Should Contain ${output} "invalid token: fake_token" + [Teardown] Clear all credentials + +Abort request with non existent well-formed token + [Tags] storm-client abort + [Documentation] Regression test for https://issues.infn.it/jira/browse/STOR-234. Storm BE does not manage correctly abort requests of expired tokens. + [Setup] Use default voms proxy + ${output} Perform abort request using clientSRM 992a7ecc-65df-4902-ae00-06a9691ad816 + Should Contain ${output} SRM_INVALID_REQUEST + Should Contain ${output} "No request found matching token 992a7ecc-65df-4902-ae00-06a9691ad816" [Teardown] Clear all credentials Abort after prepare to put [Tags] storm-client abort - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p Should Contain ${output} SRM_SPACE_AVAILABLE ${output} Perform abort request using clientSRM ${token} @@ -89,14 +107,13 @@ Abort after prepare to put Should Contain ${output} SRM_FAILURE ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_FAILURE - Remove local file ${filename} [Teardown] Clear all credentials Abort after put done [Tags] storm-client abort - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p Should Contain ${output} SRM_SPACE_AVAILABLE ${output} Perform pd using clientSRM ${surl} ${token} @@ -105,5 +122,4 @@ Abort after put done Should Contain ${output} SRM_FAILURE ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - Remove local file ${filename} [Teardown] Clear all credentials diff --git a/tests/srm/commands/srmBol.txt b/tests/srm/commands/srmBol.txt new file mode 100644 index 0000000..cf69026 --- /dev/null +++ b/tests/srm/commands/srmBol.txt @@ -0,0 +1,72 @@ +*** Settings *** + +Resource lib/stormlib.txt +Resource lib/clientSRM.txt +Resource lib/lcg_util.txt +Resource lib/globus_util.txt +Resource lib/setup.txt + +*** Keywords *** + +Get random simple SURL + ${filename} Get a unique name + ${surl} Build simple surl ${TAPE_SA} ${TESTDIR}/${filename} + [Return] ${surl} + +*** Test Cases *** + +Bol online file + [Tags] storm-client bol + [Setup] Use voms proxy ${defaultUser} ${TAPE_SA_VONAME} + ${surl} Get random simple SURL + Put without really putting using clientSRM ${surl} + ${output} ${token} Perform bol using clientSRM ${surl} -p + Should Contain ${output} SRM_SUCCESS + ${output} Perform rm using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + [Teardown] Clear all credentials + +Bol with invalid SURL + [Tags] storm-client bol + [Setup] Use voms proxy ${defaultUser} ${TAPE_SA_VONAME} + ${surl} Get random simple SURL + ${output} ${token} Perform bol using clientSRM ${surl} -p + Should Not Contain ${output} SRM_SUCCESS + Should Contain ${output} SRM_FAILURE + [Teardown] Clear all credentials + +Bol multiple invalid SURLs + [Tags] storm-client bol + [Setup] Use voms proxy ${defaultUser} ${TAPE_SA_VONAME} + ${surl} Get random simple SURL + ${surl2} Get random simple SURL + ${output} ${token} Perform bol using clientSRM ${surl} ${surl2} -p + Should Contain ${output} SRM_FAILURE + [Teardown] Clear all credentials + +Bol multiple online files + [Tags] storm-client bol + [Setup] Use voms proxy ${defaultUser} ${TAPE_SA_VONAME} + ${surl} Get random simple SURL + ${surl2} Get random simple SURL + Put without really putting using clientSRM ${surl} + Put without really putting using clientSRM ${surl2} + ${output} ${token} Perform bol using clientSRM ${surl} ${surl2} -p + Should Contain ${output} SRM_SUCCESS + ${output} Perform rm using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + ${output} Perform rm using clientSRM ${surl2} + Should Contain ${output} SRM_SUCCESS + [Teardown] Clear all credentials + +Bol multiple mixed files + [Tags] storm-client bol + [Setup] Use voms proxy ${defaultUser} ${TAPE_SA_VONAME} + ${surl} Get random simple SURL + ${surl2} Get random simple SURL + Put without really putting using clientSRM ${surl} + ${output} ${token} Perform bol using clientSRM ${surl} ${surl2} -p + Should Contain ${output} SRM_PARTIAL_SUCCESS + ${output} Perform rm using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/commands/srmGTP.txt b/tests/srm/commands/srmGTP.txt new file mode 100644 index 0000000..7458cbd --- /dev/null +++ b/tests/srm/commands/srmGTP.txt @@ -0,0 +1,20 @@ +*** Settings *** + +Resource lib/stormlib.txt +Resource lib/clientSRM.txt +Resource lib/setup.txt + +*** Test Cases *** + +Verify gtp operation by using the StoRM client + [Tags] gtp storm-client + [Setup] Use default voms proxy + ${output} Execute clientSRM Command gtp + Should Contain ${output} transferProtocol="file" + Should Contain ${output} transferProtocol="gsiftp" + Should Contain ${output} transferProtocol="http" + Should Contain ${output} transferProtocol="https" + Should Contain ${output} transferProtocol="rfio" + Should Contain ${output} transferProtocol="root" + Should Contain ${output} transferProtocol="xroot" + [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/commands/srmLs.txt b/tests/srm/commands/srmLs.txt index d390224..d491d48 100644 --- a/tests/srm/commands/srmLs.txt +++ b/tests/srm/commands/srmLs.txt @@ -1,95 +1,112 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt Resource lib/lcg_util.txt +Resource lib/setup.txt *** Test Cases *** +List files in storage area root + [Tags] storm-client ls + [Setup] Use default voms proxy + ${surl} Build surl ${DEFAULT_SA} ${EMPTY} + ${output} Perform ls using clientSRM ${surl} -c 1 + Should Contain ${output} SRM_SUCCESS + [Teardown] Clear all credentials + List existent directory [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build surl ${vo} ${dirname} - ${output} Perform mkdir using clientSRM ${surl} + ${surlDir} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${output} Perform mkdir using clientSRM ${surlDir} Should Contain ${output} SRM_SUCCESS - ${output} Perform ls using clientSRM ${surl} + ${output} Perform ls using clientSRM ${surlDir} Should Contain ${output} SRM_SUCCESS - Should Contain ${output} path="/${vo}/${dirname}" + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${dirname}" Should Contain ${output} size=0 - Remove empty directory using clientSRM ${vo} ${dirname} - Remove local directory ${dirname} + ${fileName} Get a unique name + ${surlFile} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${fileName} + Put without really putting using clientSRM ${surlFile} + ${output} Perform ls using clientSRM ${surlDir} + Should Contain ${output} SRM_SUCCESS + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${dirname}" + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${dirname}/${filename}" + Should Contain ${output} size=1 + ${output} Perform rmdir using clientSRM ${surlDir} -r + Should Contain ${output} SRM_SUCCESS [Teardown] Clear all credentials List unexistent directory [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build surl ${vo} ${dirname} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} ${output} Perform ls using clientSRM ${surl} + Should Contain ${output} SRM_FAILURE Should Contain ${output} SRM_INVALID_PATH - Should Contain ${output} path="/${vo}/${dirname}" + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${dirname}" Should Not Contain ${output} size=0 - Remove local directory ${dirname} [Teardown] Clear all credentials List existent file [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} Copy-out file using lcg-utils ${filename} ${surl} ${output} Perform ls using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - Should Contain ${output} path="/${vo}/${filename}" + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${filename}" log ${output} Should Contain ${output} size=1048576 Should Not Contain ${output} size=0 - Perform rm using clientSRM ${surl} + ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS Remove local file ${filename} [Teardown] Clear all credentials List unexistent file [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} Perform ls using clientSRM ${surl} + Should Contain ${output} SRM_FAILURE Should Contain ${output} SRM_INVALID_PATH - Should Contain ${output} path="/${vo}/${filename}" + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${filename}" Should Not Contain ${output} size=0 - Remove local file ${filename} [Teardown] Clear all credentials Full detailed list of existent directory [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build surl ${vo} ${dirname} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} ${output} Perform mkdir using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS ${output} Perform ls using clientSRM ${surl} -l 1 -n 1 Should Contain ${output} SRM_SUCCESS - Should Contain ${output} path="/${vo}/${dirname}" + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${dirname}" Should Contain ${output} size=0 Should Contain ${output} ownerPermission Should Contain ${output} groupPermission Should Contain ${output} type=Directory Should Contain ${output} lastModificationTime - Remove empty directory using clientSRM ${vo} ${dirname} - Remove local directory ${dirname} + ${output} Perform rmdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS [Teardown] Clear all credentials Full detailed list of existent file [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} Copy-out file using lcg-utils ${filename} ${surl} ${output} Perform ls using clientSRM ${surl} -l 1 -n 0 Should Contain ${output} SRM_SUCCESS - Should Contain ${output} path="/${vo}/${filename}" + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${filename}" Should Contain ${output} size Should Not Contain ${output} size=0 Should Contain ${output} ownerPermission @@ -99,20 +116,20 @@ Full detailed list of existent file Should Contain ${output} lifetimeAssigned Should Contain ${output} lifetimeLeft Should Contain ${output} fileLocality - Perform rm using clientSRM ${surl} + ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - Remove local directory ${filename} + Remove local file ${filename} [Teardown] Clear all credentials Full detailed and recursive list of existent files and directories [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file ${dirname} Get a unique name - ${dirsurl} Build surl ${vo} ${dirname} - ${filesurl} Build surl ${vo} ${dirname}/${filename} - ${subdirsurl} Build surl ${vo} ${dirname}/${dirname} - ${subdirfilesurl} Build surl ${vo} ${dirname}/${dirname}/${filename} + ${dirsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${filesurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${filename} + ${subdirsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${dirname} + ${subdirfilesurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${dirname}/${filename} ${output} Perform mkdir using clientSRM ${dirsurl} Should Contain ${output} SRM_SUCCESS ${output} Perform mkdir using clientSRM ${subdirsurl} @@ -121,10 +138,10 @@ Full detailed and recursive list of existent files and directories Copy-out file using lcg-utils ${filename} ${subdirfilesurl} ${output} Perform ls using clientSRM ${dirsurl} -r -l 1 Should Contain ${output} SRM_SUCCESS - Should Contain ${output} path="/${vo}/${dirname}" - Should Contain ${output} path="/${vo}/${dirname}/${filename}" - Should Contain ${output} path="/${vo}/${dirname}/${dirname}" - Should Contain ${output} path="/${vo}/${dirname}/${dirname}/${filename}" + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${dirname}" + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${dirname}/${filename}" + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${dirname}/${dirname}" + Should Contain ${output} path="/${DEFAULT_SA}/${TESTDIR}/${dirname}/${dirname}/${filename}" Should Contain ${output} size Should Contain ${output} ownerPermission Should Contain ${output} groupPermission @@ -133,79 +150,114 @@ Full detailed and recursive list of existent files and directories Should Contain ${output} lifetimeAssigned Should Contain ${output} lifetimeLeft Should Contain ${output} fileLocality - Remove not empty directory using clientSRM ${vo} ${dirname} - Remove local directory ${dirname} + ${output} Perform rmdir using clientSRM ${dirsurl} -r + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} [Teardown] Clear all credentials Ls on a surl that points to another storage area [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} - ${surl} Build surl ${anonymousRWStorageArea} ../${vo} - ${output} Perform ls using clientSRM ${surl} - Should Contain ${output} SRM_INVALID_PATH - ${surl} Build simple surl ${anonymousRWStorageArea} ../${vo} - ${output} Perform ls using clientSRM ${surl} - Should Contain ${output} SRM_INVALID_PATH + [Setup] Use default voms proxy + ${qsurl} Build surl ${VO.2} ../${DEFAULT_SA} + ${ssurl} Build simple surl ${VO.2} ../${DEFAULT_SA} + ${output} Perform ls using clientSRM ${qsurl} + Should Contain ${output} SRM_AUTHORIZATION_FAILURE + ${output} Perform ls using clientSRM ${ssurl} + Should Contain ${output} SRM_AUTHORIZATION_FAILURE [Teardown] Clear all credentials Ls on a surl with a valid dots segment [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build surl ${vo} ${dirname} + ${dirname2} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${surl2} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname2} + ${surl3} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/../${dirname2} ${output} Perform mkdir using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - ${dirname2} Get a unique name - ${surl2} Build surl ${vo} ${dirname2} ${output} Perform mkdir using clientSRM ${surl2} Should Contain ${output} SRM_SUCCESS - ${surl3} Build surl ${vo} ${dirname}/../${dirname2} ${output} Perform ls using clientSRM ${surl3} Should Contain ${output} SRM_SUCCESS - Remove empty directory using clientSRM ${vo} ${dirname} - Remove local directory ${dirname} - Remove empty directory using clientSRM ${vo} ${dirname2} - Remove local directory ${dirname2} + ${output} Perform rmdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + ${output} Perform rmdir using clientSRM ${surl2} + Should Contain ${output} SRM_SUCCESS [Teardown] Clear all credentials Ls on a surl with a valid dots segment with simple surls [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build simple surl ${vo} ${dirname} + ${dirname2} Get a unique name + ${surl} Build simple surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${surl2} Build simple surl ${DEFAULT_SA} ${TESTDIR}/${dirname2} + ${surl3} Build simple surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/../${dirname2} ${output} Perform mkdir using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - ${dirname2} Get a unique name - ${surl2} Build simple surl ${vo} ${dirname2} ${output} Perform mkdir using clientSRM ${surl2} Should Contain ${output} SRM_SUCCESS - ${surl3} Build simple surl ${vo} ${dirname}/../${dirname2} ${output} Perform ls using clientSRM ${surl3} Should Contain ${output} SRM_SUCCESS - Remove empty directory using clientSRM ${vo} ${dirname} - Remove local directory ${dirname} - Remove empty directory using clientSRM ${vo} ${dirname2} - Remove local directory ${dirname2} + ${output} Perform rmdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + ${output} Perform rmdir using clientSRM ${surl2} + Should Contain ${output} SRM_SUCCESS [Teardown] Clear all credentials Ls on a surl that points to a reserved area [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} - ${surl} Build surl ${anonymousRWStorageArea} ../../etc/grid-security + [Setup] Use default voms proxy + ${surl} Build surl ${DEFAULT_SA} ../../etc/grid-security ${output} Perform ls using clientSRM ${surl} - Should Contain ${output} SRM_INVALID_PATH - ${surl} Build simple surl ${anonymousRWStorageArea} ../../etc/grid-security + Should Not Contain ${output} SRM_SUCCESS + Should Contain ${output} SRM_INTERNAL_ERROR + ${surl} Build simple surl ${DEFAULT_SA} ../../etc/grid-security ${output} Perform ls using clientSRM ${surl} - Should Contain ${output} SRM_INVALID_PATH + Should Not Contain ${output} SRM_SUCCESS + Should Contain ${output} SRM_INTERNAL_ERROR [Teardown] Clear all credentials -Ls on a symlink that points to unauthorized paths - [Tags] storm-client ls - [Setup] Init certificate and plain proxy test0 - ${output} Perform ls using clientSRM ${symlinkSURL} ${symlinkSURL2} ${symlinkSURL3} +Ls on some symlinks that point to other storage-areas + [Tags] storm-client ls symlink + [Setup] Use default voms proxy + ${symlinkSURL} Build surl ${DEFAULT_SA} ${SYMLINK.1} + ${output} Perform ls using clientSRM ${symlinkSURL} Should Contain ${output} SRM_FAILURE - Should Contain ${output} SRM_INVALID_PATH + Should Contain ${output} SRM_AUTHORIZATION_FAILURE Should Not Contain ${output} SRM_SUCCESS Log ${output} + [Teardown] Clear all credentials + +Check approached VFS with nested accesspoints + [Tags] ls lcg-utils nested storm-client + [Setup] Use voms proxy ${defaultUser} ${NESTED_SA_VONAME} + ${dirname} Get a unique name + ${filename} Create local file + ${surlDir} Build surl ${NESTED_SA} ${TESTDIR}/${dirname} + ${surlFile} Build surl ${NESTED_SA} ${TESTDIR}/${dirname}/${filename} + ${output} Perform mkdir using clientSRM ${surlDir} + Should Contain ${output} SRM_SUCCESS + Copy-out file using lcg-utils ${filename} ${surlFile} + ${output} Perform ls using clientSRM ${surlDir} + Should Contain ${output} SRM_SUCCESS + Should Contain ${output} ${NESTED_SA}/${TESTDIR}/${dirname} + Should Contain ${output} ${NESTED_SA}/${TESTDIR}/${dirname}/${filename} + [Teardown] Clear all credentials + +Check approached VFS with aliased accesspoint + [Tags] ls aliased storm-client + [Setup] Use voms proxy ${defaultUser} ${NESTED_SA_VONAME} + ${dirname} Get a unique name + ${filename} Create local file + ${surlDir} Build surl ${ALIASED_SA} ${TESTDIR}/${dirname} + ${surlFile} Build surl ${ALIASED_SA} ${TESTDIR}/${dirname}/${filename} + ${output} Perform mkdir using clientSRM ${surlDir} + Should Contain ${output} SRM_SUCCESS + Put without really putting using clientSRM ${surlFile} + ${output} Perform ls using clientSRM ${surlDir} + Should Contain ${output} SRM_SUCCESS + Should Contain ${output} ${ALIASED_SA}/${TESTDIR}/${dirname} + Should Contain ${output} ${ALIASED_SA}/${TESTDIR}/${dirname}/${filename} [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/commands/srmMkDir.txt b/tests/srm/commands/srmMkDir.txt index cd68462..858bba2 100644 --- a/tests/srm/commands/srmMkDir.txt +++ b/tests/srm/commands/srmMkDir.txt @@ -1,64 +1,62 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt +Resource lib/setup.txt *** Test Cases *** Create new empty directory [Tags] storm-client mkdir - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build surl ${vo} ${dirname} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} ${output} Perform mkdir using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - Remove empty directory using clientSRM ${vo} ${dirname} - Remove local directory ${dirname} + ${output} Perform rmdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS [Teardown] Clear all credentials Create directory with invalid path [Tags] storm-client mkdir - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name ${surl} Build surl fakeVO ${dirname} ${output} Perform mkdir using clientSRM ${surl} Should Contain ${output} SRM_INVALID_PATH - Remove local directory ${dirname} [Teardown] Clear all credentials Create directory that already exists [Tags] storm-client mkdir - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build surl ${vo} ${dirname} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} ${output} Perform mkdir using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS ${output} Perform mkdir using clientSRM ${surl} Should Contain ${output} SRM_DUPLICATION_ERROR - Remove empty directory using clientSRM ${vo} ${dirname} - Remove local directory ${dirname} + Should Contain ${output} Directory specified exists! + ${output} Perform rmdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS [Teardown] Clear all credentials -Create directory with an unauthorized path - [Tags] storm-client mkdir to-be-fixed - [Setup] Init certificate and plain proxy test0 +Create directory with unauthorized credentials + [Tags] storm-client mkdir + [Setup] Use default grid proxy ${dirname} Get a unique name - ${surl} Build surl ${vo} ${dirname} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} ${output} Perform mkdir using clientSRM ${surl} - log ${output} Should Contain ${output} SRM_AUTHORIZATION_FAILURE - Remove local directory ${dirname} [Teardown] Clear all credentials Check directory creation on a different VO [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build surl ${anonymousRWStorageArea} ../${vo}/${dirname} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_INVALID_PATH - ${surl} Build simple surl ${anonymousRWStorageArea} ../${vo}/${dirname} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_INVALID_PATH - Remove local directory ${dirname} - [Teardown] Clear all credentials \ No newline at end of file + ${qsurl} Build surl ${SA.2} ../${DEFAULT_SA}/${TESTDIR}/${dirname} + ${output} Perform mkdir using clientSRM ${qsurl} + Should Contain ${output} SRM_AUTHORIZATION_FAILURE + ${qsurl} Build surl ${DEFAULT_SA} ../${SA.2}/${TESTDIR}/${dirname} + ${output} Perform mkdir using clientSRM ${qsurl} + Should Contain ${output} SRM_AUTHORIZATION_FAILURE + [Teardown] Clear all credentials diff --git a/tests/srm/commands/srmMv.txt b/tests/srm/commands/srmMv.txt index 781633d..dca8f55 100644 --- a/tests/srm/commands/srmMv.txt +++ b/tests/srm/commands/srmMv.txt @@ -1,163 +1,174 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt Resource lib/lcg_util.txt +Resource lib/setup.txt *** Test Cases *** Move file [Tags] storm-client mv - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file - ${srcsurl} Build surl ${vo} ${filename} + ${srcsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${destsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename}.moved Copy-out file using lcg-utils ${filename} ${srcsurl} - ${destsurl} Build surl ${vo} ${filename}.moved ${output} Perform mv using clientSRM ${srcsurl} ${destsurl} Should Contain ${output} SRM_SUCCESS - Remove file using clientSRM ${vo} ${filename}.moved + ${output} Perform ls using clientSRM ${srcsurl} + Should Not Contain ${output} SRM_SUCCESS + ${output} Perform ls using clientSRM ${destsurl} + Should Contain ${output} SRM_SUCCESS + ${output} Perform rm using clientSRM ${destsurl} + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} [Teardown] Clear all credentials Move file to a destination surl that already exists [Tags] storm-client mv - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file - ${srcsurl} Build surl ${vo} ${filename} - ${destsurl} Build surl ${vo} ${filename}.moved + ${srcsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${destsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename}.moved Copy-out file using lcg-utils ${filename} ${srcsurl} Copy-out file using lcg-utils ${filename} ${destsurl} ${output} Perform mv using clientSRM ${srcsurl} ${destsurl} Should Contain ${output} SRM_DUPLICATION_ERROR - Remove file using clientSRM ${vo} ${filename} - Remove file using clientSRM ${vo} ${filename}.moved + ${output} Perform rm using clientSRM ${srcsurl} + Should Contain ${output} SRM_SUCCESS + ${output} Perform rm using clientSRM ${destsurl} + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} [Teardown] Clear all credentials Move file into directory [Tags] storm-client mv - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file - ${srcfilesurl} Build surl ${vo} ${filename} - Copy-out file using lcg-utils ${filename} ${srcfilesurl} ${dstdirname} Get a unique name - ${destdirsurl} Build surl ${vo} ${dstdirname} + ${srcfilesurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${destdirsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dstdirname} + ${destfilesurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dstdirname}/${filename} + Copy-out file using lcg-utils ${filename} ${srcfilesurl} ${output} Perform mkdir using clientSRM ${destdirsurl} Should Contain ${output} SRM_SUCCESS ${output} Perform mv using clientSRM ${srcfilesurl} ${destdirsurl} Should Contain ${output} SRM_SUCCESS - ${destfilesurl} Build surl ${vo} ${dstdirname}/${filename} ${output} Perform ls using clientSRM ${destfilesurl} Should Contain ${output} SRM_SUCCESS - Remove not empty directory using clientSRM ${vo} ${dstdirname} - Remove local directory ${dstdirname} - Remove file using clientSRM ${vo} ${filename}.moved + ${output} Perform rmdir using clientSRM ${destdirsurl} -r + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} [Teardown] Clear all credentials Move not empty directory on unexistent surl [Tags] storm-client mv - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${dirsurl} Build surl ${vo} ${dirname} + ${filename} Create local file + ${dirsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${filesurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${filename} + ${destdirsurl} Build surl ${DEFAULT_SA} ${dirname}.moved ${output} Perform mkdir using clientSRM ${dirsurl} Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${filesurl} Build surl ${vo} ${dirname}/${filename} Copy-out file using lcg-utils ${filename} ${filesurl} - ${destdirsurl} Build surl ${vo} ${dirname}.moved ${output} Perform mv using clientSRM ${dirsurl} ${destdirsurl} Should Contain ${output} SRM_SUCCESS - Remove not empty directory using clientSRM ${vo} ${dirname}.moved + ${output} Perform rmdir using clientSRM ${destdirsurl} -r + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} - Remove local directory ${dirname} [Teardown] Clear all credentials Move not empty directory on a existent empty directory [Tags] storm-client mv - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${dirsurl} Build surl ${vo} ${dirname} + ${filename} Create local file + ${dirsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${filesurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${filename} + ${destdirsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}.moved + ${destfilesurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}.moved/${dirname}/${filename} ${output} Perform mkdir using clientSRM ${dirsurl} Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${filesurl} Build surl ${vo} ${dirname}/${filename} Copy-out file using lcg-utils ${filename} ${filesurl} - ${destdirsurl} Build surl ${vo} ${dirname}.moved ${output} Perform mkdir using clientSRM ${destdirsurl} Should Contain ${output} SRM_SUCCESS ${output} Perform mv using clientSRM ${dirsurl} ${destdirsurl} Should Contain ${output} SRM_SUCCESS - ${destfilesurl} Build surl ${vo} ${dirname}.moved/${dirname}/${filename} ${output} Perform ls using clientSRM ${destfilesurl} Should Contain ${output} SRM_SUCCESS - Remove not empty directory using clientSRM ${vo} ${dirname} - Remove not empty directory using clientSRM ${vo} ${dirname}.moved + ${output} Perform rmdir using clientSRM ${destdirsurl} -r + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} [Teardown] Clear all credentials Move not empty directory on a existent surl [Tags] storm-client mv - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${dirsurl} Build surl ${vo} ${dirname} - ${output} Perform mkdir using clientSRM ${dirsurl} - Should Contain ${output} SRM_SUCCESS ${filename} Create local file - ${filesurl} Build surl ${vo} ${dirname}/${filename} + ${dirsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${filesurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${filename} + ${destsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename}.copied + ${output} Perform mkdir using clientSRM ${dirsurl} + Should Contain ${output} SRM_SUCCESS Copy-out file using lcg-utils ${filename} ${filesurl} - ${destsurl} Build surl ${vo} ${filename}.copied Copy-out file using lcg-utils ${filename} ${destsurl} ${output} Perform mv using clientSRM ${dirsurl} ${destsurl} Should Contain ${output} SRM_DUPLICATION_ERROR - Remove not empty directory using clientSRM ${vo} ${dirname} - Remove file using clientSRM ${vo} ${filename}.copied + ${output} Perform rmdir using clientSRM ${dirsurl} -r + Should Contain ${output} SRM_SUCCESS + ${output} Perform rm using clientSRM ${destsurl} + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} - Remove local directory ${dirname} [Teardown] Clear all credentials Move not empty directory on a existent not empty directory that contains an existent directory with same source name [Tags] storm-client mv - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${dirsurl} Build surl ${vo} ${dirname} + ${filename} Create local file + ${dirsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${filesurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${filename} + ${destdirsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}.moved + ${destsubdirsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}.moved/${dirname} ${output} Perform mkdir using clientSRM ${dirsurl} Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${filesurl} Build surl ${vo} ${dirname}/${filename} Copy-out file using lcg-utils ${filename} ${filesurl} - ${destdirsurl} Build surl ${vo} ${dirname}.moved ${output} Perform mkdir using clientSRM ${destdirsurl} Should Contain ${output} SRM_SUCCESS - ${destsubdirsurl} Build surl ${vo} ${dirname}.moved/${dirname} ${output} Perform mkdir using clientSRM ${destsubdirsurl} Should Contain ${output} SRM_SUCCESS ${output} Perform mv using clientSRM ${dirsurl} ${destdirsurl} Should Contain ${output} SRM_DUPLICATION_ERROR - Remove not empty directory using clientSRM ${vo} ${dirname} - Remove not empty directory using clientSRM ${vo} ${dirname}.moved + ${output} Perform rmdir using clientSRM ${dirsurl} -r + Should Contain ${output} SRM_SUCCESS + ${output} Perform rmdir using clientSRM ${destdirsurl} -r + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} [Teardown] Clear all credentials Move file over itself [Tags] storm-client mv - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file - ${srcsurl} Build surl ${vo} ${filename} - ${destsurl} Build surl ${vo} ${filename} + ${srcsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${destsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} Copy-out file using lcg-utils ${filename} ${srcsurl} ${output} Perform mv using clientSRM ${srcsurl} ${destsurl} Should Contain ${output} SRM_SUCCESS - Remove file using clientSRM ${vo} ${filename} + ${output} Perform rm using clientSRM ${srcsurl} + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} [Teardown] Clear all credentials Move file with active ptg [Tags] storm-client mv - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file - ${srcsurl} Build surl ${vo} ${filename} - ${destsurl} Build surl ${vo} ${filename}.moved + ${srcsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${destsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename}.moved Copy-out file using lcg-utils ${filename} ${srcsurl} ${output} ${token} Perform ptg using clientSRM ${srcsurl} -p Should Contain ${output} SRM_FILE_PINNED @@ -165,57 +176,56 @@ Move file with active ptg Should Contain ${output} SRM_FILE_BUSY ${output} Perform rf using clientSRM ${srcsurl} ${token} Should Contain ${output} SRM_SUCCESS - Remove file using clientSRM ${vo} ${filename} + ${output} Perform rm using clientSRM ${srcsurl} + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} [Teardown] Clear all credentials Move file with active ptp [Tags] storm-client mv - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${srcsurl} Build surl ${vo} ${filename} - ${destsurl} Build surl ${vo} ${filename}.moved + ${srcsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${destsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename}.moved ${output} ${token} Perform ptp using clientSRM ${srcsurl} -p Should Contain ${output} SRM_SPACE_AVAILABLE ${output} Perform mv using clientSRM ${srcsurl} ${destsurl} Should Contain ${output} SRM_FILE_BUSY ${output} Perform pd using clientSRM ${srcsurl} ${token} Should Contain ${output} SRM_SUCCESS - Remove file using clientSRM ${vo} ${filename} - Remove local file ${filename} + ${output} Perform rm using clientSRM ${srcsurl} + Should Contain ${output} SRM_SUCCESS [Teardown] Clear all credentials Move file on an unauthorized destination - [Tags] storm-client mv to-be-fixed - [Setup] Init certificate and voms proxy test0 ${vo} + [Tags] storm-client mv + [Setup] Use default voms proxy ${filename} Create local file - ${srcsurl} Build surl ${vo} ${filename} - ${destsurl} Build surl ${vo} ${filename} + ${srcsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${destsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} Copy-out file using lcg-utils ${filename} ${srcsurl} - Init certificate and plain proxy test0 + Use default grid proxy ${output} Perform mv using clientSRM ${srcsurl} ${destsurl} Should Contain ${output} SRM_AUTHORIZATION_FAILURE - Init certificate and voms proxy test0 ${vo} - Remove file using clientSRM ${vo} ${filename} + Use default voms proxy + ${output} Perform rm using clientSRM ${srcsurl} + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} [Teardown] Clear all credentials Check unauthorized file move on a different VO [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file - ${srcsurl} Build surl ${vo} ${filename} + ${srcsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${destsurl} Build surl ${DEFAULT_SA} ../${SA.2}/${TESTDIR}/${filename} Copy-out file using lcg-utils ${filename} ${srcsurl} - Init certificate and plain proxy test0 - ${srcsurl} Build surl ${gridproxyRWStorageArea} ../${vo}/${filename} - ${destsurl} Build surl ${gridproxyRWStorageArea} ${filename} ${output} Perform mv using clientSRM ${srcsurl} ${destsurl} - Should Contain ${output} SRM_INVALID_PATH - ${srcsurl} Build simple surl ${gridproxyRWStorageArea} ../${vo}/${filename} - ${destsurl} Build simple surl ${gridproxyRWStorageArea} ${filename} + Should Contain ${output} SRM_AUTHORIZATION_FAILURE + ${destsurl} Build surl ${SA.2} ../${DEFAULT_SA}/${TESTDIR}/${filename}_2 ${output} Perform mv using clientSRM ${srcsurl} ${destsurl} - Should Contain ${output} SRM_INVALID_PATH - Init certificate and voms proxy test0 ${vo} - Remove file using clientSRM ${vo} ${filename} + Should Contain ${output} SRM_AUTHORIZATION_FAILURE + ${output} Perform rm using clientSRM ${srcsurl} + Should Contain ${output} SRM_SUCCESS Remove local file ${filename} - [Teardown] Clear all credentials \ No newline at end of file + [Teardown] Clear all credentials diff --git a/tests/srm/commands/srmPd.txt b/tests/srm/commands/srmPd.txt index 23c8ab1..05ac575 100644 --- a/tests/srm/commands/srmPd.txt +++ b/tests/srm/commands/srmPd.txt @@ -1,28 +1,28 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt +Resource lib/setup.txt *** Test Cases *** Put done an existent file [Tags] storm-client pd - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p Should Contain ${output} SRM_SPACE_AVAILABLE ${output} Perform pd using clientSRM ${surl} ${token} Should Contain ${output} SRM_SUCCESS Perform rm using clientSRM ${surl} - Remove local file ${filename} [Teardown] Clear all credentials Duplicated put done [Tags] storm-client pd - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p Should Contain ${output} SRM_SPACE_AVAILABLE ${output} Perform pd using clientSRM ${surl} ${token} @@ -30,5 +30,4 @@ Duplicated put done ${output} Perform pd using clientSRM ${surl} ${token} Should Contain ${output} SRM_DUPLICATION_ERROR Perform rm using clientSRM ${surl} - Remove local file ${filename} [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/commands/srmPing.txt b/tests/srm/commands/srmPing.txt new file mode 100644 index 0000000..8c00b44 --- /dev/null +++ b/tests/srm/commands/srmPing.txt @@ -0,0 +1,34 @@ +*** Settings *** + +Resource lib/stormlib.txt +Resource lib/clientSRM.txt +Resource lib/setup.txt + +*** Test Cases *** + +Ping using clientSRM + [Tags] ping storm-client + [Setup] Use default voms proxy + ${output} Perform ping using clientSRM + Should contain ${output} SRM server successfully contacted + [Teardown] Clear all credentials + +Ping returns a wrong backend age + [Tags] ping storm-client + [Setup] Use default voms proxy + ${output} Perform ping using clientSRM + ${matched} Should Match Regexp ${output} + Should Not Contain ${matched} age + [Teardown] Clear all credentials + +Verify asynch request with non-ascii characters + [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/137. Given a StoRM endpoint, verify that an SRM asynchronous call providing a string parameter containing non ASCII characters does not put StoRM Frontend offline. + [Tags] storm-client ping regression + [Setup] Use default voms proxy + ${filename} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename}_���� + ${output} Perform ls using clientSRM ${surl} -c 1 + Should Not Contain ${output} SRM_SUCCESS + ${output} Perform ping using clientSRM + Should contain ${output} SRM server successfully contacted + [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/commands/srmPtG.txt b/tests/srm/commands/srmPtG.txt index f6886be..6609ef8 100644 --- a/tests/srm/commands/srmPtG.txt +++ b/tests/srm/commands/srmPtG.txt @@ -1,118 +1,159 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt Resource lib/lcg_util.txt Resource lib/globus_util.txt +Resource lib/setup.txt -*** Test Cases *** +*** Keywords *** -Prepare to get an existent file - [Tags] storm-client ptg - [Setup] Init certificate and voms proxy test0 ${vo} +getRandomSURL [Arguments] ${sa}=${DEFAULT_SA} ${filename} Get a unique name - Put without really putting using clientSRM ${vo} ${filename} - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptg using clientSRM ${surl} - Should Contain ${output} SRM_REQUEST_QUEUED - ${output} ${token} Perform ptg using clientSRM ${surl} -t ${token} -p + ${surl} Build surl ${sa} ${TESTDIR}/${filename} + [Return] ${surl} + +createRemoteFile [Arguments] ${surl} + Put without really putting using clientSRM ${surl} + +srmPtG [Arguments] ${surl} + ${output} ${token} Perform ptg using clientSRM ${surl} -p + [Return] ${output} ${token} + +srmRf [Arguments] ${surl} ${token} + ${output} Perform rf using clientSRM ${surl} ${token} + [Return] ${output} + +check srmPtG success [Arguments] ${output} Should Contain ${output} SRM_FILE_PINNED - ${output} Perform rf using clientSRM ${surl} ${token} -p + Should Not Contain ${output} SRM_FAILURE + +check srmPtG failure with [Arguments] ${output} ${status} + Should Contain ${output} ${status} + Should Contain ${output} SRM_FAILURE + Should Not Contain ${output} SRM_FILE_PINNED + +check srmRf success [Arguments] ${output} Should Contain ${output} SRM_SUCCESS Should Not Contain ${output} SRM_RELEASED Should Not Contain ${output} SRM_FAILURE + +deleteRemoteFile [Arguments] ${surl} ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - Remove local file ${filename} + +get TURL from output [Arguments] ${output} + ${result} ${turl}= Should Match Regexp ${output} transferURL=(\".+\") + [Return] ${turl} + +*** Test Cases *** + +srmPtG on an existent file + [Tags] storm-client ptg + [Setup] Use default voms proxy + ${surl} getRandomSURL + createRemoteFile ${surl} + ${outputPtG} ${token} srmPtG ${surl} + Log ${outputPtG} + check srmPtG success ${outputPtG} + ${outputRf} srmRf ${surl} ${token} + Log ${outputRf} + check srmRf success ${outputRf} + deleteRemoteFile ${surl} [Teardown] Clear all credentials -Prepare to get an unexistent file +srmPtG on a non-existent file [Tags] storm-client ptg - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptg using clientSRM ${surl} -p - Should Contain ${output} SRM_INVALID_PATH - Remove local file ${filename} + [Setup] Use default voms proxy + ${surl} getRandomSURL + ${outputPtG} ${token} srmPtG ${surl} + Log ${outputPtG} + check srmPtG failure with ${outputPtG} SRM_INVALID_PATH [Teardown] Clear all credentials -Check double PtG on a file +Multiple srmPtG on a file [Tags] regression ptg - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - Put without really putting using clientSRM ${vo} ${filename} - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptg using clientSRM ${surl} -p - Should Contain ${output} SRM_FILE_PINNED - ${output} ${token} Perform ptg using clientSRM ${surl} -p - Should Contain ${output} SRM_FILE_PINNED - Perform rm using clientSRM ${surl} - Remove local file ${filename} + [Setup] Use default voms proxy + ${surl} getRandomSURL + createRemoteFile ${surl} + ${outputPtG} ${token1} srmPtG ${surl} + Log ${outputPtG} + check srmPtG success ${outputPtG} + ${outputPtG} ${token2} srmPtG ${surl} + Log ${outputPtG} + check srmPtG success ${outputPtG} + ${outputRf} srmRf ${surl} ${token1} + Log ${outputRf} + check srmRf success ${outputRf} + ${outputRf} srmRf ${surl} ${token2} + Log ${outputRf} + check srmRf success ${outputRf} + deleteRemoteFile ${surl} [Teardown] Clear all credentials -Prepare to get multiple existent file +MultiSURL srmPtG [Tags] storm-client ptg - [Setup] Init certificate and voms proxy test0 ${vo} - ${testdir} Get a unique name - ${dirsurl} Build surl ${vo} ${testdir} - ${output} Perform mkdir using clientSRM ${dirsurl} - Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${surl} Build surl ${vo} ${testdir}/${filename}_1 - Copy-out file using lcg-utils ${filename} ${surl} + [Setup] Use default voms proxy + ${surl} getRandomSURL + createRemoteFile ${surl} ${surllist} = Set Variable ${surl} :FOR ${index} IN RANGE 2 10 - \ ${surl} Build surl ${vo} ${testdir}/${filename}_${index} - \ Copy-out file using lcg-utils ${filename} ${surl} + \ ${surl} getRandomSURL ${defaultVO} + \ createRemoteFile ${surl} \ ${surllist} Catenate ${surllist} ${surl} - \ Log ${surllist} - ${output} ${token} Perform ptg using clientSRM ${surllist} -p - Log ${output} - Should Contain ${output} SRM_FILE_PINNED - Should Not Contain ${output} SRM_FAILURE - ${output} Perform rf using clientSRM without token ${surllist} - Log ${output} - Should Contain ${output} SRM_SUCCESS - Should Not Contain ${output} SRM_RELEASED - Should Not Contain ${output} SRM_FAILURE - ${output} Perform rmdir using clientSRM ${dirsurl} -r - Should Contain ${output} SRM_SUCCESS - Remove local file ${filename} - Remove local directory ${testdir} + Log ${surllist} + ${outputPtG} ${token} srmPtG ${surllist} + Log ${outputPtG} + check srmPtG success ${outputPtG} + ${outputRf} srmRf ${surl} ${token} + Log ${outputRf} + check srmRf success ${outputRf} + deleteRemoteFile ${surllist} [Teardown] Clear all credentials -Prepare to get large file +srmPtG on a large file [Documentation] Regression test for https://issues.infn.it/jira/browse/STOR-331 - [Tags] storm-client ptg - [Setup] Init certificate and voms proxy test0 ${vo} + [Tags] storm-client ptg to-be-fixed + [Setup] Use default voms proxy ${filename} Create local file with fake size 2049 - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p Should Contain ${output} SRM_SPACE_AVAILABLE - Copy-out file using globus-utils ${filename} ${vo} ${filename} + Copy-out file using globus-utils ${filename} ${surl} ${output} Perform pd using clientSRM ${surl} ${token} -p ${output} ${token} Perform ptg using clientSRM ${surl} -p Should Contain ${output} SRM_FILE_PINNED Log ${output} Should Contain ${output} fileSize=2148532224 Remove local file ${filename} - Perform rf using clientSRM ${surl} ${token} - Perform rm using clientSRM ${surl} + ${output} Perform rf using clientSRM ${surl} ${token} + Should Contain ${output} SRM_SUCCESS + ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS [Teardown] Clear all credentials -Unauthorized prepare to get on another VO's file - [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${surl} Build surl ${vo} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - Init certificate and plain proxy test0 - ${surl} Build surl ${gridproxyRWStorageArea} ../${vo}/${filename} - ${output} ${token} Perform ptg using clientSRM ${surl} -p - Should Contain ${output} SRM_AUTHORIZATION_FAILURE - Log ${output} - Init certificate and voms proxy test0 ${vo} - Remove file using clientSRM ${vo} ${filename} - Remove local file ${filename} +srmPtG on another storage-area's file + [Tags] storm-client ptg + [Setup] Use default voms proxy + ${filename} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ../${SA.2}/${TESTDIR}/${filename} + ${outputPtG} ${token} srmPtG ${surl} + Log ${outputPtG} + check srmPtG failure with ${outputPtG} SRM_AUTHORIZATION_FAILURE + [Teardown] Clear all credentials + +srmPtG with xroot transfer protocol + [Tags] storm-client ptg + [Setup] Use default voms proxy + ${filename} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + createRemoteFile ${surl} + ${outputPtG} ${token} srmPtG ${surl} -T -P xroot + Log ${outputPtG} + check srmPtG success ${outputPtG} + ${turl} get TURL from output ${outputPtG} + Should Contain ${outputPtG} root://${backEndHost}${storageAreaRoot}/${DEFAULT_SA}/${TESTDIR}/${filename} + ${outputRf} srmRf ${surl} ${token} + check srmRf success ${outputRf} + deleteRemoteFile ${surl} [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/commands/srmPtP.txt b/tests/srm/commands/srmPtP.txt index 9bac954..1359e17 100644 --- a/tests/srm/commands/srmPtP.txt +++ b/tests/srm/commands/srmPtP.txt @@ -1,166 +1,190 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt Resource lib/globus_util.txt -Resource lib/credentials.txt +Resource lib/setup.txt -*** Test Cases *** +*** Keywords *** -Prepare to put of unexistent file - [Tags] storm-client ptp - [Setup] Init certificate and voms proxy test0 ${vo} +getRandomSURL [Arguments] ${sa}=${DEFAULT_SA} ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p - Should Contain ${output} SRM_SPACE_AVAILABLE + ${surl} Build surl ${sa} ${TESTDIR}/${filename} + [Return] ${surl} + +createRemoteFile [Arguments] ${surl} + Put without really putting using clientSRM ${surl} + +srmPtP [Arguments] ${surl} ${options} + ${output} ${token} Perform ptp using clientSRM ${surl} ${options} + Log ${output} + [Return] ${output} ${token} + +srmPd [Arguments] ${surl} ${token} ${output} Perform pd using clientSRM ${surl} ${token} - Perform rm using clientSRM ${surl} - Remove local file ${filename} - [Teardown] Clear all credentials + Log ${output} + [Return] ${output} -Prepare to put on a file already put without overwrite - [Tags] storm-client ptp - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p - Copy-out file using globus-utils ${filename} ${vo} ${filename} - ${output} Perform pd using clientSRM ${surl} ${token} -p - ${output} ${token} Perform ptp using clientSRM ${surl} -p - Should Contain ${output} SRM_FAILURE - Should Contain ${output} SRM_DUPLICATION_ERROR - Should Contain ${output} Cannot srmPut file because it already exists! - Perform rm using clientSRM ${surl} - Remove local file ${filename} - [Teardown] Clear all credentials +srmSPtP [Arguments] ${surl} ${token} + ${output} Perform sptp using clientSRM ${surl} ${token} + Log ${output} + [Return] ${output} -Prepare to put on a file already put with overwrite - [Tags] storm-client ptp - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p +check srmPtP success [Arguments] ${output} Should Contain ${output} SRM_SPACE_AVAILABLE - ${output} Perform pd using clientSRM ${surl} ${token} + Should Not Contain ${output} SRM_FAILURE + +check srmSPtP success [Arguments] ${output} Should Contain ${output} SRM_SUCCESS - ${output} ${token} Perform ptp using clientSRM ${surl} -p -w 1 - Should Contain ${output} SRM_SPACE_AVAILABLE - ${output} Perform pd using clientSRM ${surl} ${token} + Should Not Contain ${output} SRM_FAILURE + +check srmPtP failure with [Arguments] ${output} ${status} + Should Contain ${output} ${status} + Should Contain ${output} SRM_FAILURE + Should Not Contain ${output} SRM_SPACE_AVAILABLE + +check srmSPtP failure with [Arguments] ${output} ${status} + Should Contain ${output} ${status} + Should Contain ${output} SRM_FAILURE + +check srmPd success [Arguments] ${output} Should Contain ${output} SRM_SUCCESS - Perform rm using clientSRM ${surl} - Remove local file ${filename} + Should Not Contain ${output} SRM_FAILURE + +deleteRemoteFile [Arguments] ${surl} + ${output} Perform rm using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + +get TURL from output [Arguments] ${output} + ${result} ${turl}= Should Match Regexp ${output} TURL=(\".+\") + [Return] ${turl} + +*** Test Cases *** + +srmPtP of a non-existent file + [Tags] storm-client ptp + [Setup] Use default voms proxy + ${surl} getRandomSURL + ${outputPtP} ${token} srmPtP ${surl} -p + check srmPtP success ${outputPtP} + ${outputPd} srmPd ${surl} ${token} + check srmPd success ${outputPd} + deleteRemoteFile ${surl} + [Teardown] Clear all credentials + +srmPtP of an existent file with no overwrite + [Tags] storm-client ptp regression + [Setup] Use default voms proxy + ${surl} getRandomSURL + createRemoteFile ${surl} + ${outputPtP} ${token} srmPtP ${surl} -p + check srmPtP failure with ${outputPtP} SRM_DUPLICATION_ERROR + deleteRemoteFile ${surl} + [Teardown] Clear all credentials + +srmPtP of an existent file with overwrite + [Tags] storm-client ptp + [Setup] Use default voms proxy + ${surl} getRandomSURL + createRemoteFile ${surl} + ${outputPtP} ${token} srmPtP ${surl} -p -w 1 + check srmPtP success ${outputPtP} + ${outputPd} srmPd ${surl} ${token} + check srmPd success ${outputPd} + deleteRemoteFile ${surl} [Teardown] Clear all credentials -Prepare to put of an unexistant file with a wrong protocol +srmPtP with unsupported transfer protocol [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/127 - [Tags] storm-client regression - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p -T -P unknown_protocol - Should Contain ${output} SRM_NOT_SUPPORTED - Remove local file ${filename} + [Tags] storm-client ptp regression + [Setup] Use default voms proxy + ${surl} getRandomSURL + ${outputPtP} ${token} srmPtP ${surl} -p -T -P unknownprotocol + check srmPtP failure with ${outputPtP} SRM_NOT_SUPPORTED [Teardown] Clear all credentials -Prepare to put using a non existent space token - [Tags] regression ptp +srmPtP using a non existent space token + [Tags] storm-client ptp regression [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/282. StoRM used to return the wrong error (SRM_SPACE_LIFETIME_EXPIRED instead of SRM_INVALID_REQUEST) for a sptp when a ptp was given a non existent space token. - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p -t whatever - ${output} Perform sptp using clientSRM ${surl} ${token} - Should Contain ${output} SRM_INVALID_REQUEST - Should Contain ${output} The provided Space Token does not exists - Remove local file ${filename} + [Setup] Use default voms proxy + ${surl} getRandomSURL + ${outputPtP} ${token} srmPtP ${surl} -p -t whatever + check srmPtP failure with ${outputPtP} SRM_INVALID_REQUEST + ${outputSPtP} srmSPtP ${surl} ${token} + check srmSPtP failure with ${outputSPtP} SRM_INVALID_REQUEST + Should Contain ${outputSPtP} The provided Space Token does not exists [Teardown] Clear all credentials -Prepare to put with sa token as space token - [Tags] regression ptp +srmPtP with sa token as space token + [Tags] storm-client regression ptp [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/354 A call of the srmPrepareToPut command providing the space token parameter of a storage area fails. - [Setup] Init certificate and voms proxy test0 ${vo} - ${sp_token} Get space token using clientSRM - ${fileName} Get a unique name - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p -t ${sp_token} - Should Contain ${output} SRM_SPACE_AVAILABLE - ${output} Perform pd using clientSRM ${surl} ${token} -p - Should Contain ${output} SRM_SUCCESS - Remove file using clientSRM ${vo} ${filename} - Remove local file ${filename} + [Setup] Use default voms proxy + ${sa_token} Get SA Token ${defaultVO} + ${sp_token} Get space token using clientSRM ${sa_token} + ${surl} getRandomSURL + ${outputPtP} ${token} srmPtP ${surl} -p -t ${sp_token} + check srmPtP success ${outputPtP} + ${outputPd} srmPd ${surl} ${token} + check srmPd success ${outputPd} + deleteRemoteFile ${surl} [Teardown] Clear all credentials -Prepare to put with expectedFileSize not empty - [Tags] regression ptp +srmPtP with expectedFileSize not empty + [Tags] storm-client regression ptp [Documentation] Regression test for https://issues.infn.it/jira/browse/STOR-306 StoRM returns NULL fileSize for ptp with expected size - [Setup] Init certificate and voms proxy test0 ${vo} - ${fileName} Get a unique name - ${surl} Build surl ${vo} ${filename} + [Setup] Use default voms proxy + ${surl} getRandomSURL ${surl_with_size} Catenate SEPARATOR=, ${surl} 12345 - ${output} ${token} Perform ptp using clientSRM ${surl_with_size} -p - Should Contain ${output} SRM_SPACE_AVAILABLE - Should Contain ${output} fileSize=12345 - ${output} Perform pd using clientSRM ${surl} ${token} -p - Should Contain ${output} SRM_SUCCESS - Remove file using clientSRM ${vo} ${filename} - Remove local file ${filename} + ${outputPtP} ${token} srmPtP ${surl_with_size} -p + check srmPtP success ${outputPtP} + Should Contain ${outputPtP} fileSize=12345 + ${outputPd} srmPd ${surl} ${token} + check srmPd success ${outputPd} + deleteRemoteFile ${surl} [Teardown] Clear all credentials -Prepare to put multiple surls +srmPtP with multiple surls [Tags] storm-client ptp - [Setup] Init certificate and voms proxy test0 ${vo} - ${testdir} Get a unique name - ${dirsurl} Build surl ${vo} ${testdir} - ${output} Perform mkdir using clientSRM ${dirsurl} - Should Contain ${output} SRM_SUCCESS - ${filename} Get a unique name - ${surl} Build surl ${vo} ${testdir}/${filename}_1 + [Setup] Use default voms proxy + ${surl} getRandomSURL ${surllist} = Set Variable ${surl} :FOR ${index} IN RANGE 2 10 - \ ${surl} Build surl ${vo} ${testdir}/${filename}_${index} + \ ${surl} getRandomSURL ${defaultVO} \ ${surllist} Catenate ${surllist} ${surl} Log ${surllist} - ${output} ${token} Perform ptp using clientSRM ${surllist} -p - Log ${output} - Should Contain ${output} SRM_SUCCESS - Should Not Contain ${output} SRM_FAILURE - ${output} Perform sptp using clientSRM ${surllist} ${token} - Log ${output} - Should Contain ${output} SRM_SUCCESS - Should Contain ${output} SRM_SPACE_AVAILABLE - Should Not Contain ${output} SRM_FAILURE - ${output} Perform pd using clientSRM ${surllist} ${token} - Log ${output} - Should Contain ${output} SRM_SUCCESS - Should Not Contain ${output} SRM_FAILURE - Perform rmdir using clientSRM ${dirsurl} -r - Should Contain ${output} SRM_SUCCESS - Remove local file ${filename} - Remove local directory ${testdir} + ${outputPtP} ${token} srmPtP ${surllist} -p + check srmPtP success ${outputPtP} + ${outputSPtP} srmSPtP ${surllist} ${token} + check srmSPtP success ${outputSPtP} + ${outputPd} srmPd ${surllist} ${token} + check srmPd success ${outputPd} + deleteRemoteFile ${surllist} [Teardown] Clear all credentials -Check right failure code when invoking PtP/PtP on the same file - [Tags] regression ptp - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p - Should Contain ${output} SRM_SPACE_AVAILABLE - ${output} ${token} Perform ptp using clientSRM ${surl} -p - Log ${output} - Should Contain ${output} SRM_FILE_BUSY - Perform rm using clientSRM ${surl} - Remove local file ${filename} +srmPtP on a busy file + [Tags] storm-client ptp regression + [Setup] Use default voms proxy + ${surl} getRandomSURL + ${outputPtP} ${token} srmPtP ${surl} -p + check srmPtP success ${outputPtP} + ${outputPtP} ${token2} srmPtP ${surl} -p + check srmPtP failure with ${outputPtP} SRM_FILE_BUSY + ${outputPd} srmPd ${surl} ${token} + check srmPd success ${outputPd} + deleteRemoteFile ${surl} [Teardown] Clear all credentials -Check right failure code when invoking PtP/pd/PtP on the same file - [Tags] regression ptp pd - [Setup] Init certificate and voms proxy test0 ${vo} +srmPtP with xroot transfer protocol + [Tags] storm-client ptg + [Setup] Use default voms proxy ${filename} Get a unique name - Put without really putting using clientSRM ${vo} ${filename} - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p - Should Contain ${output} SRM_DUPLICATION_ERROR - Perform rm using clientSRM ${surl} - Remove local file ${filename} + ${surl} Build surl ${defaultVO} ${TESTDIR}/${filename} + ${outputPtP} ${token} srmPtP ${surl} -p -T -P xroot + Log ${outputPtP} + check srmPtP success ${outputPtP} + ${turl} get TURL from output ${outputPtP} + Should Contain ${outputPtP} root://${backEndHost}${storageAreaRoot}/${defaultVO}/${TESTDIR}/${filename} + ${outputPd} srmPd ${surl} ${token} + check srmPd success ${outputPd} + deleteRemoteFile ${surl} [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/commands/srmRf.txt b/tests/srm/commands/srmRf.txt index e63ca9c..9a15296 100644 --- a/tests/srm/commands/srmRf.txt +++ b/tests/srm/commands/srmRf.txt @@ -1,60 +1,153 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt +Resource lib/setup.txt -*** Test Cases *** +*** Keywords *** -Release file on an existent file using clientSRM - [Tags] storm-client rf - [Setup] Init certificate and voms proxy test0 ${vo} +Get random simple SURL ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - Put without really putting using clientSRM ${vo} ${filename} + ${surl} Build simple surl ${DEFAULT_SA} ${TESTDIR}/${filename} + [Return] ${surl} + +Get random query SURL + ${filename} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + [Return] ${surl} + +Create remote file [Arguments] ${surl} + Put without really putting using clientSRM ${surl} + +Do PTG [Arguments] ${surl} ${output} ${token} Perform ptg using clientSRM ${surl} -p Should Contain ${output} SRM_FILE_PINNED + [Return] ${token} + +Remove remote file [Arguments] ${surl} + ${output} Perform rm using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + +Release file with SURL and TOKEN [Arguments] ${surl} ${token} ${output} Perform rf using clientSRM ${surl} ${token} Should Contain ${output} SRM_SUCCESS Should Not Contain ${output} SRM_RELEASED Should Not Contain ${output} SRM_FAILURE - Perform rm using clientSRM ${surl} - Remove local file ${filename} - [Teardown] Clear all credentials -Release multiple files without specifying the request token with surl in query form - [Tags] storm-client rf - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - Put without really putting using clientSRM ${vo} ${filename} - ${output} ${token1} Perform ptg using clientSRM ${surl} -p - Should Contain ${output} SRM_FILE_PINNED - ${output} ${token2} Perform ptg using clientSRM ${surl} -p - Should Contain ${output} SRM_FILE_PINNED +Release file with SURL [Arguments] ${surl} ${output} Perform rf using clientSRM without token ${surl} Should Contain ${output} SRM_SUCCESS Should Not Contain ${output} SRM_RELEASED Should Not Contain ${output} SRM_FAILURE - log ${output} - Perform rm using clientSRM ${surl} - Remove local file ${filename} - [Teardown] Clear all credentials -Release multiple files without specifying the request token with surl in simple form - [Tags] storm-client rf - [Documentation] Regression test for https://issues.infn.it/jira/browse/STOR-305 srmReleaseFiles doesn't release multiple files at once. - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${surl} Build simple surl ${vo} ${filename} - Put without really putting using clientSRM ${vo} ${filename} - ${output} ${token1} Perform ptg using clientSRM ${surl} -p - Should Contain ${output} SRM_FILE_PINNED - ${output} ${token2} Perform ptg using clientSRM ${surl} -p - Should Contain ${output} SRM_FILE_PINNED - ${output} Perform rf using clientSRM without token ${surl} +Release file with TOKEN [Arguments] ${token} + ${output} Perform rf using clientSRM without surl ${token} Should Contain ${output} SRM_SUCCESS Should Not Contain ${output} SRM_RELEASED Should Not Contain ${output} SRM_FAILURE - Perform rm using clientSRM ${surl} - Remove local file ${filename} + +Invalid release file with TOKEN [Arguments] ${token} + ${output} Perform rf using clientSRM without surl ${token} + Should Not Contain ${output} SRM_SUCCESS + Should Contain ${output} SRM_INVALID_PATH + Should Contain ${output} SRM_FAILURE + + +*** Test Cases *** + +Release file using SURL and TOKEN + [Tags] storm-client rf + [Setup] Use default voms proxy + ${surl} Get random simple SURL + Create remote file ${surl} + ${token} Do PTG ${surl} + Release file with SURL and TOKEN ${surl} ${token} + Remove remote file ${surl} + [Teardown] Clear all credentials + +Release file using only SURL + [Tags] storm-client rf + [Setup] Use default voms proxy + ${surl} Get random simple SURL + Create remote file ${surl} + Do PTG ${surl} + Release file with SURL ${surl} + Remove remote file ${surl} + [Teardown] Clear all credentials + +Release file using only TOKEN + [Tags] storm-client rf + [Setup] Use default voms proxy + ${surl} Get random simple SURL + Create remote file ${surl} + ${token} Do PTG ${surl} + Release file with TOKEN ${token} + Remove remote file ${surl} + [Teardown] Clear all credentials + +Release file using SURL and TOKEN with SURL in query form + [Tags] storm-client rf + [Setup] Use default voms proxy + ${surl} Get random query SURL + Create remote file ${surl} + ${token} Do PTG ${surl} + Release file with SURL and TOKEN ${surl} ${token} + Remove remote file ${surl} + [Teardown] Clear all credentials + +Release file using only SURL with SURL in query form + [Tags] storm-client rf + [Setup] Use default voms proxy + ${surl} Get random query SURL + Create remote file ${surl} + Do PTG ${surl} + Release file with SURL ${surl} + Remove remote file ${surl} + [Teardown] Clear all credentials + +Release file using only TOKEN with SURL in query form + [Tags] storm-client rf + [Setup] Use default voms proxy + ${surl} Get random query SURL + Create remote file ${surl} + ${token} Do PTG ${surl} + Release file with TOKEN ${token} + Remove remote file ${surl} + [Teardown] Clear all credentials + +Release multiple ptg requests specifying only SURL + [Tags] storm-client rf + [Documentation] Regression test for https://issues.infn.it/jira/browse/STOR-305 srmReleaseFiles doesn't release multiple files at once. + [Setup] Use default voms proxy + ${surl} Get random simple SURL + Create remote file ${surl} + Do PTG ${surl} + Do PTG ${surl} + Release file with SURL ${surl} + Remove remote file ${surl} + [Teardown] Clear all credentials + +Release multiple ptg requests specifying only SURL in query form + [Tags] storm-client rf + [Documentation] Regression test for https://issues.infn.it/jira/browse/STOR-305 srmReleaseFiles doesn't release multiple files at once. + [Setup] Use default voms proxy + ${surl} Get random query SURL + Create remote file ${surl} + Do PTG ${surl} + Do PTG ${surl} + Release file with SURL ${surl} + Remove remote file ${surl} + [Teardown] Clear all credentials + +Release multiple files specifying only TOKEN + [Tags] storm-client rf + [Setup] Use default voms proxy + ${surl} Get random simple SURL + Create remote file ${surl} + ${surl2} Get random simple SURL + Create remote file ${surl2} + ${token} Do PTG ${surl} ${surl2} + Release file with TOKEN ${token} + Remove remote file ${surl} + Remove remote file ${surl2} [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/commands/srmRm.txt b/tests/srm/commands/srmRm.txt index 34c889c..896c7ab 100644 --- a/tests/srm/commands/srmRm.txt +++ b/tests/srm/commands/srmRm.txt @@ -1,70 +1,67 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt Resource lib/lcg_util.txt +Resource lib/setup.txt *** Test Cases *** Remove existent file [Tags] storm-client rm - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - Put without really putting using clientSRM ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Put without really putting using clientSRM ${surl} ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - Remove local file ${filename} [Teardown] Clear all credentials Remove unexistent file [Tags] storm-client rm - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_INVALID_PATH - Remove local file ${filename} + Should Contain ${output} File does not exist [Teardown] Clear all credentials Removing unauthorized file - [Tags] storm-client rm to-be-fixed - [Setup] Init certificate and voms proxy test0 ${vo} + [Tags] storm-client rm + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - Put without really putting using clientSRM ${vo} ${filename} - Init certificate and plain proxy test0 + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Put without really putting using clientSRM ${surl} + Use default grid proxy ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_AUTHORIZATION_FAILURE - Init certificate and voms proxy test0 ${vo} + Use default voms proxy ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - Remove local file ${filename} [Teardown] Clear all credentials Partial success on removing multiple files [Tags] storm-client rm - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name ${filename2} Get a unique name - Put without really putting using clientSRM ${vo} ${filename} - Put without really putting using clientSRM ${vo} ${filename2} - ${surl} Build surl ${vo} ${filename} - ${surl2} Build surl ${vo} ${filename2} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${surl2} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename2} + Put without really putting using clientSRM ${surl} + Put without really putting using clientSRM ${surl2} ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS ${output} Perform rm using clientSRM ${surl} ${surl2} Should Contain ${output} SRM_PARTIAL_SUCCESS - Remove local file ${filename} - Remove local file ${filename2} [Teardown] Clear all credentials Remove a pinned file must set aborted the ptg request [Tags] storm-client rm ptg - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - Put without really putting using clientSRM ${vo} ${filename} - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Put without really putting using clientSRM ${surl} ${output} ${token} Perform ptg using clientSRM ${surl} -p Should Contain ${output} SRM_FILE_PINNED ${output} Perform rm using clientSRM ${surl} @@ -72,21 +69,31 @@ Remove a pinned file must set aborted the ptg request ${output} Perform sptg using clientSRM ${surl} ${token} Should Not Contain ${output} SRM_FILE_PINNED Should Contain ${output} SRM_ABORTED - Remove local file ${filename} [Teardown] Clear all credentials Unauthorized remove on another VO's file [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${surl} Build surl ${vo} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - Init certificate and plain proxy test0 - ${surl} Build surl ${gridproxyRWStorageArea} ../${vo}/${filename} + [Setup] Use default voms proxy + ${filename} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ../${SA.2}/${TESTDIR}/${filename} ${output} Perform rm using clientSRM ${surl} - Should Contain ${output} SRM_INVALID_PATH + Should Contain ${output} SRM_AUTHORIZATION_FAILURE Log ${output} - Init certificate and voms proxy test0 ${vo} - Remove file using clientSRM ${vo} ${filename} - Remove local file ${filename} [Teardown] Clear all credentials + + +srmRm properly cleans up ongoing PtPs + [Tags] storm-client rm ptp stor-779 + [Documentation] Regression test for https://issues.infn.it/jira/browse/STOR-779 + [Setup] Use default voms proxy + ${filename} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${output} ${token} Perform ptp using clientSRM ${surl} -p + Should Not Contain ${output} SRM_FAILURE + Should Contain ${output} SRM_SPACE_AVAILABLE + ${output} Perform rm using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + ${output} ${token} Perform ptp using clientSRM ${surl} -p + Should Not Contain ${output} SRM_FAILURE + Should Contain ${output} SRM_SPACE_AVAILABLE + [Teardown] Clear all credentials diff --git a/tests/srm/commands/srmRmDir.txt b/tests/srm/commands/srmRmDir.txt index e1a069f..5f76cb0 100644 --- a/tests/srm/commands/srmRmDir.txt +++ b/tests/srm/commands/srmRmDir.txt @@ -1,87 +1,81 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt +Resource lib/setup.txt *** Test Cases *** Remove existent empty directory [Tags] storm-client rmdir - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build surl ${vo} ${dirname} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} ${output} Perform mkdir using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS ${output} Perform rmdir using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - Remove local directory ${dirname} [Teardown] Clear all credentials -Remove unexistent directory - [Tags] storm-client mkdir - [Setup] Init certificate and voms proxy test0 ${vo} +Remove a non existent directory + [Tags] storm-client rmdir + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build surl ${vo} ${dirname} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} ${output} Perform rmdir using clientSRM ${surl} Should Contain ${output} SRM_INVALID_PATH - Remove local directory ${dirname} + Should Contain ${output} Directory does not exists [Teardown] Clear all credentials Remove existent non empty directory without recursion [Tags] storm-client rmdir - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name ${filename} Get a unique name - ${dirsurl} Build surl ${vo} ${dirname} - ${output} Perform mkdir using clientSRM ${dirsurl} + ${surlDir} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${surlFile} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${filename} + ${output} Perform mkdir using clientSRM ${surlDir} Should Contain ${output} SRM_SUCCESS - Put without really putting using clientSRM ${vo} ${dirname}/${filename} - Should Contain ${output} SRM_SUCCESS - ${output} Perform rmdir using clientSRM ${dirsurl} + Put without really putting using clientSRM ${surlFile} + ${output} Perform rmdir using clientSRM ${surlDir} Should Contain ${output} SRM_NON_EMPTY_DIRECTORY - Remove not empty directory using clientSRM ${vo} ${dirname} - Remove local directory ${dirname} - Remove local file ${filename} + ${output} Perform rmdir using clientSRM ${surlDir} -r + Should Contain ${output} SRM_SUCCESS [Teardown] Clear all credentials Remove existent non empty directory with recursion [Tags] storm-client rmdir - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name ${filename} Get a unique name - ${dirsurl} Build surl ${vo} ${dirname} - ${output} Perform mkdir using clientSRM ${dirsurl} + ${surlDir} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${surlFile} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${filename} + ${output} Perform mkdir using clientSRM ${surlDir} Should Contain ${output} SRM_SUCCESS - Put without really putting using clientSRM ${vo} ${dirname}/${filename} + Put without really putting using clientSRM ${surlFile} + ${output} Perform rmdir using clientSRM ${surlDir} -r Should Contain ${output} SRM_SUCCESS - ${output} Perform rmdir using clientSRM ${dirsurl} -r 1 - Should Contain ${output} SRM_SUCCESS - Remove not empty directory using clientSRM ${vo} ${dirname} - Remove local directory ${dirname} - Remove local file ${filename} [Teardown] Clear all credentials Remove invalid path [Tags] storm-client rmdir - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build surl fakeVO ${dirname} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} ${output} Perform rmdir using clientSRM ${surl} Should Contain ${output} SRM_INVALID_PATH - Remove local directory ${dirname} [Teardown] Clear all credentials Removing unauthorized directory - [Tags] storm-client rmdir to-be-fixed - [Setup] Init certificate and voms proxy test0 ${vo} + [Tags] storm-client rmdir + [Setup] Use default voms proxy ${dirname} Get a unique name - ${surl} Build surl ${vo} ${dirname} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} ${output} Perform mkdir using clientSRM ${surl} - Init certificate and plain proxy test0 - ${output} Perform rm using clientSRM ${surl} + Use default grid proxy + ${output} Perform rmdir using clientSRM ${surl} Should Contain ${output} SRM_AUTHORIZATION_FAILURE - Init certificate and voms proxy test0 ${vo} - ${output} Perform rm using clientSRM ${surl} + Use default voms proxy + ${output} Perform rmdir using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - Remove local directory ${dirname} [Teardown] Clear all credentials diff --git a/tests/srm/commands/srmSBoL.txt b/tests/srm/commands/srmSBoL.txt new file mode 100644 index 0000000..49063dc --- /dev/null +++ b/tests/srm/commands/srmSBoL.txt @@ -0,0 +1,14 @@ +*** Settings *** + +Resource lib/stormlib.txt +Resource lib/clientSRM.txt +Resource lib/setup.txt + +*** Test Cases ** + +Status of bring online using a non existent token + [Tags] regression sbol + [Documentation] Regression test for https://issues.infn.it/browse/STOR-217. StoRM crashed when a status for an async request was requested but the service is not able to get the into out of the database (for example, the token does not exists). This test calls a status for bring online. + [Setup] Use default voms proxy + ${output} Execute clientSRM Command bol -t abcde + [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/commands/srmSPtG.txt b/tests/srm/commands/srmSPtG.txt index 74c5200..c7f4843 100644 --- a/tests/srm/commands/srmSPtG.txt +++ b/tests/srm/commands/srmSPtG.txt @@ -1,45 +1,44 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt +Resource lib/setup.txt *** Test Cases ** Status of a prepare to get with file pinned [Tags] storm-client sptg - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - Put without really putting using clientSRM ${vo} ${filename} - ${surl} Build surl ${vo} ${filename} - ${output} ${token} Perform ptg using clientSRM ${surl} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Put without really putting using clientSRM ${surl} + ${output} ${token1} Perform ptg using clientSRM ${surl} Should Contain ${output} SRM_REQUEST_QUEUED - ${output} ${token} Perform ptg using clientSRM ${surl} -p + ${output} ${token2} Perform ptg using clientSRM ${surl} -p Should Contain ${output} SRM_FILE_PINNED - ${output} Perform sptg using clientSRM ${surl} ${token} + ${output} Perform sptg using clientSRM ${surl} ${token2} Should Contain ${output} SRM_FILE_PINNED - ${output} Perform rf using clientSRM ${surl} ${token} -p + ${output} Perform rf using clientSRM ${surl} ${token2} Should Contain ${output} SRM_SUCCESS Should Not Contain ${output} SRM_RELEASED Should Not Contain ${output} SRM_FAILURE ${output} Perform rm using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - Remove local file ${filename} [Teardown] Clear all credentials Status of a prepare to get on a unexistent file [Tags] storm-client sptg - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptg using clientSRM ${surl} -p ${output} Perform sptg using clientSRM ${surl} ${token} Should Contain ${output} SRM_FAILURE - Remove local file ${filename} [Teardown] Clear all credentials Status of prepare to get using a non existent token [Tags] regression sptg [Documentation] Regression test for https://issues.infn.it/browse/STOR-217. StoRM crashed when a status for an async request was requested but the service is not able to get the into out of the database (for example, the token does not exists). This test calls a status for a prepare to get. - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${output} Execute clientSRM Command sptg -t abcde [Teardown] Clear all credentials diff --git a/tests/srm/commands/srmSPtP.txt b/tests/srm/commands/srmSPtP.txt index ea09c16..1789b96 100644 --- a/tests/srm/commands/srmSPtP.txt +++ b/tests/srm/commands/srmSPtP.txt @@ -1,13 +1,14 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt +Resource lib/setup.txt *** Test Cases *** Status of prepare to put using a non existent token [Tags] regression sptp [Documentation] Regression test for https://issues.infn.it/browse/STOR-217. StoRM crashed when a status for an async request was requested but the service is not able to get the into out of the database (for example, the token does not exists). This test calls a status for a prepare to put. - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${output} Execute clientSRM Command sptp -t abcde [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/data_transfer/data_transfer.txt b/tests/srm/data_transfer/data_transfer.txt index 4433436..f43b81c 100644 --- a/tests/srm/data_transfer/data_transfer.txt +++ b/tests/srm/data_transfer/data_transfer.txt @@ -1,181 +1,64 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt Resource lib/globus_util.txt Resource lib/lcg_util.txt -Resource lib/dcache.txt -Resource lib/credentials.txt +Resource lib/setup.txt *** Test Cases *** Test that the SRM service is able to transfer a file on the SRM endpoint [Tags] storm-client globus-utils - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p Should Contain ${output} SRM_SPACE_AVAILABLE - Copy-out file using globus-utils ${filename} ${vo} ${filename} - ${output} Perform pd using clientSRM ${surl} ${token} -p + ${turl} Build gsiftp TURL ${DEFAULT_SA} ${TESTDIR}/${filename} + Copy-out file using globus-utils ${filename} ${turl} + ${output} Perform pd using clientSRM ${surl} ${token} Should Contain ${output} SRM_SUCCESS ${output} Perform ls using clientSRM ${surl} Should Contain ${output} SRM_SUCCESS - Perform rm using clientSRM ${surl} - Remove local file ${filename} - [Teardown] Clear all credentials - -Test that the SRM service is able to transfer a file from the SRM endpoint - [Tags] storm-client ptg - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${surl} Build surl ${vo} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${output} ${token} Perform ptg using clientSRM ${surl} -p -T -P gsiftp - ${result} ${turl}= Should Match Regexp ${output} transferURL=(\".+\") - Copy-in file using gsiftp protocol ${turl} ${filename} - Perform rm using clientSRM ${surl} - Remove local file ${filename} - [Teardown] Clear all credentials - -Check lcg-cp computed checksum in case it starts with zero - [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/108. Given a file with ADLER32 checksum that starts with '0' and a SURL pointing to a non existent file in an existent folder, verify that after transfering the file on the SURL the checksum value computed for the file matches as string with the one of the local file. - [Tags] lcg-utils regression cp - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFile} Create local file with checksum that starts with zero - ${srcSurl} Build surl ${vo} ${srcFile} - ${destFile} Get a unique name - ${destSurl} Build surl ${vo} ${destFile} - Copy-out file using lcg-utils ${srcFile} ${srcSurl} - ${output} Detailed ls using clientSRM ${srcSurl} - ${result} ${b_checksum}= Should Match Regexp ${output} checkSumValue=(\".+\") - Log ${b_checksum} - Copy file using lcg-utils ${srcSurl} ${destSurl} - ${output} Detailed ls using clientSRM ${destSurl} - ${result} ${a_checksum}= Should Match Regexp ${output} checkSumValue=(\".+\") - Log ${a_checksum} - Should be equal ${b_checksum} ${a_checksum} - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFile} - Remove local file ${destFile} - [Teardown] Clear all credentials - -Test lcg-cp out - [Tags] lcg-utils cp - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${surl} Build surl ${vo} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - Perform rm using clientSRM ${surl} - Remove local file ${filename} - [Teardown] Clear all credentials - -Check a file is correctly transferred out, re-transferred in and deleted with dcache client - [Tags] lcg-utils dcache-client - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${surl} Build surl ${vo} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - Copy-in file using lcg-utils ${surl} ${filename} - Remove file using dCache client ${vo} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -Check file copy in/out using lcg-utils, use dcache-client to create/remove dir and file - [Tags] lcg-utils dcache-client - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${output} List files in directory using lcg_utils ${vo} ${filename} - Should Contain ${output} No such file or directory - ${dirName} Get a unique name - Create directory using dCache client ${vo} ${dirName} - ${output} Try to create directory using dCache client ${vo} ${dirName} - Should Contain ${output} SRM_DUPLICATION_ERROR - ${output} List files in directory using lcg_utils ${vo} ${dirName} - Should Not Contain ${output} SRM_INVALID_PATH - ${surl} Build surl ${vo} ${dirName}/${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${output} List files in directory using lcg_utils ${vo} ${dirName}/${filename} - Should Not Contain ${output} SRM_INVALID_PATH - Copy-in file using lcg-utils ${surl} ${filename} - Remove file using dCache client ${vo} ${dirName}/${filename} - ${output} Try to remove file using dCache client ${vo} ${dirName}/${filename} - Should Contain ${output} SRM_FAILURE - Remove directory using dCache client ${vo} ${dirName} - ${output} Try to remove directory using dCache client ${vo} ${dirName} - Should Contain ${output} SRM_INVALID_PATH - Remove local file ${filename} - Remove local directory ${dirName} [Teardown] Clear all credentials -Check a file is correctly transferred out, the calculate checksum is correct and delete with dcache client - [Tags] lcg-utils dcache-client - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${surl} Build surl ${vo} ${filename} - ${output} List files in directory using lcg_utils ${vo} ${filename} - Should Contain ${output} SRM_INVALID_PATH - Copy-out file using lcg-utils ${filename} ${surl} - ${output} List files in directory using lcg_utils ${vo} ${filename} - Should Contain ${output} ADLER32 - Remove file using dCache client ${vo} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -Check the correct backend behaviour when a user specifies a DB PWD in the def file - [Tags] lcg-utils dcache-client - [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/227 - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${surl} Build surl ${vo} ${filename} - ${output} List files in directory using lcg_utils ${vo} ${filename} - Should Contain ${output} SRM_INVALID_PATH - Copy-out file using lcg-utils ${filename} ${surl} - Remove file using dCache client ${vo} ${filename} - Remove local file ${filename} - Transfer empty file [Tags] regression ptp to-be-fixed [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/241. If a client tries to transfer an empty file to a valid gsiftp TURL the transfer fails. - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local empty file - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p Should Contain ${output} SRM_SPACE_AVAILABLE - ${output} Try to copy-out file using globus-utils ${filename} ${vo} ${filename} + ${turl} Build gsiftp TURL ${DEFAULT_SA} ${TESTDIR}/${filename} + ${output} Try to copy-out file using globus-utils ${filename} ${turl} Should not contain ${output} globus_xio: An end of file occurred [Teardown] Clear all credentials -Copy out a file using lcg-utils - [Tags] lcg-utils - [Setup] Init certificate and voms proxy test0 ${vo} +Test that the SRM service is able to transfer a file from the SRM endpoint + [Tags] storm-client ptg + [Setup] Use default voms proxy ${filename} Create local file - ${surl} Build surl ${vo} ${filename} - Check file does not exists using lcg-utils ${surl} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} Copy-out file using lcg-utils ${filename} ${surl} - Copy-in file using lcg-utils ${surl} ${filename}_copied - Execute and check success diff /tmp/${filename} /tmp/${filename}_copied - Perform rm using clientSRM ${surl} - Remove local file ${filename} - Remove local file ${filename}_copied + ${output} ${token} Perform ptg using clientSRM ${surl} -p -T -P gsiftp + ${result} ${turl}= Should Match Regexp ${output} transferURL=(\".+\") + Copy-in file using gsiftp protocol ${turl} ${filename} [Teardown] Clear all credentials Check checksum of copied file - [Tags] lcg-util + [Tags] lcg-utils [Documentation] StoRM BE must be configured with GRIDFTP_WITH_DSI="yes" to pass this test - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file - ${srcsurl} Build surl ${vo} ${filename} + ${srcsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${srcsurl} -p - Copy-out file using globus-utils ${filename} ${vo} ${filename} + ${turl} Build gsiftp TURL ${DEFAULT_SA} ${TESTDIR}/${filename} + Copy-out file using globus-utils ${filename} ${turl} ${output} Perform pd using clientSRM ${srcsurl} ${token} -p - ${destsurl} Build surl ${vo} ${filename}_copied + ${destsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename}_copied ${output} Copy file using lcg-utils ${srcsurl} ${destsurl} --checksum Log ${output} Should Contain ${output} Source and destination checksums are matching - ${output} Perform rm using clientSRM ${srcsurl} - Should Contain ${output} SRM_SUCCESS - ${output} Perform rm using clientSRM ${destsurl} - Should Contain ${output} SRM_SUCCESS - Remove local file ${filename} [Teardown] Clear all credentials diff --git a/tests/srm/dcache_srmclient/dcache_srmclient.txt b/tests/srm/dcache_srmclient/dcache_srmclient.txt new file mode 100644 index 0000000..6cd8a2d --- /dev/null +++ b/tests/srm/dcache_srmclient/dcache_srmclient.txt @@ -0,0 +1,137 @@ +*** Settings *** + +Resource lib/stormlib.txt +Resource lib/dcache.txt +Resource lib/lcg_util.txt +Resource lib/clientSRM.txt +Resource lib/setup.txt + +*** Test Cases *** + +Ping using the dCache client + [Tags] ping dcache-client + [Setup] Use default voms proxy + ${output} Ping using dCache client + Should Contain ${output} StoRM + [Teardown] Clear all credentials + +Create directory using the dCache client + [Tags] dcache-client rmdir + [Setup] Use default voms proxy + ${dirName} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirName} + Create directory using dCache client ${surl} + ${output} Perform rmdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + [Teardown] Clear all credentials + +Create a directory that already exists using the dCache client + [Tags] dcache-client mkdir + [Setup] Use default voms proxy + ${dirName} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirName} + ${output} Perform mkdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + ${output} Try to create directory using dCache client ${surl} + Should Contain ${output} SRM_DUPLICATION_ERROR + Should Contain ${output} Directory specified exists! + ${output} Perform rmdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + [Teardown] Clear all credentials + +Remove a non existent directory using the dCache client + [Tags] dcache-client rmdir + [Setup] Use default voms proxy + ${dirName} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirName} + ${output} Try to remove directory using dCache client ${surl} + Should Contain ${output} SRM_INVALID_PATH + Should Contain ${output} Directory does not exists + [Teardown] Clear all credentials + +Remove a non existent file using the dCache client + [Tags] dcache-client rm + [Setup] Use default voms proxy + ${fileName} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${fileName} + ${output} Try to remove file using dCache client ${surl} + Should Contain ${output} SRM_INVALID_PATH + Should Contain ${output} File does not exist + [Teardown] Clear all credentials + +Remove an existent file using dCache client + [Tags] dcache-client rm + [Setup] Use default voms proxy + ${filename} Create local file + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Check file does not exists using lcg-utils ${surl} + Copy-out file using lcg-utils ${filename} ${surl} + Check file exists using lcg-utils ${surl} + Remove file using dCache client ${surl} + Remove local file ${fileName} + [Teardown] Clear all credentials + +Check a file is correctly transferred out, re-transferred in and deleted with dcache client + [Tags] lcg-utils dcache-client + [Setup] Use default voms proxy + ${filename} Create local file + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Copy-out file using lcg-utils ${filename} ${surl} + Copy-in file using lcg-utils ${surl} ${filename} + Remove file using dCache client ${surl} + Remove local file ${filename} + [Teardown] Clear all credentials + +Check file copy in/out using lcg-utils, use dcache-client to create/remove dir and file + [Tags] lcg-utils dcache-client + [Setup] Use default voms proxy + ${filename} Create local file + ${dirName} Get a unique name + ${surlDir} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirName} + ${surlFile} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirName}/${filename} + ${output} List files in directory using lcg_utils ${surlDir} + Should Contain ${output} No such file or directory + Create directory using dCache client ${surlDir} + ${output} Try to create directory using dCache client ${surlDir} + Should Contain ${output} SRM_DUPLICATION_ERROR + ${output} List files in directory using lcg_utils ${surlDir} + Should Not Contain ${output} SRM_INVALID_PATH + Copy-out file using lcg-utils ${filename} ${surlFile} + ${output} List files in directory using lcg_utils ${surlDir} + Should Not Contain ${output} SRM_INVALID_PATH + Copy-in file using lcg-utils ${surlFile} ${filename} + Remove file using dCache client ${surlFile} + ${output} Try to remove file using dCache client ${surlFile} + Should Contain ${output} SRM_FAILURE + Remove directory using dCache client ${surlDir} + ${output} Try to remove directory using dCache client ${surlDir} + Should Contain ${output} SRM_INVALID_PATH + Remove local file ${filename} + [Teardown] Clear all credentials + +Check a file is correctly transferred out, the calculate checksum is correct and delete with dcache client + [Tags] lcg-utils dcache-client + [Setup] Use default voms proxy + ${filename} Create local file + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${output} List files in directory using lcg_utils ${surl} + Should Contain ${output} SRM_INVALID_PATH + Copy-out file using lcg-utils ${filename} ${surl} + ${output} List files in directory using lcg_utils ${surl} + Should Contain ${output} ADLER32 + Remove file using dCache client ${surl} + Remove local file ${filename} + [Teardown] Clear all credentials + +Check the correct backend behaviour when a user specifies a DB PWD in the def file + [Tags] lcg-utils dcache-client + [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/227 + [Setup] Use default voms proxy + ${filename} Create local file + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + ${output} List files in directory using lcg_utils ${surl} + Should Contain ${output} SRM_INVALID_PATH + Copy-out file using lcg-utils ${filename} ${surl} + Remove file using dCache client ${surl} + Remove local file ${filename} + [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/directory/directory.txt b/tests/srm/directory/directory.txt deleted file mode 100644 index b9d2e3f..0000000 --- a/tests/srm/directory/directory.txt +++ /dev/null @@ -1,202 +0,0 @@ -*** Settings *** -Resource lib/stormlib.txt -Resource lib/dcache.txt -Resource lib/lcg_util.txt -Resource lib/clientSRM.txt -Resource lib/credentials.txt - -*** Test Cases *** - -List files in storage area root - [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} - ${surl} Build surl ${vo} ${EMPTY} - Perform ls using clientSRM ${surl} -c 1 - [Teardown] Clear all credentials - -Create and remove a directory using clientSRM - [Tags] storm-client rmdir - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirName} Get a unique name - Create directory using clientSRM ${vo} ${dirName} - Remove empty directory using clientSRM ${vo} ${dirName} - Remove local directory ${dirName} - [Teardown] Clear all credentials - -Create and remove a directory using the dCache client - [Tags] dcache-client rmdir - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirName} Get a unique name - Create directory using dCache client ${vo} ${dirName} - ${output} Remove empty directory using clientSRM ${vo} ${dirName} - Should Contain ${output} SRM_SUCCESS - Remove local directory ${dirName} - [Teardown] Clear all credentials - -Create a directory that already exists using clientSRM - [Tags] storm-client mkdir - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirName} Get a unique name - ${output} Create directory using clientSRM ${vo} ${dirName} - Should Contain ${output} SRM_SUCCESS - ${output} Create directory using clientSRM ${vo} ${dirName} - Should Contain ${output} SRM_DUPLICATION_ERROR - Should Contain ${output} Directory specified exists! - Remove empty directory using clientSRM ${vo} ${dirName} - Remove local directory ${dirName} - [Teardown] Clear all credentials - -Create a directory that already exists using the dCache client - [Tags] dcache-client mkdir - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirName} Get a unique name - ${output} Create directory using clientSRM ${vo} ${dirName} - Should Contain ${output} SRM_SUCCESS - ${output} Try to create directory using dCache client ${vo} ${dirName} - Should Contain ${output} SRM_DUPLICATION_ERROR - Should Contain ${output} Directory specified exists! - Remove empty directory using clientSRM ${vo} ${dirName} - Remove local directory ${dirName} - [Teardown] Clear all credentials - -Remove a non existent directory using clientSRM - [Tags] storm-client rmdir - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirName} Get a unique name - ${output} Remove empty directory using clientSRM ${vo} ${dirName} - Should Contain ${output} SRM_INVALID_PATH - Should Contain ${output} Directory does not exists - Remove local directory ${dirName} - [Teardown] Clear all credentials - -Remove a non existent directory using the dCache client - [Tags] dcache-client rmdir - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirName} Get a unique name - ${output} Try to remove directory using dCache client ${vo} ${dirName} - Should Contain ${output} SRM_INVALID_PATH - Should Contain ${output} Directory does not exists - Remove local directory ${dirName} - [Teardown] Clear all credentials - -Remove a non existent file using clientSRM - [Tags] storm-client rm - [Setup] Init certificate and voms proxy test0 ${vo} - ${fileName} Get a unique name - ${output} Remove file using clientSRM ${vo} ${fileName} - Should Contain ${output} SRM_INVALID_PATH - Should Contain ${output} File does not exist - Remove local file ${fileName} - [Teardown] Clear all credentials - -Remove a non existent file using the dCache client - [Tags] dcache-client rm - [Setup] Init certificate and voms proxy test0 ${vo} - ${fileName} Get a unique name - ${output} Try to remove file using dCache client ${vo} ${fileName} - Should Contain ${output} SRM_INVALID_PATH - Should Contain ${output} File does not exist - Remove local file ${fileName} - [Teardown] Clear all credentials - -List files in an existing directory - [Tags] storm-client lcg-utils ls - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirName} Get a unique name - ${surl} Build surl ${vo} ${dirName} - ${output} Create directory using clientSRM ${vo} ${dirName} - Should Contain ${output} SRM_SUCCESS - ${fileName} Get a unique name - Put without really putting using clientSRM ${vo} ${dirName}/${fileName} - ${output} List files in directory using lcg_utils ${vo} ${dirName} - Should Contain ${output} ${fileName} - ${output} List files in directory using clientSRM ${vo} ${dirName} - Should Contain ${output} ${fileName} - Remove not empty directory using clientSRM ${vo} ${dirName} - Remove local file ${fileName} - Remove local directory ${dirName} - [Teardown] Clear all credentials - -Check if a clientSRM ls on an existent surl works - [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - Put without really putting using clientSRM ${vo} ${filename} - ${surl} Build surl ${vo} ${filename} - ${output} Perform ls using clientSRM ${surl} -c 1 - Should Contain ${output} SRM_SUCCESS - Perform rm using clientSRM ${surl} - Remove local file ${fileName} - [Teardown] Clear all credentials - -Check if a clientSRM ls on a non-existent file fails - [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - ${output} Perform ls using clientSRM ${surl} -c 1 - Should Contain ${output} SRM_FAILURE - Remove local file ${fileName} - [Teardown] Clear all credentials - -Check if a lcg-ls on an existent surl works - [Tags] lcg-utils ls - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - Put without really putting using clientSRM ${vo} ${filename} - ${surl} Build surl ${vo} ${filename} - Check file exists using lcg-utils ${surl} - Remove file using clientSRM ${vo} ${filename} - Remove local file ${fileName} - [Teardown] Clear all credentials - -Check if a lcg-ls on a non-existent surl fails - [Tags] lcg-utils ls - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} - Check file does not exists using lcg-utils ${surl} - Remove local file ${fileName} - [Teardown] Clear all credentials - -Remove an existent file using dCache client - [Tags] dcache-client rm - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${surl} Build surl ${vo} ${filename} - Check file does not exists using lcg-utils ${surl} - Copy-out file using lcg-utils ${filename} ${surl} - Check file exists using lcg-utils ${surl} - Remove file using dCache client ${vo} ${filename} - Remove local file ${fileName} - [Teardown] Clear all credentials - -Check a clientSRM ls on a non-existent dir fails - [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirName} Get a unique name - ${output} List files in directory using clientSRM ${vo} ${dirName} - Should Contain ${output} SRM_FAILURE - Remove local directory ${dirName} - [Teardown] Clear all credentials - -Check if a clientSRM rm on an existent file works - [Tags] storm-client rm - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${dirName} Get a unique name - ${output} List files in directory using clientSRM ${vo} ${dirName} - Should Contain ${output} SRM_FAILURE - ${output} Create directory using clientSRM ${vo} ${dirName} - Should Contain ${output} SRM_SUCCESS - ${surl} Build surl ${vo} ${dirName}/${filename} - ${output} ${token} Perform ptp using clientSRM ${surl} -p - Should Contain ${output} SRM_SPACE_AVAILABLE - ${output} List files in directory using clientSRM ${vo} ${dirName} - Should Contain ${output} SRM_SUCCESS - ${output} Perform rm using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - Remove not empty directory using clientSRM ${vo} ${dirName} - Remove local file ${fileName} - Remove local directory ${dirName} - [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/discovery/discovery.txt b/tests/srm/discovery/discovery.txt deleted file mode 100644 index 83c2e6f..0000000 --- a/tests/srm/discovery/discovery.txt +++ /dev/null @@ -1,53 +0,0 @@ -*** Settings *** -Resource lib/stormlib.txt -Resource lib/dcache.txt -Resource lib/lcg_util.txt -Resource lib/clientSRM.txt -Resource lib/credentials.txt - -*** Test Cases *** - -Ping using clientSRM - [Tags] ping storm-client - [Setup] Init certificate and voms proxy test0 ${vo} - ${output} Execute clientSRM Command ping - Should contain ${output} SRM server successfully contacted - [Teardown] Clear all credentials - -Ping using the dCache client - [Tags] ping dcache-client - [Setup] Init certificate and voms proxy test0 ${vo} - ${output} Ping using dCache client - Should Contain ${output} StoRM - [Teardown] Clear all credentials - -Ping returns a wrong backend age - [Tags] ping storm-client - [Setup] Init certificate and voms proxy test0 ${vo} - ${output} Execute clientSRM Command ping - ${matched} Should Match Regexp ${output} - Should Not Contain ${matched} age - [Teardown] Clear all credentials - -Verify gtp operation by using the StoRM client - [Tags] gtp storm-client - [Setup] Init certificate and voms proxy test0 ${vo} - ${output} Execute clientSRM Command gtp - Should Contain ${output} transferProtocol="file" - Should Contain ${output} transferProtocol="gsiftp" - Should Contain ${output} transferProtocol="http" - Should Contain ${output} transferProtocol="https" - Should Contain ${output} transferProtocol="rfio" - Should Contain ${output} transferProtocol="root" - [Teardown] Clear all credentials - -Verify asynch request with non-ascii characters - [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/137. Given a StoRM endpoint, verify that an SRM asynchronous call providing a string parameter containing non ASCII characters does not put StoRM Frontend offline. - [Tags] storm-client ping regression - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} catenate Get a unique name èèèè - ${output} Execute clientSRM Command on Surl ls -c 1 ${filename} - Should Not Contain ${output} SRM_SUCCESS - ${output} Execute clientSRM Command ping - Should contain ${output} SRM server successfully contacted - [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/lcg_utils/lcg_utils.txt b/tests/srm/lcg_utils/lcg_utils.txt new file mode 100644 index 0000000..a27ca28 --- /dev/null +++ b/tests/srm/lcg_utils/lcg_utils.txt @@ -0,0 +1,82 @@ +*** Settings *** + +Resource lib/stormlib.txt +Resource lib/lcg_util.txt +Resource lib/clientSRM.txt +Resource lib/setup.txt + +*** Test Cases *** + +List files in an existing directory with lcg-utils + [Tags] lcg-utils ls + [Setup] Use default voms proxy + ${dirname} Get a unique name + ${filename} Create local file + ${surlDir} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${surlFile} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${filename} + ${output} Perform mkdir using clientSRM ${surlDir} + Should Contain ${output} SRM_SUCCESS + Copy-out file using lcg-utils ${filename} ${surlFile} + ${output} List files in directory using lcg_utils ${surlDir} + Should Contain ${output} ${filename} + ${output} Perform rmdir using clientSRM ${surlDir} -r + Should Contain ${output} SRM_SUCCESS + [Teardown] Clear all credentials + +Check if a lcg-ls on an existent surl works + [Tags] lcg-utils ls + [Setup] Use default voms proxy + ${filename} Create local file + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Copy-out file using lcg-utils ${filename} ${surl} + Check file exists using lcg-utils ${surl} + ${output} Perform rm using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + Remove local file ${filename} + [Teardown] Clear all credentials + +Check if a lcg-ls on a non-existent surl fails + [Tags] lcg-utils ls + [Setup] Use default voms proxy + ${filename} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Check file does not exists using lcg-utils ${surl} + [Teardown] Clear all credentials + +Check lcg-cp computed checksum in case it starts with zero + [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/108. Given a file with ADLER32 checksum that starts with '0' and a SURL pointing to a non existent file in an existent folder, verify that after transfering the file on the SURL the checksum value computed for the file matches as string with the one of the local file. + [Tags] lcg-utils regression cp + [Setup] Use default voms proxy + ${srcFileName} Create local file with checksum that starts with zero + ${destFileName} Get a unique name + ${srcSurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${srcFileName} + ${destSurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${destFileName} + Copy-out file using lcg-utils ${srcFileName} ${srcSurl} + ${output} Detailed ls using clientSRM ${srcSurl} + ${result} ${b_checksum}= Should Match Regexp ${output} checkSumValue=(\".+\") + Log ${b_checksum} + Copy file using lcg-utils ${srcSurl} ${destSurl} + ${output} Detailed ls using clientSRM ${destSurl} + ${result} ${a_checksum}= Should Match Regexp ${output} checkSumValue=(\".+\") + Log ${a_checksum} + Should be equal ${b_checksum} ${a_checksum} + [Teardown] Clear all credentials + +Test lcg-cp out + [Tags] lcg-utils cp + [Setup] Use default voms proxy + ${filename} Create local file + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Copy-out file using lcg-utils ${filename} ${surl} + [Teardown] Clear all credentials + +Copy out a file using lcg-utils + [Tags] lcg-utils + [Setup] Use default voms proxy + ${filename} Create local file + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Check file does not exists using lcg-utils ${surl} + Copy-out file using lcg-utils ${filename} ${surl} + Copy-in file using lcg-utils ${surl} ${filename}_copied + Execute and check success diff /tmp/${TESTDIR}/${filename} /tmp/${TESTDIR}/${filename}_copied + [Teardown] Clear all credentials diff --git a/tests/srm/mixedtests.txt b/tests/srm/mixedtests.txt new file mode 100644 index 0000000..5c174a8 --- /dev/null +++ b/tests/srm/mixedtests.txt @@ -0,0 +1,146 @@ +*** Settings *** + +Resource lib/stormlib.txt +Resource lib/clientSRM.txt +Resource lib/lcg_util.txt +Resource lib/globus_util.txt +Resource lib/setup.txt + +*** Keywords *** + +Is SRM_SPACE_AVAILABLE [Arguments] ${surl} ${token} + ${output} Perform sptp using clientSRM ${surl} ${token} + Should Contain ${output} SRM_SPACE_AVAILABLE + +Is SRM_FILE_PINNED [Arguments] ${surl} ${token} + ${output} Perform sptg using clientSRM ${surl} ${token} + Should Contain ${output} SRM_FILE_PINNED + +Create remote directory [Arguments] ${surl} + ${output} Perform mkdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + +Create file with synch ptp and pd [Arguments] ${surl} + ${output} ${token} Perform ptp using clientSRM ${surl} -p + Should Contain ${output} SRM_SPACE_AVAILABLE + ${output} Perform pd using clientSRM ${surl} ${token} + Should Contain ${output} SRM_SUCCESS + +Upload file with lcg utils [Arguments] ${localfilename} ${surl} + Copy-out file using lcg-utils ${localfilename} ${surl} + +Upload file with asynch ptp and globus file transfer [Arguments] ${surl} ${localfilename} ${turl} + ${output} ${token} Perform ptp using clientSRM ${surl} + Should Contain ${output} SRM_REQUEST_QUEUED + Wait Until Keyword Succeeds 1 min 2 sec Is SRM_SPACE_AVAILABLE ${surl} ${token} + Copy-out file using globus-utils ${localfilename} ${turl} + ${output} Perform pd using clientSRM ${surl} ${token} + Should Contain ${output} SRM_SUCCESS + +Get file with synch ptg and globus file transfer [Arguments] ${surl} ${turl} + ${output} ${token} Perform ptg using clientSRM ${surl} -p + Should Contain ${output} SRM_FILE_PINNED + ${localfilename} Get a unique name + Copy-in file using globus-utils ${turl} ${localfilename} + ${output} Perform rf using clientSRM ${surl} ${token} + Should Contain ${output} SRM_SUCCESS + +Get file with asynch ptg and globus file transfer [Arguments] ${surl} ${turl} + ${output} ${token} Perform ptg using clientSRM ${surl} + Should Contain ${output} SRM_REQUEST_QUEUED + Wait Until Keyword Succeeds 1 min 2 sec Is SRM_FILE_PINNED ${surl} ${token} + ${localfilename} Get a unique name + Copy-in file using globus-utils ${turl} ${localfilename} + ${output} Perform rf using clientSRM ${surl} ${token} + Should Contain ${output} SRM_SUCCESS + +Do a synch ptg on file [Arguments] ${surl} + ${output} ${token} Perform ptg using clientSRM ${surl} -p + Should Contain ${output} SRM_FILE_PINNED + [Return] ${token} + +Abort request [Arguments] ${token} + ${output} Perform abort request using clientSRM ${token} + Should Contain ${output} SRM_SUCCESS + +Release file [Arguments] ${surl} ${token} + ${output} Perform rf using clientSRM ${surl} ${token} + Should Contain ${output} SRM_SUCCESS + +Copy file [Arguments] ${srcsurl} ${destsurl} + Copy file using lcg-utils ${srcSurl} ${destSurl} + +Move file [Arguments] ${srcsurl} ${destsurl} + ${output} Perform mv using clientSRM ${srcsurl} ${destsurl} + Should Contain ${output} SRM_SUCCESS + +List Directory [Arguments] ${surl} + ${output} Perform ls using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + [Return] ${output} + +Remove file [Arguments] ${surl} + ${output} Perform rm using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + +Mixed tests [Arguments] ${storageArea} ${storageAreaRealRoot} + ${dirname} Get a unique name + ${filename} Create local file + ${surlDir} Build surl ${storageArea} ${TESTDIR}/${dirname} + ${surlFile1} Build surl ${storageArea} ${TESTDIR}/${dirname}/${filename}_1 + ${surlFile2} Build surl ${storageArea} ${TESTDIR}/${dirname}/${filename}_2 + ${surlFile3} Build surl ${storageArea} ${TESTDIR}/${dirname}/${filename}_3 + ${surlFile4} Build surl ${storageArea} ${TESTDIR}/${dirname}/${filename}_4 + ${surlFile5} Build surl ${storageArea} ${TESTDIR}/${dirname}/${filename}_5 + ${turlFile3} Build gsiftp TURL ${storageAreaRealRoot} ${TESTDIR}/${dirname}/${filename}_3 + Create remote directory ${surlDir} + Create file with synch ptp and pd ${surlFile1} + Upload file with lcg utils ${filename} ${surlFile2} + Upload file with asynch ptp and globus file transfer ${surlFile3} ${filename} ${turlFile3} + Get file with synch ptg and globus file transfer ${surlFile3} ${turlFile3} + Get file with asynch ptg and globus file transfer ${surlFile3} ${turlFile3} + ${token1} Do a synch ptg on file ${surlFile1} + ${token2} Do a synch ptg on file ${surlFile2} ${surlFile3} + Abort request ${token1} + Release file ${surlFile2} ${surlFile3} ${token2} + Copy file ${surlFile3} ${surlFile4} + Move file ${surlFile4} ${surlFile5} + ${output} List Directory ${surlDir} + Should Contain ${output} /${storageArea}/${TESTDIR}/${dirname}/${filename}_1 + Should Contain ${output} /${storageArea}/${TESTDIR}/${dirname}/${filename}_2 + Should Contain ${output} /${storageArea}/${TESTDIR}/${dirname}/${filename}_3 + Should Contain ${output} /${storageArea}/${TESTDIR}/${dirname}/${filename}_5 + Remove File ${surlFile5} + Remove File ${surlFile3} ${surlFile2} + ${output} Perform rmdir using clientSRM ${surlDir} + Should Not Contain ${output} SRM_SUCCESS + ${output} Perform rmdir using clientSRM ${surlDir} -r + Should Contain ${output} SRM_SUCCESS + Remove local file ${filename} + +*** Test Cases *** + +Mixed tests on DEFAULT SA + [Setup] Use default voms proxy + Mixed tests ${DEFAULT_SA} ${DEFAULT_SA} + [Teardown] Clear all credentials + +Mixed tests on igi SA + [Setup] Use default voms proxy + Mixed tests ${SA.7} ${SA.7} + [Teardown] Clear all credentials + +Mixed tests on noauth SA + [Setup] Use default voms proxy + Mixed tests ${SA.9} ${SA.9} + [Teardown] Clear all credentials + +Mixed tests on NESTED SA + [Setup] Use voms proxy ${DEFAULT_USER} ${VO.2} + Mixed tests ${SA.4} nested + [Teardown] Clear all credentials + +Mixed tests on ALIASED SA + [Setup] Use voms proxy ${DEFAULT_USER} ${VO.2} + Mixed tests ${SA.5} nested + [Teardown] Clear all credentials diff --git a/tests/srm/space_management/space_management.txt b/tests/srm/space_management/space_management.txt index 0d75e19..9b29f67 100644 --- a/tests/srm/space_management/space_management.txt +++ b/tests/srm/space_management/space_management.txt @@ -1,24 +1,27 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/lcg_util.txt Resource lib/clientSRM.txt -Resource lib/credentials.txt +Resource lib/setup.txt *** Test Cases *** Space token used space is update [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/109. Given a Space Token ST and a SURL that resides on ST pointing to a not existent file, verify that inspecting the unused space of the ST before and after a non-empty file has been stored on the SURL, the ST used space value is updated accordingly to the size of the new file. [Tags] storm-client lcg-utils gst regression - [Setup] Init certificate and voms proxy test0 ${vo} - ${size_before} Get unused size using clientSRM ${storageAreaToken} + [Setup] Use default voms proxy + ${token} Get SA Token + Log ${token} + ${size_before} Get unused size using clientSRM ${token} Log ${size_before} ${filename} Create local file - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} Copy-out file using lcg-utils ${filename} ${surl} - ${size_after} Get unused size using clientSRM ${storageAreaToken} + ${size_after} Get unused size using clientSRM ${token} Log ${size_after} ${diff_size} Run echo `expr ${size_before} - ${size_after}` - ${file_size} Run ls -l /tmp/${filename} | awk {'print $5'} + ${file_size} Run ls -l /tmp/${TESTDIR}/${filename} | awk {'print $5'} Should be equal ${file_size} ${diff_size} Remove local file ${filename} [Teardown] Clear all credentials @@ -26,7 +29,7 @@ Space token used space is update Check a srmGetSpaceMetadata call succedes when a valid Space Token not associated to a Storage Area is given [Tags] storm-client gsm regression [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/277 Storm failed with "SRM_INTERNAL_ERROR" and "Storage Space not initialized yet" as explaination. It must succede since it does not needs to be initialized. - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${token} Reserve space using clientSRM ${output} Get space metadata using clientSRM ${token} Should Contain ${output} SRM_SUCCESS @@ -37,8 +40,10 @@ Check a srmGetSpaceMetadata call succedes when a valid Space Token not associate Check a GetSpaceMetadata succedes when using a proxy without voms extensions [Tags] storm-client gsm regression [Documentation] Regression test for https://storm.cnaf.infn.it:8443/redmine/issues/189 - [Setup] Init certificate and voms proxy test0 ${vo} - ${token} Get space token using clientSRM - ${output} Get space metadata using clientSRM ${token} + [Setup] Use default voms proxy + ${token} Get SA Token + Log ${token} + ${spacetoken} Get space token using clientSRM ${token} + ${output} Get space metadata using clientSRM ${spacetoken} Should Contain ${output} SRM_SUCCESS [Teardown] Clear all credentials \ No newline at end of file diff --git a/tests/srm/space_management/used_space_info.txt b/tests/srm/space_management/used_space_info.txt new file mode 100644 index 0000000..40ac4da --- /dev/null +++ b/tests/srm/space_management/used_space_info.txt @@ -0,0 +1,153 @@ +*** Settings *** + +Library HttpLibrary.HTTP +Library Collections +Resource lib/setup.txt +Resource lib/stormlib.txt +Resource lib/lcg_util.txt +Resource lib/clientSRM.txt + +*** Variables *** + +${REST_ENDPOINT} ${backEndHost}:9998 +${DIR_SIZE} 4096 + +*** Test Cases *** + +Check db size update after srmPutDone + [Tags] info + [Setup] Use default voms proxy + ${filename} Create local file + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Check file does not exists using lcg-utils ${surl} + ${token} Get SA Token + ${free_space_before} Get SA status info parameter ${token} free-space + Copy-out file using lcg-utils ${filename} ${surl} + ${free_space_after} Get SA status info parameter ${token} free-space + Should not be equal ${free_space_before} ${free_space_after} + ${output} Perform rm using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + ${free_space} Get SA status info parameter ${token} free-space + Should be equal ${free_space_before} ${free_space} + Remove local file ${filename} + [Teardown] Clear all credentials + +Check db size update after srmRm + [Tags] info + [Setup] Use default voms proxy + ${filename} Create local file + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} + Check file does not exists using lcg-utils ${surl} + ${token} Get SA Token + ${free_space} Get SA status info parameter ${token} free-space + Copy-out file using lcg-utils ${filename} ${surl} + ${free_space_before} Get SA status info parameter ${token} free-space + ${output} Perform rm using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + ${free_space_after} Get SA status info parameter ${token} free-space + Should not be equal ${free_space_before} ${free_space_after} + Remove local file ${filename} + [Teardown] Clear all credentials + +Check db size update after srmMkdir + [Tags] info + [Setup] Use default voms proxy + ${dirname} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${token} Get SA Token + ${free_space_1} Get SA status info parameter ${token} free-space + ${output} Perform mkdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + ${free_space_2} Get SA status info parameter ${token} free-space + Should not be equal ${free_space_1} ${free_space_2} + ${diff} Diff ${free_space_1} ${free_space_2} + Should be equal as numbers ${diff} ${DIR_SIZE} + ${output} Perform rmdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + ${free_space_3} Get SA status info parameter ${token} free-space + Should be equal as numbers ${free_space_3} ${free_space_1} + [Teardown] Clear all credentials + +Check db size update after a recursive srmRmdir + [Tags] info + [Setup] Use default voms proxy + ${dirname} Get a unique name + ${dsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${token} Get SA Token + ${free_space_1} Get SA status info parameter ${token} free-space + ${output} Perform mkdir using clientSRM ${dsurl} + Should Contain ${output} SRM_SUCCESS + ${free_space_2} Get SA status info parameter ${token} free-space + ${filename} Create local file + ${fsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname}/${filename} + Check file does not exists using lcg-utils ${fsurl} + Copy-out file using lcg-utils ${filename} ${fsurl} + Check file exists using lcg-utils ${fsurl} + ${free_space_3} Get SA status info parameter ${token} free-space + ${output} Perform rmdir using clientSRM ${dsurl} -r + ${free_space_4} Get SA status info parameter ${token} free-space + Should not be equal ${free_space_1} ${free_space_2} + Should not be equal ${free_space_2} ${free_space_3} + Should not be equal ${free_space_3} ${free_space_4} + Should be equal as numbers ${free_space_1} ${free_space_4} + ${diff} Diff ${free_space_2} ${free_space_3} + Should be equal as numbers ${diff} 1048576 + Remove local file ${filename} + [Teardown] Clear all credentials + +Check db size update after srmRmdir of an empty directory + [Tags] info + [Setup] Use default voms proxy + ${dirname} Get a unique name + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${dirname} + ${token} Get SA Token + ${free_space_1} Get SA status info parameter ${token} free-space + ${output} Perform mkdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + ${free_space_2} Get SA status info parameter ${token} free-space + ${output} Perform rmdir using clientSRM ${surl} + Should Contain ${output} SRM_SUCCESS + ${free_space_3} Get SA status info parameter ${token} free-space + Should not be equal ${free_space_1} ${free_space_2} + Should be equal as numbers ${free_space_3} ${free_space_1} + ${diff} Diff ${free_space_3} ${free_space_2} + Should be equal as numbers ${diff} ${DIR_SIZE} + [Teardown] Clear all credentials + +*** Keywords *** + +Get From REST endpoint [Arguments] ${url} + Create Http Context ${REST_ENDPOINT} + GET ${url} + ${status}= Get Response Status + Should Start With ${status} 200 + ${result}= Get Response Body + Log Json ${result} + ${result}= Parse Json ${result} + Log ${result} + [Return] ${result} + +Get VFS list + ${url} Set Variable /configuration/1.3/VirtualFSList + ${result} Get From REST endpoint ${url} + [Return] ${result} + +Get SA status info [Arguments] ${SA} + ${url} Set Variable /info/status/${SA} + ${result} Get From REST endpoint ${url} + [Return] ${result} + +Get SA status info parameter [Arguments] ${SA_TOKEN} ${PARAM_NAME} + ${SA_STATUS} Get SA status info ${SA_TOKEN} + ${SA_STATUS} Get From Dictionary ${SA_STATUS} sa-status + ${PARAM_VALUE} Get From Dictionary ${SA_STATUS} ${PARAM_NAME} + Log ${PARAM_VALUE} + [Return] ${PARAM_VALUE} + +Sum [Arguments] ${e1} ${e2} + ${result}= Evaluate ${e1} + ${e2} + [Return] ${result} + +Diff [Arguments] ${e1} ${e2} + ${result}= Evaluate ${e1} - ${e2} + [Return] ${result} \ No newline at end of file diff --git a/tests/srm/tests.txt b/tests/srm/tests.txt index c7eef27..0a0e18f 100644 --- a/tests/srm/tests.txt +++ b/tests/srm/tests.txt @@ -1,35 +1,27 @@ *** Settings *** Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/dcache.txt Resource lib/lcg_util.txt -Resource lib/credentials.txt +Resource lib/setup.txt *** Test Cases *** Check if StoRM publishes correctly values for used and free space on the BDII [Tags] regression - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Create local file - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} Check file does not exists using lcg-utils ${surl} Copy-out file using lcg-utils ${filename} ${surl} - ${size_before} Get unused size using clientSRM ${storageAreaToken} + ${saToken} Get SA Token + ${size_before} Get unused size using clientSRM ${saToken} Log ${size_before} Check file exists using lcg-utils ${surl} Perform rm using clientSRM ${surl} Check file does not exists using lcg-utils ${surl} - ${size_after} Get unused size using clientSRM ${storageAreaToken} + ${size_after} Get unused size using clientSRM ${saToken} Log ${size_after} ${diff_size} Run echo `expr ${size_after} - ${size_before}` - ${file_size} Run ls -l /tmp/${filename} | awk {'print $5'} + ${file_size} Run ls -l /tmp/${TESTDIR}/${filename} | awk {'print $5'} Should be equal ${file_size} ${diff_size} - Remove local file ${filename} - [Teardown] Clear all credentials - -Status of bring online using a non existent token - [Tags] regression sbol - [Documentation] Regression test for https://issues.infn.it/browse/STOR-217. StoRM crashed when a status for an async request was requested but the service is not able to get the into out of the database (for example, the token does not exists). This test calls a status for bring online. - [Setup] Init certificate and voms proxy test0 ${vo} - ${output} Execute clientSRM Command bol -t abcde [Teardown] Clear all credentials diff --git a/tests/srm/validation.txt b/tests/srm/validation.txt index e46ebb9..d3f232d 100644 --- a/tests/srm/validation.txt +++ b/tests/srm/validation.txt @@ -1,16 +1,16 @@ *** Settings *** + Resource lib/stormlib.txt Resource lib/clientSRM.txt -Resource lib/dcache.txt Resource lib/lcg_util.txt -Resource lib/credentials.txt Resource lib/recall.txt +Resource lib/setup.txt *** Test Cases *** Check a get space metadata request fails when a wrong token format is provided [Tags] regression gsm - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${output} Get space metadata using clientSRM "ciccio' OR SLEEP(1)-- " Log ${output} Should Contain ${output} SRM_INVALID_REQUEST @@ -19,7 +19,7 @@ Check a get space metadata request fails when a wrong token format is provided Check a get request summary fails when a wrong token format is provided [Tags] regression grs - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${output} Get request summary using clientSRM "ciccio' OR 1=1) AND SLEEP(1)-- " Log ${output} Should Contain ${output} SRM_INVALID_REQUEST @@ -28,7 +28,7 @@ Check a get request summary fails when a wrong token format is provided Check a reserve space request fails when a wrong token format is provided [Tags] regression rsp - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${output} Reserve space using clientSRM with token "ciccio' or SLEEP(1)-- " Log ${output} Should Contain ${output} SRM_INVALID_REQUEST @@ -37,7 +37,7 @@ Check a reserve space request fails when a wrong token format is provided Check a release space request fails when a wrong token format is provided [Tags] regression rs - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${output} Release space using clientSRM "ciccio' or SLEEP(1)-- " Log ${output} Should Contain ${output} SRM_INVALID_REQUEST @@ -46,7 +46,7 @@ Check a release space request fails when a wrong token format is provided Check a get space tokens request fails when a wrong token format is provided [Tags] regression gst - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${output} Get space token output using clientSRM "ciccio' OR SLEEP(1)-- " Log ${output} Should Contain ${output} SRM_INVALID_REQUEST @@ -55,7 +55,7 @@ Check a get space tokens request fails when a wrong token format is provided Check a get request tokens fails with an invalid user request description [Tags] regression grt - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${output} Get request tokens using clientSRM "ciccio' OR SLEEP(1)-- " Log ${output} Should Contain ${output} SRM_INVALID_REQUEST @@ -64,37 +64,35 @@ Check a get request tokens fails with an invalid user request description Check a ptp fails when a malformed surl is supplied [Tags] storm-client ptp regression - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} "${filename} ciccio') OR SLEEP(1)-- " + ${surl} Build surl ${DEFAULT_SA} "${TESTDIR}/${filename} ciccio') OR SLEEP(1)-- " ${output} Execute clientSRM Command on Surl ptp ${surl} ${EMPTY} Log ${output} Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid surl - Remove local file ${filename} [Teardown] Clear all credentials Check a sptp fails when a malformed token is supplied [Tags] storm-client sptp regression - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/{filename} ${output} ${token} Perform ptp using clientSRM ${surl} ${output} Perform sptp using clientSRM ${surl} "ciccio' OR SLEEP(1)-- " Log ${output} Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid token - Remove local file ${filename} [Teardown] Clear all credentials Check a ptg fails when a malformed surl is supplied [Tags] storm-client ptg regression - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p ${output} Perform pd using clientSRM ${surl} ${token} - ${surl} Build surl ${vo} "${filename} ciccio') OR SLEEP(1)-- " + ${surl} Build surl ${DEFAULT_SA} "${TESTDIR}/${filename} ciccio') OR SLEEP(1)-- " ${output} Execute clientSRM Command on Surl ptg ${surl} ${EMPTY} Log ${output} Should Contain ${output} SRM_INVALID_REQUEST @@ -104,9 +102,9 @@ Check a ptg fails when a malformed surl is supplied Check a sptg fails when a malformed token is supplied [Tags] storm-client sptg regression - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p ${output} Perform pd using clientSRM ${surl} ${token} ${output} ${token} Perform ptg using clientSRM ${surl} @@ -114,141 +112,130 @@ Check a sptg fails when a malformed token is supplied Log ${output} Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid token - Remove local file ${filename} [Teardown] Clear all credentials Check a pd fails when a malformed token is supplied [Tags] storm-client pd - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p Should Contain ${output} SRM_SPACE_AVAILABLE ${output} Perform pd using clientSRM ${surl} "ciccio' OR SLEEP(1)-- " Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid token - Remove local file ${filename} [Teardown] Clear all credentials Check a pd fails when a malformed surl is supplied [Tags] storm-client pd - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p Should Contain ${output} SRM_SPACE_AVAILABLE - ${surl} Build surl ${vo} "${filename} ciccio') OR SLEEP(1)-- " + ${surl} Build surl ${DEFAULT_SA} "${filename} ciccio') OR SLEEP(1)-- " ${output} Perform pd using clientSRM ${surl} ${token} Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid surl - Remove local file ${filename} [Teardown] Clear all credentials Check an abort request fails when a malformed token is supplied [Tags] storm-client abort - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p ${output} Perform abort request using clientSRM "${token}' or SLEEP(1)-- " Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid token - Remove local file ${filename} [Teardown] Clear all credentials Check an abort file fails when a malformed token is supplied [Tags] storm-client abort - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p ${output} Perform abort file using clientSRM ${surl} "${token}' or SLEEP(1)-- " Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid token - Remove local file ${filename} [Teardown] Clear all credentials Check an ls request fails when a malformed surl is supplied [Tags] storm-client ls - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} "${filename} ciccio') OR SLEEP(1)-- " + ${surl} Build surl ${DEFAULT_SA} "${TESTDIR}/${filename} ciccio') OR SLEEP(1)-- " ${output} Perform ls using clientSRM ${surl} Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid surl - Remove local file ${filename} [Teardown] Clear all credentials Check a mkdir request fails when a malformed surl is supplied [Tags] storm-client mkdir - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} "${filename} ciccio') OR SLEEP(1)-- " + ${surl} Build surl ${DEFAULT_SA} "${TESTDIR}/${filename} ciccio') OR SLEEP(1)-- " ${output} Perform mkdir using clientSRM ${surl} Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid surl - Remove local file ${filename} [Teardown] Clear all credentials Check a rmdir request fails when a malformed surl is supplied [Tags] storm-client rmdir - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} Perform mkdir using clientSRM ${surl} - ${surl} Build surl ${vo} "${filename} ciccio') OR SLEEP(1)-- " + ${surl} Build surl ${DEFAULT_SA} "${TESTDIR}/${filename} ciccio') OR SLEEP(1)-- " ${output} Perform rmdir using clientSRM ${surl} Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid surl - Remove local file ${filename} [Teardown] Clear all credentials Check a rf request fails when a malformed token is supplied [Tags] storm-client mkdir - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p ${output} Perform pd using clientSRM ${surl} ${token} -p ${output} ${token} Perform ptg using clientSRM ${surl} -p ${output} Perform rf using clientSRM ${surl} "${token}' and sleep(1)-- " Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid token - Remove local file ${filename} [Teardown] Clear all credentials Check a rm request fails when a malformed surl is supplied [Tags] storm-client rm - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${surl} Build surl ${vo} ${filename} + ${surl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${surl} -p ${output} Perform pd using clientSRM ${surl} ${token} -p - ${surl} Build surl ${vo} "${filename} ciccio' or sleep(1)-- " + ${surl} Build surl ${DEFAULT_SA} "${TESTDIR}/${filename} ciccio' or sleep(1)-- " ${output} Perform rm using clientSRM ${surl} Log ${output} Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid surl - Remove local file ${filename} [Teardown] Clear all credentials Check a mv request fails when a malformed surl is supplied [Tags] storm-client mv - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${filename} Get a unique name - ${srcsurl} Build surl ${vo} ${filename} + ${srcsurl} Build surl ${DEFAULT_SA} ${TESTDIR}/${filename} ${output} ${token} Perform ptp using clientSRM ${srcsurl} -p ${output} Perform pd using clientSRM ${srcsurl} ${token} -p - ${destsurl} Build surl ${vo} "${filename}' or sleep(1)-- " + ${destsurl} Build surl ${DEFAULT_SA} "${TESTDIR}/${filename}' or sleep(1)-- " ${output} Perform mv using clientSRM ${srcsurl} ${destsurl} -p Should Contain ${output} SRM_INVALID_REQUEST Should Contain ${output} invalid surl - Remove local file ${filename} [Teardown] Clear all credentials Check a malformed token format does not work when pushed to the FE [Tags] storm-client regression - [Setup] Init certificate and voms proxy test0 ${vo} + [Setup] Use default voms proxy ${output} Get request summary using clientSRM "ciccio' OR 1=1) AND SLEEP(1) " Log ${output} Should Contain ${output} SRM_INVALID_REQUEST @@ -257,33 +244,36 @@ Check a malformed token format does not work when pushed to the FE Check failure when trying to get a completed task to recall using an malformed filename [Tags] regression recall + [Setup] Clear all credentials ${filename} Get a unique name ${output} Check for a completed recall task "fakeToken or 1=1-- " ${filename}%20or%201=1-- Log ${output} - Remove local file ${filename} Should Contain ${output} 400 Bad Request Check failure when trying to get a completed task to recall using an non-existent filename [Tags] regression recall + [Setup] Clear all credentials ${filename} Get a unique name ${output} Check for a completed recall task "fakeToken or 1=1-- " ${filename} Log ${output} - Remove local file ${filename} - Should Contain ${output} 400 Bad Request + Should Contain ${output} 400 Bad Request Check failure when getting the number of recall requests in progress using wrong input [Tags] regression recall + [Setup] Clear all credentials ${output} Get recall requests in progress "1%20or%201=1-- " Log ${output} Should Not Contain ${output} 200 OK Check failure when getting and update recall requests ready for being taken over using wrong input [Tags] regression recall + [Setup] Clear all credentials ${output} Get and update to progress recall tasks ready for being taken over "1%20or%201=1-- " Log ${output} Should Not Contain ${output} 200 OK Check failure when updating a recall task using the group task with wrong input [Tags] regression recall + [Setup] Clear all credentials ${output} Update a recall task status using a groupTaskId "ciccio or 1=1-- " "1%20or%201=1-- " Should Not Contain ${output} 200 OK diff --git a/tests/webdav/__init__.txt b/tests/webdav/__init__.txt new file mode 100644 index 0000000..5faeca7 --- /dev/null +++ b/tests/webdav/__init__.txt @@ -0,0 +1,6 @@ +*** Settings *** + +Resource lib/setup.txt + +Suite Setup Setup suite webdav +Suite Teardown Teardown suite webdav diff --git a/tests/webdav/copy.txt b/tests/webdav/copy.txt index 101a664..16095a6 100644 --- a/tests/webdav/copy.txt +++ b/tests/webdav/copy.txt @@ -1,464 +1,83 @@ *** Settings *** -Resource lib/stormlib.txt -Resource lib/clientSRM.txt -Resource lib/lcg_util.txt -Resource lib/credentials.txt -*** Test Cases *** - -WebDAV COPY file as anonymous - [Tags] webdav copy anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${anonymousRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcFileName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV COPY file with voms proxy credentials - [Tags] webdav copy vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${vomsproxyRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${vomsproxyRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${vomsproxyRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV COPY file with plain proxy credentials - [Tags] webdav copy plainproxy - [Setup] Init certificate and plain proxy test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${gridproxyRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${gridproxyRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${gridproxyRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV COPY file with personal certificate - [Tags] webdav copy perscert - [Setup] Init certificate with unencrypted key test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${personalcertRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${personalcertRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${personalcertRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV COPY full directory as anonymous - [Tags] webdav copy anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${anonymousRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${anonymousRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcDirName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - Remove not empty directory using clientSRM ${anonymousRWStorageArea} ${srcDirName} - Remove not empty directory using clientSRM ${anonymousRWStorageArea} ${destDirName} - Remove local file ${fileName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - [Teardown] Clear all credentials - -WebDAV COPY full directory with voms proxy credentials - [Tags] webdav copy vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${vomsproxyRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${vomsproxyRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${srcDirName} - ${destUrl} Build webdav secure URL ${vomsproxyRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Remove not empty directory using clientSRM ${vomsproxyRWStorageArea} ${srcDirName} - Remove not empty directory using clientSRM ${vomsproxyRWStorageArea} ${destDirName} - Remove local file ${fileName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - [Teardown] Clear all credentials - -WebDAV COPY full directory with plain proxy credentials - [Tags] webdav copy plainproxy - [Setup] Init certificate and plain proxy test0 - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${gridproxyRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${gridproxyRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${srcDirName} - ${destUrl} Build webdav secure URL ${gridproxyRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Remove not empty directory using clientSRM ${gridproxyRWStorageArea} ${srcDirName} - Remove not empty directory using clientSRM ${gridproxyRWStorageArea} ${destDirName} - Remove local file ${fileName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - [Teardown] Clear all credentials - -WebDAV COPY full directory with personal certificate - [Tags] webdav copy perscert - [Setup] Init certificate with unencrypted key test0 - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${personalcertRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${personalcertRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${srcDirName} - ${destUrl} Build webdav secure URL ${personalcertRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - Remove not empty directory using clientSRM ${personalcertRWStorageArea} ${srcDirName} - Remove not empty directory using clientSRM ${personalcertRWStorageArea} ${destDirName} - Remove local file ${fileName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - [Teardown] Clear all credentials - -WebDAV COPY overwrite file as anonymous - [Tags] webdav copy anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${anonymousRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcFileName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 204 No Content - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV COPY overwrite file with voms proxy credentials - [Tags] webdav copy vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${vomsproxyRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${vomsproxyRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${srcFileName} - ${destUrl} Build webdav unsecure URL ${vomsproxyRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV COPY overwrite file with plain proxy credentials - [Tags] webdav copy plainproxy - [Setup] Init certificate and plain proxy test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${gridproxyRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${gridproxyRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${gridproxyRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV COPY overwrite file with personal certificate - [Tags] webdav copy perscert - [Setup] Init certificate with unencrypted key test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${personalcertRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${personalcertRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${personalcertRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 204 No Content - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV COPY overwrite full directory as anonymous - [Tags] webdav copy anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${anonymousRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${anonymousRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcDirName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 204 No Content - Remove not empty directory using clientSRM ${anonymousRWStorageArea} ${srcDirName} - Remove not empty directory using clientSRM ${anonymousRWStorageArea} ${destDirName} - Remove local file ${fileName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - [Teardown] Clear all credentials - -WebDAV COPY overwrite full directory with voms proxy credentials - [Tags] webdav copy vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${vomsproxyRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${vomsproxyRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${srcDirName} - ${destUrl} Build webdav unsecure URL ${vomsproxyRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove not empty directory using clientSRM ${vomsproxyRWStorageArea} ${srcDirName} - Remove not empty directory using clientSRM ${vomsproxyRWStorageArea} ${destDirName} - Remove local file ${fileName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - [Teardown] Clear all credentials - -WebDAV COPY overwrite full directory with plain proxy credentials - [Tags] webdav copy plainproxy - [Setup] Init certificate and plain proxy test0 - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${gridproxyRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${gridproxyRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${srcDirName} - ${destUrl} Build webdav secure URL ${gridproxyRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove not empty directory using clientSRM ${gridproxyRWStorageArea} ${srcDirName} - Remove not empty directory using clientSRM ${gridproxyRWStorageArea} ${destDirName} - Remove local file ${fileName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - [Teardown] Clear all credentials - -WEBDAV COPY overwrite full directory over HTTPS with a personal certificate - [Tags] webdav copy perscert - [Setup] Init certificate with unencrypted key test0 - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${personalcertRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${personalcertRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${srcDirName} - ${destUrl} Build webdav secure URL ${personalcertRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove not empty directory using clientSRM ${personalcertRWStorageArea} ${srcDirName} - Remove not empty directory using clientSRM ${personalcertRWStorageArea} ${destDirName} - Remove local file ${fileName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - [Teardown] Clear all credentials - -WEBDAV COPY to a different storage area over HTTP - [Tags] webdav copy anonymous - [Setup] Init certificate with unencrypted key test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousBisRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${anonymousRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousBisRWStorageArea} ${srcFileName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WEBDAV COPY to a different storage area over HTTPS with personal certificate - [Tags] webdav copy perscert - [Setup] Init certificate with unencrypted key test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${personalcertRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${personalcertBisRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${personalcertBisRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV COPY with source URL equals to destination URL as anonymous - [Tags] webdav copy anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousRWStorageArea} ${srcFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${url}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 403 The source and destination URIs are the same! - Perform rm using clientSRM ${srcSurl} - Remove local file ${srcFileName} - [Teardown] Clear all credentials - -WebDAV COPY file with overwrite false on existent destination as anonymous - [Tags] webdav copy anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${anonymousRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcFileName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' --header 'Overwrite: F' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 412 Precondition Failed - Perform rm using clientSRM ${srcSurl} - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV COPY file to a destination with unexistent intermediate parent as anonymous - [Tags] webdav copy anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destDirName} Get a unique name - ${destDirSurl} Build surl ${anonymousRWStorageArea} ${destDirName} - ${output} Perform ls using clientSRM ${destDirSurl} -c 1 - Should Contain ${output} SRM_INVALID_PATH - ${destSurl} Build surl ${anonymousRWStorageArea} ${destDirName}/${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcFileName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destDirName}/${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 409 Conflict - Perform rm using clientSRM ${srcSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - Remove local directory ${destDirName} - [Teardown] Clear all credentials \ No newline at end of file +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt + +*** Test cases *** + +WebDAV COPY file + [Tags] webdav copy + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + Do CURL COPY and check success ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + Do CURL HEAD and check success ${dstURL} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV COPY non empty directory + [Tags] webdav copy + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}_2 + Do CURL COPY and check success ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + Do CURL HEAD and check success ${dstURL} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV COPY file overwrite + [Tags] webdav copy + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + Do CURL COPY and check success ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + ${overwriteHeader} Get CURL header Overwrite T + Do CURL COPY and check overwrite success ${srcURL} ${dstURL} ${overwriteHeader} ${TEST_CURL_OPTIONS} + Do CURL HEAD and check success ${dstURL} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV COPY file not allowed overwrite + [Tags] webdav copy + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + Do CURL COPY and check success ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + ${overwriteHeader} Get CURL header Overwrite F + ${stdout} ${stderr} Do CURL COPY ${srcURL} ${dstURL} ${overwriteHeader} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 412 Precondition Failed + [Teardown] Teardown default SA + +WebDAV COPY not existent file + [Tags] webdav copy no-gridhttps + [Setup] Setup default SA + Create empty working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + ${stdout} ${stderr} Do CURL COPY ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 404 Not Found + [Teardown] Teardown default SA + +WebDAV COPY with destination equals to source + [Tags] webdav copy + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${overwriteHeader} Get CURL header Overwrite T + ${stdout} ${stderr} Do CURL COPY ${srcURL} ${dstURL} ${overwriteHeader} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV COPY unauthorized + [Tags] webdav copy + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + ${TEST_CURL_OPTIONS} Get CURL VOMS proxy options ${DEFAULT_USER} ${VO.2} + ${stdout} ${stderr} Do CURL COPY ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA diff --git a/tests/webdav/delete.txt b/tests/webdav/delete.txt index 88bcc6b..05736c2 100644 --- a/tests/webdav/delete.txt +++ b/tests/webdav/delete.txt @@ -1,200 +1,31 @@ *** Settings *** -Resource lib/stormlib.txt -Resource lib/clientSRM.txt -Resource lib/credentials.txt -*** Test Cases *** - -WebDAV DELETE file as anonymous - [Tags] webdav rm - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - Put without really putting using clientSRM ${anonymousRWStorageArea} ${filename} - ${options} Set variable --verbose -X DELETE - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${filename} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV DELETE file with voms proxy credentials - [Tags] webdav rm - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - Put without really putting using clientSRM ${vomsproxyRWStorageArea} ${filename} - ${options} Set variable --verbose -X DELETE - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV DELETE file with plain proxy credentials - [Tags] webdav rm - [Setup] Init certificate and plain proxy test0 - ${filename} Get a unique name - Put without really putting using clientSRM ${gridproxyRWStorageArea} ${filename} - ${options} Set variable --verbose -X DELETE - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV DELETE file with personal certificate - [Tags] webdav rm - [Setup] Init certificate with unencrypted key test0 - ${filename} Get a unique name - Put without really putting using clientSRM ${personalcertRWStorageArea} ${filename} - ${options} Set variable --verbose -X DELETE - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${filename} - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV DELETE empty directory as anonymous - [Tags] webdav rmdir - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${anonymousRWStorageArea} ${dirName} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${options} Set variable --verbose -X DELETE - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${dirName} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local directory ${dirname} - [Teardown] Clear all credentials - -WebDAV DELETE empty directory with voms proxy credentials - [Tags] webdav rmdir - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${vomsproxyRWStorageArea} ${dirName} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${options} Set variable --verbose -X DELETE - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${dirName} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local directory ${dirname} - [Teardown] Clear all credentials +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt -WebDAV DELETE empty directory with plain proxy credentials - [Tags] webdav rmdir - [Setup] Init certificate and plain proxy test0 - ${dirname} Get a unique name - ${surl} Build surl ${gridproxyRWStorageArea} ${dirName} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${options} Set variable --verbose -X DELETE - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${dirName} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local directory ${dirname} - [Teardown] Clear all credentials - -WebDAV DELETE empty directory with personal certificate - [Tags] webdav rmdir - [Setup] Init certificate with unencrypted key test0 - ${dirname} Get a unique name - ${surl} Build surl ${personalcertRWStorageArea} ${dirName} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${options} Set variable --verbose -X DELETE - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${dirName} - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local directory ${dirname} - [Teardown] Clear all credentials - -WebDAV DELETE full directory as anonymous - [Tags] webdav rmdir - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${anonymousRWStorageArea} ${dirName} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Get a unique name - Put without really putting using clientSRM ${anonymousRWStorageArea} ${dirName}/${filename} - ${options} Set variable --verbose -X DELETE - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${dirName} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV DELETE full directory with voms proxy credentials - [Tags] webdav rmdir - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${vomsproxyRWStorageArea} ${dirName} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Get a unique name - Put without really putting using clientSRM ${vomsproxyRWStorageArea} ${dirName}/${filename} - ${options} Set variable --verbose -X DELETE - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${dirName} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV DELETE full directory with plain proxy credentials - [Tags] webdav rmdir - [Setup] Init certificate and plain proxy test0 - ${dirname} Get a unique name - ${surl} Build surl ${gridproxyRWStorageArea} ${dirName} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Get a unique name - Put without really putting using clientSRM ${gridproxyRWStorageArea} ${dirName}/${filename} - ${options} Set variable --verbose -X DELETE - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${dirName} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV DELETE full directory with personal certificate - [Tags] webdav rmdir - [Setup] Init certificate with unencrypted key test0 - ${dirname} Get a unique name - ${surl} Build surl ${personalcertRWStorageArea} ${dirName} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Get a unique name - Put without really putting using clientSRM ${personalcertRWStorageArea} ${dirName}/${filename} - ${options} Set variable --verbose -X DELETE - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${dirName} - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV DELETE unexistent file as anonymous - [Tags] webdav delete anonymous to-be-fixed - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${options} Set variable -v -X DELETE - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${filename} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 404 Not Found - Remove local file ${filename} - [Teardown] Clear all credentials +*** Test Cases *** -WebDAV DELETE unexistent file with voms proxy credentials - [Tags] webdav delete vomsproxy to-be-fixed - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${options} Set variable -v -X DELETE - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 404 Not Found - Remove local file ${filename} - [Teardown] Clear all credentials +WebDAV DELETE file + [Tags] webdav delete + [Setup] Setup default SA + Create working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + Do CURL DELETE and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV DELETE directory + [Tags] webdav delete + [Setup] Setup default SA + Create working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + Do CURL DELETE and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV DELETE non existent resource + [Tags] webdav delete no-gridhttps + [Setup] Setup default SA + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + ${stdout} ${stderr} Do CURL DELETE ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 404 Not Found + [Teardown] Teardown default SA diff --git a/tests/webdav/forbidden.txt b/tests/webdav/forbidden.txt new file mode 100644 index 0000000..56a07c7 --- /dev/null +++ b/tests/webdav/forbidden.txt @@ -0,0 +1,243 @@ +*** Settings *** + +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt + +*** Test Cases *** + +######## GET / HEAD ######### + +WebDAV GET/HEAD VO file as anonymous user and anonymous http read disabled + [Tags] webdav forbidden get head + [Setup] Setup default SA + Create working directory + ${url} Build URL ${DAVEndpoint} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL GET ${url} + Should Contain ${stdout} 403 + ${stdout} ${stderr} Do CURL HEAD ${url} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV GET/HEAD VO file as anonymous user and anonymous http read enabled + [Tags] webdav forbidden get head + [Setup] Setup SA and VO ${DAVSecureEndpoint} ${SA.9} ${DEFAULT_USER} ${VO.1} + Create working directory + ${url} Build URL ${DAVEndpoint} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + Do CURL GET and check success ${url} + Do CURL HEAD and check success ${url} + [Teardown] Teardown SA and VO + +WebDAV GET/HEAD VO file as authenticated user when authenticated http read is disabled + [Tags] webdav forbidden get head no-gridhttps + [Setup] Setup default SA + Create working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${TEST_CURL_OPTIONS} Get CURL default x509 options + ${stdout} ${stderr} Do CURL GET ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + ${stdout} ${stderr} Do CURL HEAD ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV GET/HEAD VO file as anonymous user when anonymous http read is disabled + [Tags] webdav forbidden get head + [Setup] Setup default SA + Create working directory + ${url} Build URL ${DAVEndpoint} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL GET ${url} + Should Contain ${stdout} 403 + ${stdout} ${stderr} Do CURL HEAD ${url} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +######## PUT ######### + +WebDAV PUT VO file as anonymous + [Tags] webdav forbidden put + [Setup] Setup default SA + Create empty working directory + ${url} Build URL ${DAVEndpoint} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL PUT ${url} ${TEST_LOCAL_FILEPATH} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV PUT VO file as authenticated but not authorized user + [Tags] webdav forbidden put + [Setup] Setup default SA + Create empty working directory + ${TEST_CURL_OPTIONS} Get CURL default x509 options + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL PUT ${url} ${TEST_LOCAL_FILEPATH} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV PUT VO file with the wrong proxy + [Tags] webdav forbidden put + [Setup] Setup default SA + Create empty working directory + ${TEST_CURL_OPTIONS} Get CURL VOMS proxy options ${DEFAULT_USER} ${SA.2} + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL PUT ${url} ${TEST_LOCAL_FILEPATH} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +######## DELETE ######### + +WebDAV DELETE VO file as anonymous + [Tags] webdav forbidden delete + [Setup] Setup default SA + Create working directory + ${url} Build URL ${DAVEndpoint} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL DELETE ${url} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV DELETE VO file as authenticated but not authorized user + [Tags] webdav forbidden delete + [Setup] Setup default SA + Create working directory + ${TEST_CURL_OPTIONS} Get CURL default x509 options + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL DELETE ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV DELETE VO file with the wrong proxy + [Tags] webdav forbidden delete + [Setup] Setup default SA + Create working directory + ${TEST_CURL_OPTIONS} Get CURL VOMS proxy options ${DEFAULT_USER} ${SA.2} + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL DELETE ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +######## MKCOL ######### + +WebDAV MKCOL VO directory as anonymous + [Tags] webdav forbidden mkcol + [Setup] Setup default SA + Create empty working directory + ${url} Build URL ${DAVEndpoint} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_REMOTE_DIRNAME} + ${stdout} ${stderr} Do CURL MKCOL ${url} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV MKCOL VO directory as authenticated but not authorized user + [Tags] webdav forbidden mkcol + [Setup] Setup default SA + Create empty working directory + ${TEST_CURL_OPTIONS} Get CURL default x509 options + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_REMOTE_DIRNAME} + ${stdout} ${stderr} Do CURL MKCOL ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV MKCOL VO directory with the wrong proxy + [Tags] webdav forbidden mkcol + [Setup] Setup default SA + Create empty working directory + ${TEST_CURL_OPTIONS} Get CURL VOMS proxy options ${DEFAULT_USER} ${SA.2} + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_REMOTE_DIRNAME} + ${stdout} ${stderr} Do CURL MKCOL ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +######## PROPFIND ########## + +WebDAV PROPFIND allprop VO file as anonymous + [Tags] webdav forbidden propfind + [Setup] Setup default SA + Create working directory + ${body} Get PROPFIND ALLPROP body + ${url} Build URL ${DAVEndpoint} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL PROPFIND ${url} ${body} ${TEST_LOCAL_FILEPATH} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV PROPFIND allprop VO file as authenticated but not authorized user + [Tags] webdav forbidden propfind + [Setup] Setup default SA + Create working directory + ${body} Get PROPFIND ALLPROP body + ${TEST_CURL_OPTIONS} Get CURL default x509 options + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL PROPFIND ${url} ${body} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV PROPFIND allprop VO file with the wrong proxy + [Tags] webdav forbidden propfind + [Setup] Setup default SA + Create working directory + ${body} Get PROPFIND ALLPROP body + ${TEST_CURL_OPTIONS} Get CURL VOMS proxy options ${DEFAULT_USER} ${SA.2} + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL PROPFIND ${url} ${body} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +########## COPY ########### + +WebDAV COPY VO file as anonymous + [Tags] webdav forbidden copy + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${DAVEndpoint} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${DAVEndpoint} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + ${stdout} ${stderr} Do CURL COPY ${srcURL} ${dstURL} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV COPY VO file to another VO SA with the wrong proxy + [Tags] webdav forbidden copy + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${SA.2} ${TEST_FILENAME} + ${stdout} ${stderr} Do CURL COPY ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV COPY VO file to another VO SA with the right proxy + [Tags] webdav forbidden copy + [Setup] Setup SA and VO ${DAVSecureEndpoint} ${SA.7} ${DEFAULT_USER} ${VO.1} + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${SA.7} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_FILENAME} + ${TEST_CURL_OPTIONS} Get CURL default VOMS proxy options + Do CURL COPY and check success ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +########## MOVE ########### + +WebDAV MOVE VO file as anonymous + [Tags] webdav forbidden move + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${DAVEndpoint} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${DAVEndpoint} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + ${stdout} ${stderr} Do CURL MOVE ${srcURL} ${dstURL} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV MOVE VO file to another VO SA with the wrong proxy + [Tags] webdav forbidden move + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${SA.2} ${TEST_FILENAME} + ${stdout} ${stderr} Do CURL MOVE ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV MOVE VO file to another VO SA with the right proxy + [Tags] webdav forbidden move + [Setup] Setup SA and VO ${DAVSecureEndpoint} ${SA.7} ${DEFAULT_USER} ${VO.1} + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${SA.7} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_FILENAME} + ${TEST_CURL_OPTIONS} Get CURL default VOMS proxy options + Do CURL MOVE and check success ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA diff --git a/tests/webdav/get.txt b/tests/webdav/get.txt index 85727a3..483f9ea 100644 --- a/tests/webdav/get.txt +++ b/tests/webdav/get.txt @@ -1,187 +1,102 @@ *** Settings *** -Resource lib/stormlib.txt -Resource lib/clientSRM.txt -Resource lib/lcg_util.txt -Resource lib/credentials.txt -*** Test Cases *** +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt -WebDAV GET directory as anonymous - [Tags] webdav get anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${anonymousRWStorageArea} ${dirname} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${surl2} Build surl ${anonymousRWStorageArea} ${dirname}/${filename} - Copy-out file using lcg-utils ${filename} ${surl2} - ${options} Set variable --verbose -X GET - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${dirname} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 200 OK - Should Contain ${output} ${dirname} - Should Contain ${output} ${filename} - Remove not empty directory using clientSRM ${anonymousRWStorageArea} ${dirname} - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials +*** Test cases *** -WebDAV GET directory with voms proxy credentials - [Tags] webdav get vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${vomsproxyRWStorageArea} ${dirname} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${surl2} Build surl ${vomsproxyRWStorageArea} ${dirname}/${filename} - Copy-out file using lcg-utils ${filename} ${surl2} - ${options} Set variable --verbose -X GET - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${dirname} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 200 OK - Should Contain ${output} ${dirname} - Should Contain ${output} ${filename} - Remove not empty directory using clientSRM ${vomsproxyRWStorageArea} ${dirname} - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials +WebDAV GET file + [Tags] webdav get + [Setup] Setup default SA + Create working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL GET and check success ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} test123456789 + [Teardown] Teardown default SA -WebDAV GET directory with plain proxy credentials - [Tags] webdav get plainproxy - [Setup] Init certificate and plain proxy test0 - ${dirname} Get a unique name - ${surl} Build surl ${gridproxyRWStorageArea} ${dirname} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${surl2} Build surl ${gridproxyRWStorageArea} ${dirname}/${filename} - Copy-out file using lcg-utils ${filename} ${surl2} - ${options} Set variable --verbose -X GET - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${dirname} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 200 OK - Should Contain ${output} ${dirname} - Should Contain ${output} ${filename} - Remove not empty directory using clientSRM ${gridproxyRWStorageArea} ${dirname} - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials +WebDAV GET file and verify checksum + [Tags] webdav get no-gridhttps + [Setup] Setup default SA + Create working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL GET and check success ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} test123456789 + Should Contain ${stdout} Digest: adler32=1d3b039e + [Teardown] Teardown default SA -WebDAV GET directory with personal certificate - [Tags] webdav get perscert - [Setup] Init certificate with unencrypted key test0 - ${dirname} Get a unique name - ${surl} Build surl ${personalcertRWStorageArea} ${dirname} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${surl2} Build surl ${personalcertRWStorageArea} ${dirname}/${filename} - Copy-out file using lcg-utils ${filename} ${surl2} - ${options} Set variable --verbose -X GET - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${dirname} - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 200 OK - Should Contain ${output} ${dirname} - Should Contain ${output} ${filename} - Remove not empty directory using clientSRM ${personalcertRWStorageArea} ${dirname} - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials +WebDAV GET directory + [Tags] webdav get + [Setup] Setup default SA + Create empty working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + Do CURL GET and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA -WebDAV GET unexistent resource as anonymous - [Tags] webdav get anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${anonymousRWStorageArea} ${dirname} - ${output} Perform ls using clientSRM ${surl} -c 1 - Should Contain ${output} SRM_INVALID_PATH - ${options} Set variable --verbose -X GET - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${dirname} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 404 Not Found - Remove local directory ${dirname} - [Teardown] Clear all credentials +WebDAV GET root directory + [Tags] webdav get + [Setup] Setup default SA + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} + Do CURL GET and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA -WebDAV GET file as anonymous - [Tags] webdav get anonymous - [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 -X GET -v -o /tmp/${filename}_2 - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${filename} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 200 OK - Execute and Check Success diff /tmp/${filename} /tmp/${filename}_2 - Remove file using clientSRM ${anonymousRWStorageArea} ${filename} - Remove local file ${filename} - Remove local file ${filename}_2 - [Teardown] Clear all credentials +WebDAV GET non existent resource + [Tags] webdav get + [Setup] Setup default SA + Create empty working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL GET ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 404 Not Found + [Teardown] Teardown default SA -WebDAV GET file with plain proxy - [Tags] webdav get plainproxy - [Setup] Init certificate and plain proxy test0 - ${filename} Create local file - ${surl} Build surl ${gridproxyRWStorageArea} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${options} Set variable -X GET -v -o /tmp/${filename}_2 - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 200 OK - Execute and Check Success diff /tmp/${filename} /tmp/${filename}_2 - Remove file using clientSRM ${gridproxyRWStorageArea} ${filename} - Remove local file ${filename} - Remove local file ${filename}_2 - [Teardown] Clear all credentials +WebDAV GET resource with missing parent + [Tags] webdav get + [Setup] Setup default SA + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL GET ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 404 Not Found + [Teardown] Teardown default SA -WebDAV GET file with VOMS proxy - [Tags] webdav get vomsproxy - [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} - ${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} 200 OK - Execute and Check Success diff /tmp/${filename} /tmp/${filename}_2 - Remove file using clientSRM ${vomsproxyRWStorageArea} ${filename} - Remove local file ${filename} - Remove local file ${filename}_2 - [Teardown] Clear all credentials +WebDAV partial GET + [Tags] webdav get no-gridhttps + [Setup] Setup default SA + Create working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL partial GET and check success ${url} 0-3 ${TEST_CURL_OPTIONS} + Should Contain ${stdout} test + Should Contain ${stdout} Content-Length: 4 + Should Not Contain ${stdout} test1 + ${stdout} ${stderr} Do CURL partial GET and check success ${url} 4-7 ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 1234 + Should Contain ${stdout} Content-Length: 4 + ${stdout} ${stderr} Do CURL partial GET and check success ${url} 9-12 ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 6789 + Should Contain ${stdout} Content-Length: 4 + ${stdout} ${stderr} Do CURL partial GET and check success ${url} 1-3,5-7,10-11 ${TEST_CURL_OPTIONS} + Should Contain ${stdout} Content-Range: bytes 1-3/13 + Should Contain ${stdout} est + Should Contain ${stdout} Content-Range: bytes 5-7/13 + Should Contain ${stdout} 234 + Should Contain ${stdout} Content-Range: bytes 10-11/13 + Should Contain ${stdout} 78 + ${stdout} ${stderr} Do CURL partial GET and check success ${url} 11-13 ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 89 + Should Contain ${stdout} Content-Range: bytes 11-12/13 + Should Contain ${stdout} Content-Length: 2 + ${stdout} ${stderr} Do CURL partial GET ${url} 20-24 ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 416 Requested Range Not Satisfiable + ${stdout} ${stderr} Do CURL partial GET and check success ${url} 1-3,20-24 ${TEST_CURL_OPTIONS} + Should Contain ${stdout} Content-Range: bytes 1-3/13 + Should Contain ${stdout} est + Should Contain ${stdout} Content-Length: 3 + [Teardown] Teardown default SA -WebDAV GET file with personal certificate - [Tags] webdav get perscert - [Setup] Init certificate with unencrypted key test0 - ${filename} Create local file - ${surl} Build surl ${personalcertRWStorageArea} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${options} Set variable -X GET -v -o /tmp/${filename}_2 - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${filename} - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 200 OK - Execute and Check Success diff /tmp/${filename} /tmp/${filename}_2 - 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 \ No newline at end of file +WebDAV GET unauthorized + [Tags] webdav get + [Setup] Setup default SA + Create working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${TEST_CURL_OPTIONS} Get CURL VOMS proxy options ${DEFAULT_USER} ${VO.2} + ${stdout} ${stderr} Do CURL GET ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA diff --git a/tests/webdav/head.txt b/tests/webdav/head.txt index 93ba372..2ab5f59 100644 --- a/tests/webdav/head.txt +++ b/tests/webdav/head.txt @@ -1,102 +1,56 @@ *** Settings *** -Resource lib/stormlib.txt -Resource lib/clientSRM.txt -Resource lib/credentials.txt -Resource lib/lcg_util.txt -*** Test Cases *** +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt -WebDAV HEAD anonymous on root directory - [Tags] webdav head anonymous - ${options} Set variable --verbose --head - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 200 OK +*** Test cases *** -WebDAV HEAD anonymous on existent file - [Tags] webdav head anonymous - [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 --head - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${filename} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 200 OK - Remove file using clientSRM ${anonymousRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV HEAD anonymous on unexistent file - [Tags] webdav head anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Get a unique name - ${options} Set variable --verbose --head - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${filename} - ${output} Execute Curl with options ${url} ${options} - Log ${output} - Should Contain ${output} 404 Not Found - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV HEAD anonymous on existent directory - [Tags] webdav head anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${anonymousRWStorageArea} ${dirname} - ${output} Perform mkdir using clientSRM ${surl} - ${options} Set variable --verbose --head - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${dirname} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 200 OK - Remove empty directory using clientSRM ${anonymousRWStorageArea} ${dirname} - Remove local directory ${dirname} - [Teardown] Clear all credentials - -WebDAV HEAD with VOMS proxy on root directory +WebDAV HEAD file [Tags] webdav head - [Setup] Init certificate and voms proxy test0 ${vo} - ${options} Set variable --verbose --head - ${url} Build webdav secure URL ${vomsproxyRWStorageArea}/ - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 200 OK - [Teardown] Clear all credentials - -WebDAV HEAD with VOMS proxy on existent file - [Tags] webdav head vomsproxy - [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} - ${options} Set variable --verbose --head - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 200 OK - Remove file using clientSRM ${vomsproxyRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials + [Setup] Setup default SA + Create working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL HEAD and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV HEAD file and verify checksum + [Tags] webdav head no-gridhttps + [Setup] Setup default SA + Create working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL HEAD and check success ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} Digest: adler32=1d3b039e + [Teardown] Teardown default SA + +WebDAV HEAD directory + [Tags] webdav head + [Setup] Setup default SA + Create empty working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + Do CURL HEAD and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA -WebDAV HEAD with VOMS proxy on unexistent file - [Tags] webdav head vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${options} Set variable --verbose --head - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 404 Not Found - Remove local file ${filename} - [Teardown] Clear all credentials +WebDAV HEAD root directory + [Tags] webdav head + [Setup] Setup default SA + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} + Do CURL HEAD and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA -WebDAV HEAD with VOMS proxy on existent directory - [Tags] webdav head vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${vomsproxyRWStorageArea} ${dirname} - ${output} Perform mkdir using clientSRM ${surl} - ${options} Set variable --verbose --head - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${dirname} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 200 OK - Remove empty directory using clientSRM ${vomsproxyRWStorageArea} ${dirname} - Remove local directory ${dirname} - [Teardown] Clear all credentials \ No newline at end of file +WebDAV HEAD non existent resource + [Tags] webdav head + [Setup] Setup default SA + Create empty working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL HEAD ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 404 Not Found + [Teardown] Teardown default SA + +WebDAV HEAD resource with missing parent + [Tags] webdav head + [Setup] Setup default SA + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL HEAD ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 404 Not Found + [Teardown] Teardown default SA \ No newline at end of file diff --git a/tests/webdav/mkcol.txt b/tests/webdav/mkcol.txt index 776c2c8..997fb6e 100644 --- a/tests/webdav/mkcol.txt +++ b/tests/webdav/mkcol.txt @@ -1,82 +1,40 @@ *** Settings *** -Resource lib/stormlib.txt -Resource lib/clientSRM.txt -Resource lib/credentials.txt -*** Test Cases *** - -WebDAV MKCOL anonymous - [Tags] webdav mkcol anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${options} Set variable --verbose -X MKCOL - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${dirName} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - Remove empty directory using clientSRM ${anonymousRWStorageArea} ${dirname} - Remove local directory ${dirname} - [Teardown] Clear all credentials +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt -WebDAV MKCOL with voms proxy - [Tags] webdav mkcol vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${options} Set variable --verbose -X MKCOL - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${dirName} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Remove empty directory using clientSRM ${vomsproxyRWStorageArea} ${dirname} - Remove local directory ${dirname} - [Teardown] Clear all credentials +*** Test Cases *** -WebDAV MKCOL with plain proxy - [Tags] webdav mkcol plainproxy - [Setup] Init certificate and plain proxy test0 - ${dirname} Get a unique name - ${options} Set variable --verbose -X MKCOL - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${dirName} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Remove empty directory using clientSRM ${gridproxyRWStorageArea} ${dirname} - Remove local directory ${dirname} - [Teardown] Clear all credentials +WebDAV MKCOL + [Tags] webdav mkcol + [Setup] Setup default SA + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + Do CURL MKCOL and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA -WebDAV MKCOL with personal certificate - [Tags] webdav mkcol perscert - [Setup] Init certificate with unencrypted key test0 - ${dirname} Get a unique name - ${options} Set variable --verbose -X MKCOL - ${url} Build webdav secure url ${personalcertRWStorageArea} ${dirName} - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - Remove empty directory using clientSRM ${personalcertRWStorageArea} ${dirname} - Remove local directory ${dirname} - [Teardown] Clear all credentials +WebDAV MKCOL with missing anchestor + [Tags] webdav mkcol + [Setup] Setup default SA + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_REMOTE_DIRNAME} + ${stdout} ${stderr} Do CURL MKCOL ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 409 Conflict + [Teardown] Teardown default SA -WebDAV MKCOL anonymous with unexistent intermediate parent - [Tags] webdav mkcol anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${anonymousRWStorageArea} ${dirname} - ${output} Perform ls using clientSRM ${surl} -c 1 - Should Contain ${output} SRM_INVALID_PATH - ${options} Set variable --verbose -X MKCOL - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${dirName}/${dirName} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 409 Conflict - Remove local directory ${dirname} - [Teardown] Clear all credentials +WebDAV MKCOL on existent resource + [Tags] webdav mkcol + [Setup] Setup default SA + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + Do CURL MKCOL and check success ${url} ${TEST_CURL_OPTIONS} + ${stdout} ${stderr} Do CURL MKCOL ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 405 Method Not Allowed + [Teardown] Teardown default SA -WebDAV MKCOL anonymous on existent directory - [Tags] webdav mkcol anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${options} Set variable --verbose -X MKCOL - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${dirName} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 405 Method Not Allowed - Remove empty directory using clientSRM ${anonymousRWStorageArea} ${dirname} - Remove local directory ${dirname} - [Teardown] Clear all credentials \ No newline at end of file +WebDAV MKCOL unauthorized + [Tags] webdav mkcol + [Setup] Setup default SA + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + ${TEST_CURL_OPTIONS} Get CURL VOMS proxy options ${defaultUser} ${VO.2} + ${stdout} ${stderr} Do CURL MKCOL ${url} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA \ No newline at end of file diff --git a/tests/webdav/move.txt b/tests/webdav/move.txt index 57bc92d..5b04099 100644 --- a/tests/webdav/move.txt +++ b/tests/webdav/move.txt @@ -1,448 +1,81 @@ *** Settings *** -Resource lib/stormlib.txt -Resource lib/clientSRM.txt -Resource lib/lcg_util.txt -Resource lib/credentials.txt -*** Test Cases *** - -WebDAV MOVE file as anonymous - [Tags] webdav move anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${anonymousRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcFileName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE file with voms proxy credentials - [Tags] webdav move vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${vomsproxyRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${vomsproxyRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${vomsproxyRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE file with plain proxy credentials - [Tags] webdav move plainproxy - [Setup] Init certificate and plain proxy test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${gridproxyRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${gridproxyRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${gridproxyRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE file with personal certificate - [Tags] webdav move perscert - [Setup] Init certificate with unencrypted key test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${personalcertRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${personalcertRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${personalcertRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE full directory as anonymous - [Tags] webdav move anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${anonymousRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${anonymousRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcDirName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - Remove not empty directory using clientSRM ${anonymousRWStorageArea} ${destDirName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - Remove local file ${fileName} - [Teardown] Clear all credentials - -WebDAV MOVE full directory with voms proxy credentials - [Tags] webdav move vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${vomsproxyRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${vomsproxyRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${srcDirName} - ${destUrl} Build webdav secure URL ${vomsproxyRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Remove not empty directory using clientSRM ${vomsproxyRWStorageArea} ${destDirName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - Remove local file ${fileName} - [Teardown] Clear all credentials - -WebDAV MOVE full directory with plain proxy credentials - [Tags] webdav move plainproxy - [Setup] Init certificate and plain proxy test0 - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${gridproxyRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${gridproxyRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${srcDirName} - ${destUrl} Build webdav secure URL ${gridproxyRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Remove not empty directory using clientSRM ${gridproxyRWStorageArea} ${destDirName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - Remove local file ${fileName} - [Teardown] Clear all credentials - -WebDAV MOVE full directory over HTTPS with personal certificate - [Tags] webdav move perscert - [Setup] Init certificate with unencrypted key test0 - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${personalcertRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${personalcertRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${srcDirName} - ${destUrl} Build webdav secure URL ${personalcertRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - Remove not empty directory using clientSRM ${gridproxyRWStorageArea} ${destDirName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - Remove local file ${fileName} - [Teardown] Clear all credentials - -WebDAV MOVE overwrite file as anonymous - [Tags] webdav move anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${anonymousRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcFileName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 204 No Content - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE overwrite file with voms proxy credentials - [Tags] webdav move vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${vomsproxyRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${vomsproxyRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${vomsproxyRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE overwrite file with plain proxy credentials - [Tags] webdav move plainproxy - [Setup] Init certificate and plain proxy test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${gridproxyRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${gridproxyRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${gridproxyRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE overwrite file with personal certificate - [Tags] webdav move perscert - [Setup] Init certificate with unencrypted key test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${personalcertRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${personalcertRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${personalcertRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 204 No Content - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE overwrite full directory as anonymous - [Tags] webdav move anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${anonymousRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${anonymousRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcDirName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 204 No Content - Remove not empty directory using clientSRM ${anonymousRWStorageArea} ${destDirName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - Remove local file ${fileName} - [Teardown] Clear all credentials - -WebDAV MOVE overwrite full directory with voms proxy credentials - [Tags] webdav move vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${vomsproxyRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${vomsproxyRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${srcDirName} - ${destUrl} Build webdav secure URL ${vomsproxyRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove not empty directory using clientSRM ${vomsproxyRWStorageArea} ${destDirName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - Remove local file ${fileName} - [Teardown] Clear all credentials - -WebDAV MOVE overwrite full directory with plain proxy credentials - [Tags] webdav move plainproxy - [Setup] Init certificate and plain proxy test0 - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${gridproxyRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${gridproxyRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${srcDirName} - ${destUrl} Build webdav secure URL ${gridproxyRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove not empty directory using clientSRM ${gridproxyRWStorageArea} ${destDirName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - Remove local file ${fileName} - [Teardown] Clear all credentials - -WebDAV MOVE overwrite full directory with personal certificate - [Tags] webdav move perscert - [Setup] Init certificate with unencrypted key test0 - ${srcDirName} Get a unique name - ${srcDirSurl} Build surl ${personalcertRWStorageArea} ${srcDirName} - ${output} Perform mkdir using clientSRM ${srcDirSurl} - Should Contain ${output} SRM_SUCCESS - ${fileName} Create local file - ${fileSurl} Build surl ${personalcertRWStorageArea} ${srcDirName}/${fileName} - Copy-out file using lcg-utils ${fileName} ${fileSurl} - ${destDirName} Get a unique name - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${srcDirName} - ${destUrl} Build webdav secure URL ${personalcertRWStorageArea} ${destDirName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' --header 'Overwrite: T' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove not empty directory using clientSRM ${personalcertRWStorageArea} ${destDirName} - Remove local directory ${srcDirName} - Remove local directory ${destDirName} - Remove local file ${fileName} - [Teardown] Clear all credentials - -WEBDAV MOVE to a different storage area as anonymous - [Tags] webdav move anonymous - [Setup] Init certificate with unencrypted key test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousBisRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${anonymousRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousBisRWStorageArea} ${srcFileName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE to a different storage area with personal certificate - [Tags] webdav move perscert - [Setup] Init certificate with unencrypted key test0 - ${srcFileName} Create local file - ${srcSurl} Build surl ${personalcertRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${personalcertBisRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${srcFileName} - ${destUrl} Build webdav secure URL ${personalcertBisRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - Perform rm using clientSRM ${destSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE file with source URL equals to destination URL as anonymous - [Tags] webdav move anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${anonymousRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcFileName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${url}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 403 The source and destination URIs are the same! - Perform rm using clientSRM ${srcSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE file with overwrite false on existent destination as anonymous - [Tags] webdav move anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destSurl} Build surl ${anonymousRWStorageArea} ${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcFileName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destFileName} - ${options} Set variable --verbose -X COPY --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' --header 'Overwrite: F' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 412 Precondition Failed - Perform rm using clientSRM ${srcSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - [Teardown] Clear all credentials - -WebDAV MOVE file to a destination with unexistent intermediate parent as anonymous - [Tags] webdav move anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${srcFileName} Create local file - ${srcSurl} Build surl ${anonymousRWStorageArea} ${srcFileName} - ${destFileName} Get a unique name - ${destDirname} Get a unique name - ${destDirSurl} Build surl ${anonymousRWStorageArea} ${destDirname} - ${output} Perform ls using clientSRM ${destDirSurl} -c 1 - Should Contain ${output} SRM_INVALID_PATH - ${destSurl} Build surl ${anonymousRWStorageArea} ${destDirname}/${destFileName} - Copy-out file using lcg-utils ${srcFileName} ${srcSurl} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${srcFileName} - ${destUrl} Build webdav unsecure URL ${anonymousRWStorageArea} ${destDirname}/${destFileName} - ${options} Set variable --verbose -X MOVE --header 'Destination: ${destUrl}' - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 409 Conflict - Perform rm using clientSRM ${srcSurl} - Remove local file ${srcFileName} - Remove local file ${destFileName} - Remove local directory ${destDirName} - [Teardown] Clear all credentials \ No newline at end of file +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt + +*** Test cases *** + +WebDAV MOVE file + [Tags] webdav move + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + Do CURL MOVE and check success ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV MOVE non empty directory + [Tags] webdav move + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}_2 + Do CURL MOVE and check success ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV MOVE file overwrite + [Tags] webdav move to-be-fixed + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + Do CURL COPY and check success ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + Do CURL HEAD and check success ${dstURL} ${TEST_CURL_OPTIONS} + ${overwriteHeader} Get CURL header Overwrite T + Do CURL MOVE and check overwrite success ${srcURL} ${dstURL} ${overwriteHeader} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV MOVE file not allowed overwrite + [Tags] webdav move + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + Do CURL COPY and check success ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + ${overwriteHeader} Get CURL header Overwrite F + ${stdout} ${stderr} Do CURL MOVE ${srcURL} ${dstURL} ${overwriteHeader} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 412 Precondition Failed + [Teardown] Teardown default SA + +WebDAV MOVE not existent file + [Tags] webdav move no-gridhttps + [Setup] Setup default SA + Create empty working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + ${stdout} ${stderr} Do CURL MOVE ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 404 Not Found + [Teardown] Teardown default SA + +WebDAV MOVE with destination equals to source + [Tags] webdav move + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${overwriteHeader} Get CURL header Overwrite T + ${stdout} ${stderr} Do CURL MOVE ${srcURL} ${dstURL} ${overwriteHeader} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV MOVE unauthorized + [Tags] webdav move + [Setup] Setup default SA + Create working directory + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${dstURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + ${TEST_CURL_OPTIONS} Get CURL VOMS proxy options ${DEFAULT_USER} ${VO.2} + ${stdout} ${stderr} Do CURL MOVE ${srcURL} ${dstURL} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA diff --git a/tests/webdav/options.txt b/tests/webdav/options.txt index 070ecf0..902ec76 100644 --- a/tests/webdav/options.txt +++ b/tests/webdav/options.txt @@ -1,44 +1,30 @@ *** Settings *** -Resource lib/stormlib.txt -Resource lib/clientSRM.txt -Resource lib/credentials.txt -*** Test Cases *** +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt -WebDAV OPTIONS on directory as anonymous - [Tags] webdav options anonymous - ${options} Set variable --verbose -X OPTIONS - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 200 OK - Should Contain ${output} DAV: 1 +*** Test cases *** -WebDAV OPTIONS on directory with voms proxy credentials - [Tags] webdav options vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${options} Set variable --verbose -X OPTIONS - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 200 OK - Should Contain ${output} DAV: 1 - [Teardown] Clear all credentials +WebDAV OPTIONS on storage area root directory + [Tags] webdav options + [Setup] Setup default SA + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} + Do CURL OPTIONS and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA -WebDAV OPTIONS on directory with plain proxy credentials - [Tags] webdav options plainproxy - [Setup] Init certificate and plain proxy test0 - ${options} Set variable --verbose -X OPTIONS - ${url} Build webdav secure URL ${gridproxyRWStorageArea} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 200 OK - Should Contain ${output} DAV: 1 - [Teardown] Clear all credentials +WebDAV OPTIONS on file + [Tags] webdav options + [Setup] Setup default SA + Create working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + Do CURL OPTIONS and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA -WebDAV OPTIONS on directory with personal certificate - [Tags] webdav options perscert - [Setup] Init certificate with unencrypted key test0 - ${options} Set variable --verbose -X OPTIONS - ${url} Build webdav secure URL ${personalcertRWStorageArea} - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 200 OK - Should Contain ${output} DAV: 1 - [Teardown] Clear all credentials \ No newline at end of file +WebDAV OPTIONS on directory + [Tags] webdav options + [Setup] Setup default SA + Create empty working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + Do CURL OPTIONS and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA \ No newline at end of file diff --git a/tests/webdav/propfind.txt b/tests/webdav/propfind.txt index 631d1fd..75d1534 100644 --- a/tests/webdav/propfind.txt +++ b/tests/webdav/propfind.txt @@ -1,171 +1,55 @@ *** Settings *** -Resource lib/stormlib.txt -Resource lib/clientSRM.txt -Resource lib/lcg_util.txt -Resource lib/credentials.txt -*** Test Cases *** - -WebDAV PROPFIND on directory as anonymous - [Tags] webdav propfind anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${anonymousRWStorageArea} ${dirname} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${surl2} Build surl ${anonymousRWStorageArea} ${dirname}/${filename} - Copy-out file using lcg-utils ${filename} ${surl2} - ${body} Set variable - ${options} Set variable --verbose -X PROPFIND --header 'Content-Type: text/xml' - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${dirname} - ${output} Execute Curl with options ${url} ${options} --data-ascii "${body}" - Log ${output} - Should Contain ${output} ${dirname} - Should Contain ${output} ${dirname}/${filename} - Remove not empty directory using clientSRM ${anonymousRWStorageArea} ${dirname} - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PROPFIND on directory with voms proxy credentials - [Tags] webdav propfind vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${vomsproxyRWStorageArea} ${dirname} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${surl2} Build surl ${vomsproxyRWStorageArea} ${dirname}/${filename} - Copy-out file using lcg-utils ${filename} ${surl2} - ${body} Set variable - ${options} Set variable --verbose -X PROPFIND --header 'Content-Type: text/xml' - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${dirname} - ${output} Execute Curl with proxy and options ${url} ${options} --data-ascii "${body}" - Log ${output} - Should Contain ${output} ${dirname} - Should Contain ${output} ${dirname}/${filename} - Remove not empty directory using clientSRM ${vomsproxyRWStorageArea} ${dirname} - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PROPFIND on directory with plain proxy credentials - [Tags] webdav propfind plainproxy - [Setup] Init certificate and plain proxy test0 - ${dirname} Get a unique name - ${surl} Build surl ${gridproxyRWStorageArea} ${dirname} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${surl2} Build surl ${gridproxyRWStorageArea} ${dirname}/${filename} - Copy-out file using lcg-utils ${filename} ${surl2} - ${body} Set variable - ${options} Set variable --verbose -X PROPFIND --header 'Content-Type: text/xml' - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${dirname} - ${output} Execute Curl with proxy and options ${url} ${options} --data-ascii "${body}" - Log ${output} - Should Contain ${output} ${dirname} - Should Contain ${output} ${dirname}/${filename} - Remove not empty directory using clientSRM ${gridproxyRWStorageArea} ${dirname} - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PROPFIND on directory with personal certificate - [Tags] webdav propfind perscert - [Setup] Init certificate with unencrypted key test0 - ${dirname} Get a unique name - ${surl} Build surl ${personalcertRWStorageArea} ${dirname} - ${output} Perform mkdir using clientSRM ${surl} - Should Contain ${output} SRM_SUCCESS - ${filename} Create local file - ${surl2} Build surl ${personalcertRWStorageArea} ${dirname}/${filename} - Copy-out file using lcg-utils ${filename} ${surl2} - ${body} Set variable - ${options} Set variable --verbose -X PROPFIND --header 'Content-Type: text/xml' - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${dirname} - ${output} Execute Curl with certificate and options ${url} ${options} --data-ascii "${body}" - Log ${output} - Should Contain ${output} ${dirname} - Should Contain ${output} ${dirname}/${filename} - Remove not empty directory using clientSRM ${personalcertRWStorageArea} ${dirname} - Remove local directory ${dirname} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PROPFIND on file as anonymous - [Tags] webdav propfind anonymous - [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} - ${body} Set variable - ${options} Set variable --verbose -X PROPFIND --header 'Content-Type: text/xml' - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${filename} - ${output} Execute Curl with options ${url} ${options} --data-ascii "${body}" - Log ${output} - Should Contain ${output} ${filename} - Should Contain ${output} checksumType - Should Contain ${output} checksumValue - Should Contain ${output} status - Perform rm using clientSRM ${surl} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PROPFIND on file with voms proxy credentials - [Tags] webdav propfind vomsproxy - [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} - ${body} Set variable - ${options} Set variable --verbose -X PROPFIND --header 'Content-Type: text/xml' - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} --data-ascii "${body}" - Log ${output} - Should Contain ${output} ${filename} - Should Contain ${output} checksumType - Should Contain ${output} checksumValue - Should Contain ${output} status - Perform rm using clientSRM ${surl} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PROPFIND on file with plain proxy credentials - [Tags] webdav propfind plainproxy - [Setup] Init certificate and plain proxy test0 - ${filename} Create local file - ${surl} Build surl ${gridproxyRWStorageArea} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${body} Set variable - ${options} Set variable --verbose -X PROPFIND --header 'Content-Type: text/xml' - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} --data-ascii "${body}" - Log ${output} - Should Contain ${output} ${filename} - Should Contain ${output} checksumType - Should Contain ${output} checksumValue - Should Contain ${output} status - Perform rm using clientSRM ${surl} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PROPFIND on file with personal certificate - [Tags] webdav propfind perscert - [Setup] Init certificate with unencrypted key test0 - ${filename} Create local file - ${surl} Build surl ${personalcertRWStorageArea} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${body} Set variable - ${options} Set variable --verbose -X PROPFIND --header 'Content-Type: text/xml' - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${filename} - ${output} Execute Curl with certificate and options ${url} ${options} --data-ascii "${body}" - Log ${output} - Should Contain ${output} ${filename} - Should Contain ${output} checksumType - Should Contain ${output} checksumValue - Should Contain ${output} status - Perform rm using clientSRM ${surl} - Remove local file ${filename} - [Teardown] Clear all credentials \ No newline at end of file +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt + +*** Test cases *** + +WebDAV PROPFIND allprop on file + [Tags] webdav propfind no-gridhttps + [Setup] Setup default SA + Create working directory + ${body} Get PROPFIND ALLPROP body + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL PROPFIND and check success ${url} ${body} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} ${TESTDIR}/${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + Should Contain ${stdout} + Should Contain ${stdout} + Should Contain ${stdout} HTTP/1.1 200 OK + Should Contain ${stdout} FALSE + [Teardown] Teardown default SA + +WebDAV PROPFIND allprop on non empty directory + [Tags] webdav propfind no-gridhttps + [Setup] Setup default SA + Create working directory + ${body} Get PROPFIND ALLPROP body + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + ${stdout} ${stderr} Do CURL PROPFIND and check success ${url} ${body} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} ${TESTDIR}/${TEST_REMOTE_DIRNAME} + Should Contain ${stdout} ${TESTDIR}/${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + Should Contain ${stdout} + Should Contain ${stdout} + Should Contain ${stdout} HTTP/1.1 200 OK + Should Contain ${stdout} FALSE + Should Contain ${stdout} TRUE + [Teardown] Teardown default SA + +WebDAV PROPFIND propname on file + [Tags] webdav propfind + [Setup] Setup default SA + Create working directory + ${body} Get PROPFIND PROPNAME body + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + Do CURL PROPFIND and check success ${url} ${body} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV PROPFIND prop on file + [Tags] webdav propfind + [Setup] Setup default SA + Create working directory + ${body} Get PROPFIND PROP body status + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + Do CURL PROPFIND and check success ${url} ${body} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA diff --git a/tests/webdav/put.txt b/tests/webdav/put.txt index 9c1db25..0d17e7c 100644 --- a/tests/webdav/put.txt +++ b/tests/webdav/put.txt @@ -1,231 +1,50 @@ *** Settings *** -Resource lib/stormlib.txt -Resource lib/clientSRM.txt -Resource lib/credentials.txt -Resource lib/lcg_util.txt -*** Test Cases *** - -WebDAV PUT file as anonymous - [Tags] webdav put anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${options} Set variable --verbose -T /tmp/${filename} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${filename} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - Remove file using clientSRM ${anonymousRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT file with voms proxy credentials - [Tags] webdav put vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${options} Set variable --verbose -T /tmp/${filename} - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Remove file using clientSRM ${vomsproxyRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT file with plain proxy credentials - [Tags] webdav put plainproxy - [Setup] Init certificate and plain proxy test0 - ${filename} Create local file - ${options} Set variable --verbose -T /tmp/${filename} - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Remove file using clientSRM ${gridproxyRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT file with personal certificate - [Tags] webdav put perscert - [Setup] Init certificate with unencrypted key test0 - ${filename} Create local file - ${options} Set variable --verbose -T /tmp/${filename} - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${filename} - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - Remove file using clientSRM ${personalcertRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT file through HTTP body as anonymous - [Tags] webdav put anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${options} Set variable --verbose -X PUT --data-ascii 'this is a test file content' - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${filename} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 201 Created - Remove file using clientSRM ${anonymousRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT file through HTTP body with voms proxy credentials - [Tags] webdav put vomsproxy - [Setup] Init certificate and voms proxy test0 ${vo} - ${filename} Create local file - ${options} Set variable --verbose -X PUT --data-ascii 'this is a test file content' - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Remove file using clientSRM ${vomsproxyRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT file through HTTP body with plain proxy credentials - [Tags] webdav put plainproxy - [Setup] Init certificate and plain proxy test0 - ${filename} Create local file - ${options} Set variable --verbose -X PUT --data-ascii 'this is a test file content' - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 201 Created - Remove file using clientSRM ${gridproxyRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT file through HTTP body with personal certificate - [Tags] webdav put perscert - [Setup] Init certificate with unencrypted key test0 - ${filename} Create local file - ${options} Set variable --verbose -X PUT --data-ascii 'this is a test file content' - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${filename} - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 201 Created - Remove file using clientSRM ${personalcertRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT overwrite file as anonymous - [Tags] webdav put anonymous - [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 -T /tmp/${filename} --header 'Overwrite: T' - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${filename} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 204 No Content - Remove file using clientSRM ${anonymousRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT overwrite file with voms proxy credentials - [Tags] webdav put vomsproxy - [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} - ${options} Set variable --verbose -T /tmp/${filename} --header 'Overwrite: T' - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove file using clientSRM ${vomsproxyRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT overwrite file with plain proxy credentials - [Tags] webdav put plainproxy - [Setup] Init certificate and plain proxy test0 - ${filename} Create local file - ${surl} Build surl ${gridproxyRWStorageArea} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${options} Set variable --verbose -T /tmp/${filename} --header 'Overwrite: T' - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove file using clientSRM ${gridproxyRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT overwrite file with personal certificate - [Tags] webdav put perscert - [Setup] Init certificate with unencrypted key test0 - ${filename} Create local file - ${surl} Build surl ${personalcertRWStorageArea} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${options} Set variable --verbose -T /tmp/${filename} --header 'Overwrite: T' - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${filename} - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove file using clientSRM ${personalcertRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT overwrite file through HTTP body as anonymous - [Tags] webdav put anonymous - [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 PUT --data-ascii 'this is a test file content' --header 'Overwrite: T' - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${filename} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 204 No Content - Remove file using clientSRM ${anonymousRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT overwrite file through HTTP body with voms proxy credentials - [Tags] webdav put vomsproxy - [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} - ${options} Set variable --verbose -X PUT --data-ascii 'this is a test file content' --header 'Overwrite: T' - ${url} Build webdav secure URL ${vomsproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove file using clientSRM ${vomsproxyRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT overwrite file through HTTP body with plain proxy credentials - [Tags] webdav put plainproxy - [Setup] Init certificate and plain proxy test0 - ${filename} Create local file - ${surl} Build surl ${gridproxyRWStorageArea} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${options} Set variable --verbose -X PUT --data-ascii 'this is a test file content' --header 'Overwrite: T' - ${url} Build webdav secure URL ${gridproxyRWStorageArea} ${filename} - ${output} Execute Curl with proxy and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove file using clientSRM ${gridproxyRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT overwrite file through HTTP body with personal certificate - [Tags] webdav put perscert - [Setup] Init certificate with unencrypted key test0 - ${filename} Create local file - ${surl} Build surl ${personalcertRWStorageArea} ${filename} - Copy-out file using lcg-utils ${filename} ${surl} - ${options} Set variable --verbose -X PUT --data-ascii 'this is a test file content' --header 'Overwrite: T' - ${url} Build webdav secure URL ${personalcertRWStorageArea} ${filename} - ${output} Execute Curl with certificate and options ${url} ${options} - Should Contain ${output} 204 No Content - Remove file using clientSRM ${personalcertRWStorageArea} ${filename} - Remove local file ${filename} - [Teardown] Clear all credentials - -WebDAV PUT file as anonymous with no intermediate parent - [Tags] webdav put anonymous - [Setup] Init certificate and voms proxy test0 ${vo} - ${dirname} Get a unique name - ${surl} Build surl ${anonymousRWStorageArea} ${dirname} - ${output} Perform ls using clientSRM ${surl} -c 1 - Should Contain ${output} SRM_INVALID_PATH - ${filename} Create local file - ${options} Set variable --verbose -T /tmp/${filename} - ${url} Build webdav unsecure URL ${anonymousRWStorageArea} ${dirname}/${filename} - ${output} Execute Curl with options ${url} ${options} - Should Contain ${output} 409 Conflict - Remove local file ${filename} - Remove local directory ${dirname} - [Teardown] Clear all credentials +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt + +*** Test cases *** + +WebDAV PUT + [Tags] webdav put + [Setup] Setup default SA + Create empty working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + Do CURL PUT and check success ${url} ${TEST_LOCAL_FILEPATH} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV PUT overwrite + [Tags] webdav put + [Setup] Setup default SA + Create empty working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + Do CURL PUT and check success ${url} ${TEST_LOCAL_FILEPATH} ${TEST_CURL_OPTIONS} + Do CURL PUT and check overwrite success ${url} ${TEST_LOCAL_FILEPATH} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV PUT with missing anchestor + [Tags] webdav put no-gridhttps + [Setup] Setup default SA + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + Do CURL PUT and check success ${url} ${TEST_LOCAL_FILEPATH} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV PUT over collection + [Tags] webdav put to-be-fixed + [Setup] Setup default SA + Create empty working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME} + ${stdout} ${stderr} Do CURL PUT ${url} ${TEST_LOCAL_FILEPATH} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 405 Method not allowed + [Teardown] Teardown default SA + +WebDAV PUT unauthorized + [Tags] webdav put + [Setup] Setup default SA + Create empty working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${TEST_CURL_OPTIONS} Get CURL VOMS proxy options ${DEFAULT_USER} ${VO.2} + ${stdout} ${stderr} Do CURL PUT ${url} ${TEST_LOCAL_FILEPATH} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 403 + [Teardown] Teardown default SA diff --git a/tests/webdav/regression.txt b/tests/webdav/regression.txt new file mode 100644 index 0000000..de7aa1d --- /dev/null +++ b/tests/webdav/regression.txt @@ -0,0 +1,16 @@ +*** Settings *** + +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt + +*** Test Cases *** + +STOR-795 Storage area matching fails with COPY/MOVE + [Tags] webdav copy + [Setup] Setup SA and VO ${DAVSecureEndpoint} ${SA.8} ${defaultUser} ${VO.2} + Create working directory + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME} + ${url2} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIRNAME}/${TEST_FILENAME}_2 + Do CURL COPY and check success ${url} ${url2} ${TEST_CURL_OPTIONS} + [Teardown] Teardown SA and VO \ No newline at end of file diff --git a/tests/webdav/renaming.txt b/tests/webdav/renaming.txt index 64ad424..ae20d3b 100644 --- a/tests/webdav/renaming.txt +++ b/tests/webdav/renaming.txt @@ -1,79 +1,42 @@ *** Settings *** -Resource lib/stormlib.txt -Resource lib/clientSRM.txt -Resource lib/lcg_util.txt -Resource lib/credentials.txt -*** Keywords *** - -upload file [Arguments] ${vo} ${filename} ${remotePath} - Init certificate and voms proxy test0 ${vo} - ${surl} Build surl ${vo} ${remotePath} - Copy-out file using lcg-utils ${fileName} ${surl} - Clear all credentials - -check exists [Arguments] ${vo} ${path} - Init certificate and voms proxy test0 ${vo} - ${headOptions} Set variable -v --head - ${url} Build webdav secure URL ${vo} ${path} - ${output} Execute Curl with proxy and options ${url} ${headOptions} - Log ${output} - ${status} ${value} = Run Keyword And Ignore Error Should Contain ${output} 200 OK - Clear all credentials - [Return] ${status} - -create directory [Arguments] ${vo} ${path} - Init certificate and voms proxy test0 ${vo} - ${mkcolOptions} Set variable -v -X MKCOL - ${url} Build webdav secure URL ${vo} ${path} - ${output} Execute Curl with proxy and options ${url} ${mkcolOptions} - Log ${output} - ${status} ${value} = Run Keyword And Ignore Error Should Contain ${output} 201 Created - Clear all credentials - [Return] ${status} - -rename file [Arguments] ${vo} ${src} ${dest} - Init certificate and voms proxy test0 ${vo} - ${destUrl} Build webdav secure URL ${vo} ${dest} - ${moveOptions} Set variable -v -X MOVE --header 'Destination: ${destUrl}' - ${url} Build webdav secure URL ${vo} ${src} - ${output} Execute Curl with proxy and options ${url} ${moveOptions} - Log ${output} - ${status} ${value} = Run Keyword And Ignore Error Should Contain ${output} 201 Created - Clear all credentials - [Return] ${status} +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt -clear local file [Arguments] ${filename} - Remove local file ${filename} +*** Keywords *** -clear remote directory with recursion [Arguments] ${vo} ${remoteDir} - Init certificate and voms proxy test0 ${vo} - ${surl} Build surl ${vo} ${remoteDir} - ${output} Perform rmdir using clientSRM ${surl} -r - Should Contain ${output} SRM_SUCCESS - Clear all credentials +Setup Renaming on particular SA and VO [Arguments] ${endpoint}=${DAVSecureEndpoint} ${sa}=${DEFAULT_SA} ${user}=${defaultUser} ${voname}=${DEFAULT_VO} + Use voms proxy ${user} ${voname} + ${options} Get CURL VOMS proxy options ${user} ${voname} + ${destL1dir} Get a unique name + ${destL2dir} Get a unique name + Set Test Variable ${TEST_CURL_OPTIONS} ${options} + Set Test Variable ${TEST_REMOTE_DIR1} ${destL1dir} + Set Test Variable ${TEST_REMOTE_DIR2} ${destL2dir} + Set Test Variable ${TEST_SA} ${sa} + Set Test Variable ${TEST_ENDPOINT} ${endpoint} + ${url} Build URL ${TEST_ENDPOINT} ${TEST_SA} + ${filename} Upload file with CURL ${url} ${TEST_CURL_OPTIONS} + Set Test Variable ${TEST_FILENAME} ${filename} *** Test Cases *** File renaming - ${filename} Create local file - ${destL1dir} Get a unique name - ${destL2dir} Get a unique name - ${destL2dir} Set variable ${destL1dir}/${destL2dir} - ${destFileName} Set variable ${destL2dir}/${filename} - upload file ${vo} ${filename} ${filename} - ${status} check exists ${vo} ${filename} - Run Keyword Unless '${status}'=='PASS' Fail Source file exists! - ${status} check exists ${vo} ${destL2dir} - Run Keyword If '${status}'=='PASS' Fail Destination L2 directory must not exist! - ${status} check exists ${vo} ${destL1dir} - Run Keyword If '${status}'=='PASS' Fail Destination L2 directory must not exist! - ${status} create directory ${vo} ${destL1dir} - Run Keyword Unless '${status}'=='PASS' Fail Error during L1 directory creation! - ${status} create directory ${vo} ${destL2dir} - Run Keyword Unless '${status}'=='PASS' Fail Error during L2 directory creation! - ${status} rename file ${vo} ${filename} ${destFilename} - Run Keyword Unless '${status}'=='PASS' Fail Error during renaming! - clear remote directory with recursion ${vo} ${destL1dir} - clear local file ${filename} - clear local file ${destL1dir} \ No newline at end of file + [Tags] webdav renaming + [Setup] Setup Renaming on particular SA and VO + ${srcURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_FILENAME} + Do CURL HEAD and check success ${srcURL} ${TEST_CURL_OPTIONS} + ${destURL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIR1}/${TEST_REMOTE_DIR2}/${TEST_FILENAME} + ${stdout} ${stderr} Do CURL HEAD ${destURL} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 404 Not Found + ${l2URL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIR1}/${TEST_REMOTE_DIR2} + ${stdout} ${stderr} Do CURL HEAD ${l2URL} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 404 Not Found + ${l1URL} Build URL ${TEST_ENDPOINT} ${TEST_SA} ${TEST_REMOTE_DIR1} + ${stdout} ${stderr} Do CURL HEAD ${l1URL} ${TEST_CURL_OPTIONS} + Should Contain ${stdout} 404 Not Found + Do CURL MKCOL and check success ${l1URL} ${TEST_CURL_OPTIONS} + Do CURL MKCOL and check success ${l2URL} ${TEST_CURL_OPTIONS} + Do CURL MOVE and check success ${srcURL} ${destURL} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA \ No newline at end of file diff --git a/tests/webdav/symlink.txt b/tests/webdav/symlink.txt new file mode 100644 index 0000000..73f77d9 --- /dev/null +++ b/tests/webdav/symlink.txt @@ -0,0 +1,33 @@ +*** Settings *** + +Resource lib/setup.txt +Resource lib/webdav.txt +Resource lib/webdav_util.txt + +*** Test Cases *** + +WebDAV GET dotted path to another SA with unauthorized credentials + [Tags] webdav symlink + [Setup] Setup default SA + ${url} Set Variable ${TEST_ENDPOINT}/${TEST_SA}/../${SA.2} + Log ${url} + ${stdout} ${stderr} Do CURL GET ${url} ${TEST_CURL_OPTIONS} + Should Not Contain ${stdout} 200 OK + Should Contain ${stdout} 403 + [Teardown] Teardown default SA + +WebDAV GET dotted path to another SA with authorized HTTP READ + [Tags] webdav symlink + [Setup] Setup default SA + ${url} Set Variable ${TEST_ENDPOINT}/${TEST_SA}/../${SA.7} + Log ${url} + Do CURL GET and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA + +WebDAV GET dotted path to another SA with anonymous HTTP READ + [Tags] webdav symlink + [Setup] Setup default SA + ${url} Set Variable ${TEST_ENDPOINT}/${TEST_SA}/../${SA.9} + Log ${url} + Do CURL GET and check success ${url} ${TEST_CURL_OPTIONS} + [Teardown] Teardown default SA \ No newline at end of file