Commit 58e6c041 authored by mengxuan.zhao's avatar mengxuan.zhao
Browse files

Merge branch 'master' of forge.etsi.org:nfv/stf-557/api-tests

parents 8694b12f 2749be02
Loading
Loading
Loading
Loading
+59 −0
Original line number Diff line number Diff line
@@ -19,6 +19,18 @@ GET all Packages
    ${json}=    evaluate    json.loads('''${result}''')    json
    Validate Json    vnfPkgInfo.schema.json    ${json}
    Log    Validation OK
    Log    Checking missing information for softwareImages element
    ${softwareImages}=    Get Value From Json    ${json}    $..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    ${json}    $..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    ${json}    $.._links
    Should Be Empty    ${links}
    Log    _links element is missing as excepted

GET all Packages - Filter
    Log    Trying to get all VNF Packages present in the NFVO Catalogue, using filter params
@@ -105,8 +117,35 @@ GET all Packages - all_fields
    Validate Json    links.schema.json    ${links[0]}
    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
    ${json}=    evaluate    json.loads('''${vnfPkgInfos}''')    json
    Log    Trying to validate response
    Validate Json    vnfPkgInfo.schema.json    ${json}
    Log    Validation OK
    Log    Checking missing information for softwareImages element
    ${softwareImages}=    Get Value From Json    ${json}    $..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    ${json}    $..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    ${json}    $.._links
    Should Be Empty    ${links}
    Log    _links element is missing as excepted

GET all Packages - 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 fields parameter
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?fields=${fields}
@@ -127,6 +166,26 @@ GET all Packages - fields
    Validate Json    additionalArtifacts.schema.json    ${additional_artifacts[0]}
    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
    ${json}=    evaluate    json.loads('''${vnfPkgInfos}''')    json
    Log    Checking missing information for softwareImages element
    ${softwareImages}=    Get Value From Json    ${json}    $..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    ${json}    $..additionalArtifacts
    Should Be Empty    ${additional_artifacts}
    Log    additionalArtifact element is missing as excepted

GET all PACKAGE (Negative: Not found)
    Log    Trying to perform a GET on a erroneous URI
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
+1 −0
Original line number Diff line number Diff line
@@ -15,3 +15,4 @@ ${apiVersion} v1
${apiName}        vnfpkgm
${FIELD_USAGE}    1
${NFVO_PLAIN}     1
${NFVO_FIELDS}    1
+46 −1
Original line number Diff line number Diff line
@@ -20,6 +20,10 @@ GET all Pm Jobs
    ${json}=    evaluate    json.loads('''${result}''')    json
    Validate Json    PmJob.schema.json    ${json}
    Log    Validation OK
    Log    Checking that reports element is missing
    ${reports}=    Get Value From Json    ${json}    $..reports
    Should Be Empty    ${reports}
    Log    Reports element is empty as expected

GET all Pm Jobs - Filter
    Log    Trying to get all PM Jobs present in the VNFM, using filter params
@@ -61,9 +65,27 @@ GET all Pm Jobs - all_fields
    Validate Json    links.schema.json    ${links[0]}
    Log    Validation for _links schema OK

GET all Pm Jobs - exclude_default
    Log    Trying to get all VNF Packages present in the VNFM, using filter params
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${VNFM_AUTH_USAGE} == 1    Set Headers    {"Authorization": "${VNFM_AUTHENTICATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?exclude_default
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    Log    Trying to validate response
    ${result}=    Output    response body
    ${json}=    evaluate    json.loads('''${result}''')    json
    Validate Json    PmJob.schema.json    ${json}
    Log    Validation OK
    Log    Checking that reports element is missing
    ${reports}=    Get Value From Json    ${json}    $..reports
    Should Be Empty    ${reports}
    Log    Reports element is empty as expected

GET all Pm Jobs - fields
    Log    Trying to get all VNF Packages present in the VNFM, using filter params
    Pass Execution If    ${VNFM_AUTH_USAGE} == 0    Skipping test as VNFM is not supporting 'fields'
    Pass Execution If    ${FIELDS_USAGE} == 0    Skipping test as VNFM is not supporting 'fields'
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${VNFM_AUTH_USAGE} == 1    Set Headers    {"Authorization": "${VNFM_AUTHENTICATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields}
@@ -84,6 +106,29 @@ GET all Pm Jobs - fields
    Validate Json    reports.schema.json    ${reports[0]}
    Log    Validation for reports schema OK

GET all Pm Jobs - exclude_fields
    Log    Trying to get all VNF Packages present in the VNFM, using filter params
    Pass Execution If    ${FIELDS_USAGE} == 0    Skipping test as VNFM is not supporting 'fields'
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${VNFM_AUTH_USAGE} == 1    Set Headers    {"Authorization": "${VNFM_AUTHENTICATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields}
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    Log    Trying to validate response
    ${result}=    Output    response body
    ${json}=    evaluate    json.loads('''${result}''')    json
    Validate Json    PmJob.schema.json    ${json}
    Log    Validation OK
    Log    Checking that reports element is missing
    ${reports}=    Get Value From Json    ${json}    $..reports
    Should Be Empty    ${reports}
    Log    Reports element is empty as expected
    Log    Checking that criteria element is missing
    ${criteria}=    Get Value From Json    ${json}    $..criteria
    Should Be Empty    ${criteria}
    Log    Criteria element is empty as expected

GET all Pm Jobs - Negative (wronge filter name)
    Log    Trying to get all PM Jobs present in the VNFM, using an erroneous filter param
    Set Headers    {"Accept": "${ACCEPT_JSON}"}