"SOL003/git@forge.etsi.org:nfv/api-tests.git" did not exist on "2e63adf7930cf42ede64a26980749de54e25772f"
Newer
Older
Elian Kraja
committed
*** Settings ***
Resource environment/vnfPackages.txt # VNF Packages specific parameters
Library JSONSchemaLibrary schemas/
Resource environment/variables.txt # Generic Parameters
Elian Kraja
committed
Library JSONLibrary
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Elian Kraja
committed
*** Test Cases ***
GET all Packages
Log Trying to get all VNF Packages present in the NFVO Catalogue
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
Elian Kraja
committed
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Elian Kraja
committed
Log Trying to validate response
Elian Kraja
committed
Log Validation OK
Log Checking missing information for softwareImages element
${softwareImages}= Get Value From Json ${result} $..softwareImages
Should Be Empty ${softwareImages}
Log softwareImages element is missing as excepted
Log Checking missing information for additionalArtifact element
${additional_artifacts}= Get Value From Json ${result} $..additionalArtifacts
Should Be Empty ${additional_artifacts}
Log additionalArtifact element is missing as excepted
Log Checking missing information for _links element
Should Be Empty ${links}
Log _links element is missing as excepted
Elian Kraja
committed
GET all Packages - Filter
Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${POS_FILTER}
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Elian Kraja
committed
Log Trying to validate response
Elian Kraja
committed
Log Validation OK
GET all Packages - Negative (wronge filter name)
Log Trying to perform a negative get, filtering by the inexistent filter 'nfvId'
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${NEG_FILTER}
Elian Kraja
committed
Log Received 400 Bad Request as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Elian Kraja
committed
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
Validate Json ProblemDetails.schema.json ${problemDetails}
Elian Kraja
committed
Log Validation OK
GET all Packages - Negative (Unauthorized: Wrong Token)
Log Trying to perform a negative get, using wrong authorization bearer
Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Authorization": "${NEG_AUTHORIZATION}"}
Elian Kraja
committed
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages
Elian Kraja
committed
Log Received 401 Unauthorized as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Elian Kraja
committed
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
Validate Json ProblemDetails.schema.json ${problemDetails}
Elian Kraja
committed
Log Validation OK
GET all Packages - Negative (Unauthorized: No Token)
Log Trying to perform a negative get, using wrong authorization bearer
Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication
Set Headers {"Accept": "${ACCEPT_JSON}"}
Elian Kraja
committed
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages
Elian Kraja
committed
Log Received 401 Unauthorized as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Elian Kraja
committed
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
Validate Json ProblemDetails.schema.json ${problemDetails}
Elian Kraja
committed
Log Validation OK
GET all Packages - all_fields
Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
Elian Kraja
committed
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?all_fields
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
${vnfPkgInfos}= Output response body
Elian Kraja
committed
Log Trying to validate response
Validate Json vnfPkgsInfo.schema.json ${vnfPkgInfos}
Elian Kraja
committed
Log Validation OK
Log Trying to validate softwareImages schema
${softwareImages}= Get Value From Json ${vnfPkgInfos} $..softwareImages
Validate Json softwareImage.schema.json ${softwareImages[0]}
Elian Kraja
committed
Log Validation for softwareImage schema OK
Log Trying to validate additionalArtifacts schema
${additional_artifacts}= Get Value From Json ${vnfPkgInfos} $..additionalArtifacts
Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]}
Elian Kraja
committed
Log Validation for additionalArtifacts schema OK
${links}= Get Value From Json ${vnfPkgInfos} $.._links
Validate Json links.schema.json ${links[0]}
Elian Kraja
committed
Log Validation for _links schema OK
GET all Packages - exclude_default
Log Trying to get all VNF Packages present in the NFVO Catalogue, using exclude_default filter.
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exclude_default
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
${vnfPkgInfos}= Output response body
Log Trying to validate response
Validate Json vnfPkgsInfo.schema.json ${vnfPkgInfos}
Log Validation OK
Log Checking missing information for softwareImages element
${softwareImages}= Get Value From Json ${vnfPkgInfos} $..softwareImages
Should Be Empty ${softwareImages}
Log softwareImages element is missing as excepted
Log Checking missing information for additionalArtifact element
${additional_artifacts}= Get Value From Json ${vnfPkgInfos} $..additionalArtifacts
Should Be Empty ${additional_artifacts}
Log additionalArtifact element is missing as excepted
Log Checking missing information for _links element
${links}= Get Value From Json ${vnfPkgInfos} $.._links
Should Be Empty ${links}
Log _links element is missing as excepted
Elian Kraja
committed
GET all Packages - fields
Log Trying to get all VNF Packages present in the NFVO Catalogue, using fields
Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use fields parameter
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
Elian Kraja
committed
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?fields=${fields}
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
${vnfPkgInfos}= Output response body
Elian Kraja
committed
Log Trying to validate response, checking vnfPkgInfo and other complex attributes included in the vnfPkgInfo
Validate Json vnfPkgsInfo.schema.json ${vnfPkgInfos}
Elian Kraja
committed
Log Validation for vnfPkgInfo OK
Log Trying to validate softwareImages schema
${softwareImages}= Get Value From Json ${vnfPkgInfos} $..softwareImages
Validate Json softwareImage.schema.json ${softwareImages[0]}
Elian Kraja
committed
Log Validation for softwareImage schema OK
Log Trying to validate additionalArtifacts schema
${additional_artifacts}= Get Value From Json ${vnfPkgInfos} $..additionalArtifacts
Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]}
Elian Kraja
committed
Log Validation for additionalArtifacts schema OK
GET all Packages - exclude_fields
Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params
Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use exclude_fields option
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exlude_fields=${fields}
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
${vnfPkgInfos}= Output response body
Log Checking missing information for softwareImages element
${softwareImages}= Get Value From Json ${vnfPkgInfos} $..softwareImages
Should Be Empty ${softwareImages}
Log softwareImages element is missing as excepted
Log Checking missing information for additionalArtifact element
${additional_artifacts}= Get Value From Json ${vnfPkgInfos} $..additionalArtifacts
Should Be Empty ${additional_artifacts}
Log additionalArtifact element is missing as excepted
Elian Kraja
committed
GET all PACKAGE (Negative: Not found)
Log Trying to perform a GET on a erroneous URI
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
Elian Kraja
committed
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_package
Elian Kraja
committed
Log Received 404 Not Found as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Elian Kraja
committed
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
Validate Json ProblemDetails.schema.json ${problemDetails}
Elian Kraja
committed
Log Validation OK
POST all PACKAGE (Method not implemented)
Log Trying to perform a POST (method should not be implemented)
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
Elian Kraja
committed
POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages
Elian Kraja
committed
Log Received 405 Method not implemented as expected
PUT all PACKAGE (Method not implemented)
Log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
Elian Kraja
committed
PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages
Elian Kraja
committed
Log Received 405 Method not implemented as expected
PATCH all PACKAGE (Method not implemented)
Log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages
Integer response status 405
Elian Kraja
committed
Log Received 405 Method not implemented as expected
DELETE all PACKAGE (Method not implemented)
Log Trying to perform a DELETE. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
Elian Kraja
committed
DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages
Elian Kraja
committed
Log Received 405 Method not implemented as expected