X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FAAAKeywords.robot;h=eb2313315fadb36a28dfb0131c64399c3873ff96;hb=de4a40c80721603dd620178165b07999f5495487;hp=9d05bb69a8935f8abdfa2c489f8065a479eb51cb;hpb=5fbd3bce206b2b7b4d1b85f9a5aeb2e6aaee13e8;p=integration%2Ftest.git diff --git a/csit/libraries/AAAKeywords.robot b/csit/libraries/AAAKeywords.robot index 9d05bb69a8..eb2313315f 100644 --- a/csit/libraries/AAAKeywords.robot +++ b/csit/libraries/AAAKeywords.robot @@ -1,12 +1,10 @@ *** Settings *** Library RequestsLibrary -Variables ../variables/Variables.py +Resource ../variables/Variables.robot *** Variables *** ${WORKSPACE} /tmp -${BUNDLEFOLDER} distribution-karaf-0.3.0-SNAPSHOT ${AUTHN_CFG_FILE} ${WORKSPACE}/${BUNDLEFOLDER}/etc/org.opendaylight.aaa.authn.cfg -${CONTROLLER_USER} ${MININET_USER} *** Keywords *** AAA Login @@ -14,7 +12,7 @@ AAA Login [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 - ${resp}= RequestsLibrary.POST ODL_SESSION ${AUTH_TOKEN_API} data=${auth_data} headers=${headers} + ${resp}= RequestsLibrary.POST Request ODL_SESSION ${AUTH_TOKEN_API} data=${auth_data} headers=${headers} Delete All Sessions [Return] ${resp} @@ -33,7 +31,7 @@ Disable Authentication On Controller [Arguments] ${controller_ip} [Documentation] Will disable token based authentication. Currently, that is done with a config file change SSHLibrary.Open Connection ${controller_ip} - Login With Public Key ${CONTROLLER_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + Login With Public Key ${ODL_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any ${cmd}= Set Variable sed -i 's/^authEnabled=.*$/authEnabled=false/g' ${AUTHN_CFG_FILE} SSHLibrary.Execute Command ${cmd} SSHLibrary.Close Connection @@ -42,7 +40,7 @@ Enable Authentication On Controller [Arguments] ${controller_ip} [Documentation] Will enable token based authentication. Currently, that is done with a config file change SSHLibrary.Open Connection ${controller_ip} - Login With Public Key ${CONTROLLER_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + Login With Public Key ${ODL_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any ${cmd}= Set Variable sed -i 's/^authEnabled=.*$/authEnabled=true/g' ${AUTHN_CFG_FILE} SSHLibrary.Execute Command ${cmd} SSHLibrary.Close Connection @@ -60,7 +58,7 @@ 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 - ${resp}= RequestsLibrary.POST ODL_SESSION ${REVOKE_TOKEN_API} data=${token} headers=${headers} + ${resp}= RequestsLibrary.POST Request ODL_SESSION ${REVOKE_TOKEN_API} data=${token} headers=${headers} Should Be Equal As Strings ${resp.status_code} 204 Validate Token Format @@ -73,7 +71,7 @@ Get User From IDM DB [Documentation] Will return user information. If no user id is passed, it will retrieve all users in DB Create Session httpbin http://${ODL_SYSTEM_IP}:${RESTPORT} ${headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded - ${resp}= RequestsLibrary.GET httpbin ${idmurl}/users/${user_id} headers=${headers} + ${resp}= RequestsLibrary.GET Request httpbin ${idmurl}/users/${user_id} headers=${headers} Should Be Equal As Strings ${resp.status_code} 200 Log ${resp.content} [Return] ${resp} @@ -83,7 +81,7 @@ Create User [Documentation] Will return user information. If no user id is passed, it will retrieve all users in DB Create Session httpbin http://${ODL_SYSTEM_IP}:${RESTPORT} ${headers}= Create Dictionary Content-Type=application/json - ${resp}= RequestsLibrary.POST httpbin ${idmurl}/users headers=${headers} data=${user_data} + ${resp}= RequestsLibrary.POST Request httpbin ${idmurl}/users headers=${headers} data=${user_data} Should Be Equal As Strings ${resp.status_code} 201 Log ${resp.content} [Return] ${resp}