X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FAAAKeywords.robot;h=a6737e756bcb8b9d824d7d74cda2078cb444acbf;hb=d80d4b9d6c2d89d89f7105562de8de986b026f4e;hp=04ad225b42f9b607a707f87d1272f42b73de9bfc;hpb=59e81c38620fa1b61e15771191e35771450b9499;p=integration%2Ftest.git diff --git a/csit/libraries/AAAKeywords.robot b/csit/libraries/AAAKeywords.robot index 04ad225b42..a6737e756b 100644 --- a/csit/libraries/AAAKeywords.robot +++ b/csit/libraries/AAAKeywords.robot @@ -6,14 +6,14 @@ Variables ../variables/Variables.py ${WORKSPACE} /tmp ${BUNDLEFOLDER} distribution-karaf-0.3.0-SNAPSHOT ${AUTHN_CFG_FILE} ${WORKSPACE}/${BUNDLEFOLDER}/etc/org.opendaylight.aaa.authn.cfg -${CONTROLLER_USER} ${MININET_USER} +${CONTROLLER_USER} ${MININET_USER} *** Keywords *** AAA Login [Arguments] ${controller_ip} ${auth_data} [Documentation] Makes a POST REST call to the AUTH_TOKEN_API with the given auth_data and returns the response Create Session ODL_SESSION http://${controller_ip}:8181 - ${headers}= Create Dictionary Content-Type application/x-www-form-urlencoded + ${headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded ${resp}= RequestsLibrary.POST ODL_SESSION ${AUTH_TOKEN_API} data=${auth_data} headers=${headers} Delete All Sessions [Return] ${resp} @@ -23,10 +23,10 @@ Create Auth Data [Documentation] returns a string in the direct authentacation format (e.g., grant_type=password&username=admin&password=admin). ... It can also be passed scope, client_id and client_secret arguments for the case of client specific authorization ${data}= Set Variable grant_type=password&username=${user}&password=${password}&scope=${scope} - ${data}= Run Keyword If "${client_id}" != "${EMPTY}" Set Variable ${data}&client_id=${client_id} ELSE Set Variable - ... ${data} - ${data}= Run Keyword If "${client_secret}" != "${EMPTY}" Set Variable ${data}&client_secret=${client_secret} ELSE Set Variable - ... ${data} + ${data}= Run Keyword If "${client_id}" != "${EMPTY}" Set Variable ${data}&client_id=${client_id} + ... ELSE Set Variable ${data} + ${data}= Run Keyword If "${client_secret}" != "${EMPTY}" Set Variable ${data}&client_secret=${client_secret} + ... ELSE Set Variable ${data} [Return] ${data} Disable Authentication On Controller @@ -59,7 +59,7 @@ Get Auth Token Revoke Auth Token [Arguments] ${token} [Documentation] Requests the given token be revoked via POST to ${REVOKE_TOKEN_API} - ${headers}= Create Dictionary Content-Type application/x-www-form-urlencoded + ${headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded ${resp}= RequestsLibrary.POST ODL_SESSION ${REVOKE_TOKEN_API} data=${token} headers=${headers} Should Be Equal As Strings ${resp.status_code} 204 @@ -69,20 +69,20 @@ Validate Token Format Should Match Regexp ${token} [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} Get User From IDM DB - [Documentation] Will return user information. If no user id is passed, it will retrieve all users in DB [Arguments] ${user_id}=${EMPTY} + [Documentation] Will return user information. If no user id is passed, it will retrieve all users in DB Create Session httpbin http://${CONTROLLER}:${RESTPORT} - ${headers}= Create Dictionary Content-Type application/x-www-form-urlencoded + ${headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded ${resp}= RequestsLibrary.GET httpbin ${idmurl}/users/${user_id} headers=${headers} Should Be Equal As Strings ${resp.status_code} 200 Log ${resp.content} [Return] ${resp} Create User - [Documentation] Will return user information. If no user id is passed, it will retrieve all users in DB [Arguments] ${user_data} + [Documentation] Will return user information. If no user id is passed, it will retrieve all users in DB Create Session httpbin http://${CONTROLLER}:${RESTPORT} - ${headers}= Create Dictionary Content-Type application/json + ${headers}= Create Dictionary Content-Type=application/json ${resp}= RequestsLibrary.POST httpbin ${idmurl}/users headers=${headers} data=${user_data} Should Be Equal As Strings ${resp.status_code} 201 Log ${resp.content}