*** Variables ***
# port is fixed in Jetty configuration, as well
-${URI} http://${CONTROLLER}:8282
+${URI} http://${ODL_SYSTEM_IP}:8282
# create lists for Domains, Roles and Users - that can be cleaned up upon Teardown
@{cleanup_domain_list}
@{cleanup_role_list}
# the ITEM is the area to look under... users, domains, roles, etc
${n1}= Set Variable auth/v1/${area_to_look}/${id}
# do the actual get
- ${resp} RequestsLibrary.Get httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Get Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 404
${id_string}= Convert To String ${id}
Should Contain ${resp.content} ${id_string}
[Arguments] ${domainid}
[Documentation] Execute GET command on specified single domain
${n1}= Set Variable auth/v1/domains/${domainid}
- ${resp} RequestsLibrary.Get httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Get Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 200
${domainid_string}= Convert To String ${domainid}
Should Contain ${resp.content} ${domainid_string}
[Arguments] ${domainid}
[Documentation] Execute GET command on specified single domain
${n1}= Set Variable auth/v1/domains/${domainid}
- ${resp} RequestsLibrary.Get httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Get Request httpbin ${n1} headers=${HEADERS}
Should Contain ${resp.content} ${domainid}
Log ${resp.content}
[Return] ${resp.content}
[Arguments] ${roleid}
[Documentation] Exercise REST command to GET a specific role, based on role-id
${n1}= Set Variable auth/v1/roles/${roleid}
- ${resp} RequestsLibrary.Get httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Get Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} ${roleid}
[Return] ${resp.content}
Get Domains
[Documentation] Execute getdomains GET command.
${n1}= Set Variable auth/v1/domains
- ${resp} RequestsLibrary.Get httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Get Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} "domains"
[Return] ${resp.content}
Get Roles
[Documentation] Execute GET command to obtain list of roles.
${n1}= Set Variable auth/v1/roles
- ${resp} RequestsLibrary.Get httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Get Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} "roles"
[Return] ${resp.content}
[Arguments] ${user}
[Documentation] Exercise REST command for users GET command.
${n1}= Set Variable auth/v1/users/${user}
- ${resp} RequestsLibrary.Get httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Get Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} ${user}
[Return] ${resp.content}
Get Users
[Documentation] GET the complete set of users.
${n1}= Set Variable auth/v1/users
- ${resp} RequestsLibrary.Get httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Get Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} ${user}
[Return] ${resp.content}
[Arguments] ${domain} ${data}
[Documentation] Exercise REST command for domains POST command.
${n1}= Set Variable auth/v1/domains
- ${resp} RequestsLibrary.Post httpbin ${n1} headers=${HEADERS} data=${data}
+ ${resp} RequestsLibrary.Post Request httpbin ${n1} headers=${HEADERS} data=${data}
Should Be Equal As Strings ${resp.status_code} 201
Should Contain ${resp.content} ${domain}
[Return] ${resp.content}
[Arguments] ${data}
[Documentation] Use POST REST command to create specified Role.
${n1}= Set Variable auth/v1/roles
- ${resp} RequestsLibrary.Post httpbin ${n1} headers=${HEADERS} data=${data}
+ ${resp} RequestsLibrary.Post Request httpbin ${n1} headers=${HEADERS} data=${data}
# HTTP/1.1 201 Created
Should Be Equal As Strings ${resp.status_code} 201
[Return] ${resp.content}
[Arguments] ${username} ${data}
[Documentation] Exercise REST command for users POST command.
${n1}= Set Variable auth/v1/users
- ${resp} RequestsLibrary.Post httpbin ${n1} headers=${HEADERS} data=${data}
+ ${resp} RequestsLibrary.Post Request httpbin ${n1} headers=${HEADERS} data=${data}
# grab the list of users, count the list, and then search the list for the specific user id
${users}= Get Users
${depth}= Nodecount ${users} users userid
[Arguments] ${data} ${domainid}
[Documentation] Update the specified domainid with a new name specified in domain-name
${n1}= Set Variable auth/v1/domains/${domainid}
- ${resp} RequestsLibrary.Put httpbin ${n1} headers=${HEADERS} data=${data}
+ ${resp} RequestsLibrary.Put Request httpbin ${n1} headers=${HEADERS} data=${data}
# Should Be Equal As Strings ${resp.status_code} 201
Log ${resp.content}
[Arguments] ${data} ${roleid}
[Documentation] Update the specified roleid with a new information name specified
${n1}= Set Variable auth/v1/roles/${roleid}
- ${resp} RequestsLibrary.Put httpbin ${n1} headers=${HEADERS} data=${data}
+ ${resp} RequestsLibrary.Put Request httpbin ${n1} headers=${HEADERS} data=${data}
# Should Be Equal As Strings ${resp.status_code} 201
Log ${resp.content}
[Arguments] ${data} ${userid}
[Documentation] Update the specified userid with a new information name specified
${n1}= Set Variable auth/v1/users/${userid}
- ${resp} RequestsLibrary.Put httpbin ${n1} headers=${HEADERS} data=${data}
+ ${resp} RequestsLibrary.Put Request httpbin ${n1} headers=${HEADERS} data=${data}
# Should Be Equal As Strings ${resp.status_code} 201
Log ${resp.content}
[Documentation] Delete the specified domain, by id
${n1}= Set Variable auth/v1/domains/${domainid}
Log ${n1}
- ${resp} RequestsLibrary.Delete httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Delete Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 204
Log ${resp.content}
[Arguments] ${userid}
[Documentation] Delete the specified user, by id
${n1}= Set Variable auth/v1/users/${userid}
- ${resp} RequestsLibrary.Delete httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Delete Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 204
Log ${resp.content}
[Arguments] ${roleid}
[Documentation] Use DELETE REST command to wipe out a Role created for testing.
${n1}= Set Variable auth/v1/roles/${roleid}
- ${resp} RequestsLibrary.Delete httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Delete Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 204
#Should NOT Contain ${resp.content} ${roleid}
[Return] ${resp.content}
[Documentation] Exercise REST POST command for posting a role to particular domain and user
${n1}= Set Variable auth/v1/domains/${domainid}/users/${userid}/roles
# now post it
- ${resp} RequestsLibrary.Post httpbin ${n1} headers=${HEADERS} data=${data}
+ ${resp} RequestsLibrary.Post Request httpbin ${n1} headers=${HEADERS} data=${data}
Should Be Equal As Strings ${resp.status_code} 201
[Return] ${resp.content}
[Documentation] Exercise REST GET command for roles in a specific domain and user
${n1}= Set Variable auth/v1/domains/${domainid}/users/${userid}/roles
# now get it
- ${resp} RequestsLibrary.Get httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Get Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 200
[Return] ${resp.content}
[Documentation] Exercise REST DELETE command for a grant by roleid
${n1}= Set Variable auth/v1/domains/${domainid}/users/${userid}/roles/${roleid}
# now delete it
- ${resp} RequestsLibrary.Delete httpbin ${n1} headers=${HEADERS}
+ ${resp} RequestsLibrary.Delete Request httpbin ${n1} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 204
[Return] ${resp.content}