Commit f8601eee authored by Elian Kraja's avatar Elian Kraja
Browse files

Fixing AMY.robot, solving issue#5

parent 0f26987f
Pipeline #1594 failed with stage
in 0 seconds
...@@ -9,8 +9,7 @@ Library String ...@@ -9,8 +9,7 @@ Library String
*** Variable *** *** Variable ***
@{data} https|localhost|8080|/alcmi/v1/app_instances|POST|{"key":"value"} https|localhost|8080|/alcmi/v1/app_instances|GET https|localhost|8080|/alcmi/v1/app_instances|PUT @{data} /alcmi/v1/app_instances|POST|{"key":"value"} /alcmi/v1/app_instances|GET /alcmi/v1/app_instances|PUT
${token} Bearer InvalidToken
*** Test Cases *** *** Test Cases ***
Request access to all resources using no token Request access to all resources using no token
[Documentation] TP_MEC_MEX_ANY_001_NT [Documentation] TP_MEC_MEX_ANY_001_NT
...@@ -20,102 +19,110 @@ Request access to all resources using no token ...@@ -20,102 +19,110 @@ Request access to all resources using no token
[Tags] GENERIC_TESTS INCLUDE_UNDEFINED_SCHEMAS [Tags] GENERIC_TESTS INCLUDE_UNDEFINED_SCHEMAS
: FOR ${INDEX} IN RANGE 0 3 : FOR ${INDEX} IN RANGE 0 3
\ @{list} Split String ${data[${INDEX}]} separator=| max_split=-1 \ @{list} Split String ${data[${INDEX}]} separator=| max_split=-1
\ Perform a generic request using no token @{list[${INDEX}]} \ Perform a generic request using no token @{list}
\ Perform a generic request using invalid token @{data[${INDEX}]}
Request access to all resources using invalid token
[Documentation] TP_MEC_MEX_ANY_001_WT
... Check that a MEC API provider responds with an error when it
... receives a request with an invalid token
... ETSI GS MEC 009 1.1.1, clause 6.16.1
[Tags] GENERIC_TESTS INCLUDE_UNDEFINED_SCHEMAS
: FOR ${INDEX} IN RANGE 0 3
\ @{list} Split String ${data[${INDEX}]} separator=| max_split=-1
\ Perform a generic request using invalid token @{list}
*** Keywords *** *** Keywords ***
Perform a generic request using no token Perform a generic request using no token
[Arguments] @{params} [Arguments] @{params}
Run Keyword If '@{params[4]}' == "POST" Run Keyword If '@{params[1]}' == "POST"
... Perform a POST using no token ${params[0]} ${params[1]} ${params[2]} ${params[3]} ${params[5]} ... Perform a POST using no token ${params[0]} ${params[2]}
Run Keyword If '@{params[4]}' == "GET" Run Keyword If '@{params[1]}' == "GET"
... Perform a GET using no token ${params[0]} ${params[1]} ${params[2]} ${params[3]} ... Perform a GET using no token ${params[0]}
Run Keyword If '@{params[4]}' == "DELETE" Run Keyword If '@{params[1]}' == "DELETE"
... Perform a DELETE using no token ${params[0]} ${params[1]} ${params[2]} ${params[3]} ... Perform a DELETE using no token ${params[0]}
Run Keyword If '@{params[4]}' == "PUT" Run Keyword If '@{params[1]}' == "PUT"
... Perform a PUT using no token ${params[0]} ${params[1]} ${params[2]} ${params[3]} ${params[5]} ... Perform a PUT using no token ${params[0]} ${params[2]}
Run Keyword If '@{params[4]}' == "PATCH" Run Keyword If '@{params[1]}' == "PATCH"
... Perform a PATCH using no token ${params[0]} ${params[1]} ${params[2]} ${params[3]} ${params[5]} ... Perform a PATCH using no token ${params[0]} ${params[2]}
Perform a generic request using invalid token Perform a generic request using invalid token
[Arguments] @{params} [Arguments] @{params}
Run Keyword If '@{params[4]}' == "POST" Run Keyword If '@{params[1]}' == "POST"
... Perform a POST using invalid token ${token} ${params[0]} ${params[1]} ${params[2]} ${params[3]} ${params[5]} ... Perform a POST using invalid token ${params[0]} ${params[2]}
Run Keyword If '@{params[4]}' == "GET" Run Keyword If '@{params[1]}' == "GET"
... Perform a GET using invalid token ${token} ${params[0]} ${params[1]} ${params[2]} ${params[3]} ... Perform a GET using invalid token ${params[0]}
Run Keyword If '@{params[4]}' == "DELETE" Run Keyword If '@{params[1]}' == "DELETE"
... Perform a DELETE using invalid token ${token} ${params[0]} ${params[1]} ${params[2]} ${params[3]} ... Perform a DELETE using invalid token ${params[0]}
Run Keyword If '@{params[4]}' == "PUT" Run Keyword If '@{params[1]}' == "PUT"
... Perform a PUT using invalid token ${token} ${params[0]} ${params[1]} ${params[2]} ${params[3]} ${params[5]} ... Perform a PUT using invalid token ${params[0]} ${params[2]}
Run Keyword If '@{params[4]}' == "PATCH" Run Keyword If '@{params[1]}' == "PATCH"
... Perform a PATCH using invalid token ${token} ${params[0]} ${params[1]} ${params[2]} ${params[3]} ${params[5]} ... Perform a PATCH using invalid token ${params[0]} ${params[2]}
Perform a POST using no token Perform a POST using no token
[Arguments] ${schema} ${ip} ${port} ${uri} ${payload} [Arguments] ${uri} ${payload}
Log "Running post" Log "Running post"
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
POST ${schema}://${ip}:${port}/${uri} ${payload} POST ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
Log ${schema}://${ip}:${port}/${uri} ${payload} Log ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
${output}= Output response ${output}= Output response
Should Be Equal As Strings 401 ${output['status']} Should Be Equal As Strings 401 ${output['status']}
Perform a GET using no token Perform a GET using no token
[Arguments] ${schema} ${ip} ${port} ${uri} [Arguments] ${uri}
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Log ${schema}://${ip}:${port}/${uri} Log ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri}
GET ${schema}://${ip}:${port}/${uri} GET ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri}
${output}= Output response ${output}= Output response
Should Be Equal As Strings 401 ${output['status']} Should Be Equal As Strings 401 ${output['status']}
Perform a DELETE using no token Perform a DELETE using no token
[Arguments] ${schema} ${ip} ${port} ${uri} [Arguments] ${uri}
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Log ${schema}://${ip}:${port}/${uri} Log ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri}
DELETE ${schema}://${ip}:${port}/${uri} DELETE ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri}
${output}= Output response ${output}= Output response
Should Be Equal As Strings 401 ${output['status']} Should Be Equal As Strings 401 ${output['status']}
Perform a PUT using no token Perform a PUT using no token
[Arguments] ${schema} ${ip} ${port} ${uri} ${payload}=None [Arguments] ${uri} ${payload}=None
Log "Running post" Log "Running post"
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Log ${schema}://${ip}:${port}/${uri} ${payload} Log ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
PUT ${schema}://${ip}:${port}/${uri} ${payload} PUT ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
${output}= Output response ${output}= Output response
Should Be Equal As Strings 401 ${output['status']} Should Be Equal As Strings 401 ${output['status']}
Perform a PATCH using no token Perform a PATCH using no token
[Arguments] ${schema} ${ip} ${port} ${uri} ${payload}=None [Arguments] ${uri} ${payload}=None
Log "Running post" Log "Running post"
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Log ${schema}://${ip}:${port}/${uri} ${payload} Log ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
PATCH ${schema}://${ip}:${port}/${uri} ${payload} PATCH ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
${output}= Output response ${output}= Output response
Should Be Equal As Strings 401 ${output['status']} Should Be Equal As Strings 401 ${output['status']}
Perform a POST using invalid token Perform a POST using invalid token
[Arguments] ${token} ${schema} ${ip} ${port} ${uri} ${payload}=None [Arguments] ${uri} ${payload}=None
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Authorization":"${token}"} Set Headers {"Authorization":"${token}"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Log ${schema}://${ip}:${port}/${uri} ${payload} Log ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
POST ${schema}://${ip}:${port}/${uri} ${payload} POST ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
${output}= Output response ${output}= Output response
Should Be Equal As Strings 401 ${output['status']} Should Be Equal As Strings 401 ${output['status']}
...@@ -123,44 +130,44 @@ Perform a POST using invalid token ...@@ -123,44 +130,44 @@ Perform a POST using invalid token
Perform a GET using invalid token Perform a GET using invalid token
[Arguments] ${token} ${schema} ${ip} ${port} ${uri} [Arguments] ${uri}
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Authorization":"${token}"} Set Headers {"Authorization":"${token}"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Log ${schema}://${ip}:${port}/${uri} Log ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri}
GET ${schema}://${ip}:${port}/${uri} GET ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri}
${output}= Output response ${output}= Output response
Should Be Equal As Strings 401 ${output['status']} Should Be Equal As Strings 401 ${output['status']}
Perform a DELETE using invalid token Perform a DELETE using invalid token
[Arguments] ${token} ${schema} ${ip} ${port} ${uri} [Arguments] ${uri}
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Authorization":"${token}"} Set Headers {"Authorization":"${token}"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Log ${schema}://${ip}:${port}/${uri} Log ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri}
DELETE ${schema}://${ip}:${port}/${uri} DELETE ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri}
${output}= Output response ${output}= Output response
Should Be Equal As Strings 401 ${output['status']} Should Be Equal As Strings 401 ${output['status']}
Perform a PUT using invalid token Perform a PUT using invalid token
[Arguments] ${token} ${schema} ${ip} ${port} ${uri} ${payload}=None [Arguments] ${uri} ${payload}=None
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Authorization":"${token}"} Set Headers {"Authorization":"${token}"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Log ${schema}://${ip}:${port}/${uri} ${payload} Log ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
PUT ${schema}://${ip}:${port}/${uri} ${payload} PUT ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
${output}= Output response ${output}= Output response
Should Be Equal As Strings 401 ${output['status']} Should Be Equal As Strings 401 ${output['status']}
Perform a PATCH using invalid token Perform a PATCH using invalid token
[Arguments] ${token} ${schema} ${ip} ${port} ${uri} ${payload}=None [Arguments] ${uri} ${payload}=None
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Authorization":"${token}"} Set Headers {"Authorization":"${token}"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Log ${schema}://${ip}:${port}/${uri} ${payload} Log ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
PATCH ${schema}://${ip}:${port}/${uri} ${payload} PATCH ${PROVIDER_SCHEMA}://${PROVIDER_HOST}:${PROVIDER_PORT}/${uri} ${payload}
${output}= Output response ${output}= Output response
Should Be Equal As Strings 401 ${output['status']} Should Be Equal As Strings 401 ${output['status']}
...@@ -4,9 +4,4 @@ ${PROVIDER_SCHEMA} http ...@@ -4,9 +4,4 @@ ${PROVIDER_SCHEMA} http
${PROVIDER_HOST} 10.192.2.172 ${PROVIDER_HOST} 10.192.2.172
${PROVIDER_PORT} 8081 ${PROVIDER_PORT} 8081
${response} {} ${response} {}
${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l ${token} Basic YWxhZGRpbjpvcGVuc2VzYW1l
${apiRoot}
${apiName} apmi
${apiVersion} v1
${INVALID_TOKEN} INVALID_TOKEN
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment