Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nfv/api-tests
  • reinaortega/api-tests
2 results
Show changes
Commits on Source (929)
Showing
with 1703 additions and 4102 deletions
/.project
/.pydevproject
/red.xml
build/
dist/
/libspecs/
#!/bin/bash
# Copyright ETSI 2018
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -vx
#set -e
cd "$(dirname "$0")"
run_dir="$(pwd)"
echo "Using git branch $GIT_BRANCH"
bash ./scripts/build-container.sh
ret=$?
if [ "$ret" != "0" ]; then
echo "build-container.sh failed"
exit -1
fi
bash ./scripts/run-container.sh "${run_dir}" "$GIT_BRANCH"
ret=$?
if [ "$ret" != "0" ]; then
echo "run-container.sh failed"
exit -1
fi
if [[ "$GIT_BRANCH" =~ .*fix-plu$ ]]; then
apiTestsVersion=$(echo $GIT_BRANCH | cut -d'/' -f 2)
apiTestsVersion=$(echo $apiTestsVersion | cut -d'-' -f 1)
echo apiTestsVersion
curl -X POST \
-F token=${ROBOT_HIVE_TAP_TT_TOKEN} \
-F ref=master \
-F "variables[API_TESTS_VERSION]=$apiTestsVersion" \
-F "variables[TEST_SUITE]=NFV" \
https://forge.etsi.org/rep/api/v4/projects/484/trigger/pipeline
fi
ret=$?
echo "Final validation result: $ret"
exit $ret
eclipse.preferences.version=1
encoding//libspecs/REST.py=utf-8
ETSI Software License
Copyright 2019-2020 ETSI
As long as the hereunder conditions are respected, non-exclusive permission is
hereby granted, free of charge, to use, reproduce and modify this software
source code, under the following conditions:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
- This source code is provided “AS IS” with no warranties, express or implied,
including but not limited to, the warranties of merchantability, fitness for
a particular purpose and warranties for non-infringement of intellectual
property rights. ETSI shall not be held liable in any event for any direct or
indirect damages whatsoever (including, without limitation, damages for loss
of profits, business interruption, loss of information, or any other pecuniary
loss) arising out of or related to the use of or inability to use the
source code.
- This permission is granted to facilitate the implementation of the related
ETSI standard, provided that ETSI is given the right to use, reproduce and
amend the modified source code under the same conditions as the
present permission.
- This permission does not apply to any documentation associated with this
source code for which ETSI keeps all rights reserved.
The present ETSI Source Code license shall be included in all copies of whole
or part of this source code and shall not imply any sub-license right.
\ No newline at end of file
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
# NFV API Conformance Test Specification
This repository hosts the NFV API Conformance test specification for
the APIs defined in ETSI NFV GS [SOL002](https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/02.04.01_60/gs_NFV-SOL002v020401p.pdf), [SOL003](https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.04.01_60/gs_NFV-SOL003v020401p.pdf), [SOL005](http://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/005/02.04.01_60/gs_NFV-SOL005v020401p.pdf), in their versions v2.4.1.
## Disclaimer
This repository contains working test cases implemented using the Robot
framework. It is provided for information only and is still under development.
The test cases may be updated, deleted, replaced, or obsoleted by other
contents at any time. As test cases are approved, they will be reflected
in the normative provisions of
[GS NFV-TST010](https://docbox.etsi.org/isg/nfv/open/Drafts/TST010_API_Conformance_Testing).
The material in this repository does not guarantee the full compliance
to the SOL specifications. The normative provisions of the test suite,
including the scope of the test cases, are still under development.
## Overview
The Test Specification is built as a collection of [Robot Framework](robotframework.org/) Test Description. [Robot Framework](robotframework.org/) is a generic test automation framework for acceptance testing and acceptance test-driven development.
**IMPORTANT: This repository and the NFV API Conformance Test Specification is Work in Progress. The current version focuses on conformance tests of individual SOL002 and SOL003 resource endpoints. The [Robot Framework](robotframework.org/) Test Descriptions are expected to be consolidated and reviewed in the short term, and possibly re-organized to ease automation of NFV workflows testing. SOL005 Test Descriptions are under development and will be contributed during Q1-2019.**
More information at [NFV API Conformance Test Specification wiki](https://forge.etsi.org/gitlab/nfv/api-tests/wikis/NFV-API-Conformance-Test-Specification).
# NFV API Conformance Test Specification (NFV-TST 010)
This repository hosts the NFV API Conformance test specification for
the APIs defined in ETSI NFV GS [SOL002](https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/02.08.01_60/gs_NFV-SOL002v020801p.pdf),
[SOL003](https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.08.01_60/gs_NFV-SOL003v020801p.pdf),
[SOL005](https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/005/02.08.01_60/gs_NFV-SOL005v020801p.pdf), in their versions
v2.8.1.
More information and download is available at [DGS/NFV-TST010ed281](https://portal.etsi.org/webapp/WorkProgram/Report_WorkItem.asp?WKI_ID=63121).
## Available versions
The NFV API Conformance test specification is available in the following versions:
| TST010 Version | SOL Specifications | API Conformance Tests |
|----------------------|-----------------------------------------------------------------------------------------|-----------------------------------------------------------|
| v2.4.1 | SOL002 SOL003 SOL005 v2.4.1 | [v2.4.1](https://forge.etsi.org/rep/nfv/api-tests/tree/2.4.1/) |
| v2.4.1-maintenance | SOL002 SOL003 SOL005 v2.4.1 | [v2.4.1-fix-plu](https://forge.etsi.org/rep/nfv/api-tests/tree/2.4.1-fix-plu/) |
| v2.6.1 | SOL002 SOL003 SOL005 v2.6.1 | [v2.6.1](https://forge.etsi.org/rep/nfv/api-tests/tree/2.6.1/) |
| v2.6.1-maintenance | SOL002 SOL003 SOL005 v2.6.1 | [v2.6.1-fix-plu](https://forge.etsi.org/rep/nfv/api-tests/tree/2.6.1-fix-plu/) |
| v2.7.1 | SOL002 SOL003 SOL005 v2.7.1 | [v2.7.1](https://forge.etsi.org/rep/nfv/api-tests/tree/2.7.1/) |
| v2.7.1-maintenance | SOL002 SOL003 SOL005 v2.7.1 | [v2.7.1-fix-plu](https://forge.etsi.org/rep/nfv/api-tests/tree/2.7.1-fix-plu/)
| v2.8.1 | SOL002 SOL003 SOL005 v2.8.1 | [v2.8.1](https://forge.etsi.org/rep/nfv/api-tests/tree/2.8.1/) |
| v2.8.1-maintenance | SOL002 SOL003 SOL005 v2.8.1 | [v2.8.1-fix-plu](https://forge.etsi.org/rep/nfv/api-tests/tree/2.8.1-fix-plu/)|
| v3.3.1 | SOL002 SOL003 SOL005 v3.3.1<br>SOL009 SOL011 v3.3.1<br>SOL012 v3.4.1 | [v3.3.1](https://forge.etsi.org/rep/nfv/api-tests/tree/3.3.1/) |
| v3.3.1-maintenance | SOL002 SOL003 SOL005 v3.3.1<br>SOL009 SOL011 v3.3.1<br>SOL012 v3.4.1 | [v3.3.1-fix-plu](https://forge.etsi.org/rep/nfv/api-tests/tree/3.3.1-fix-plu/) |
| v3.5.1 | SOL002 SOL003 SOL005 v3.5.1<br>SOL009 v3.5.1<br>SOL011 v3.3.1<br>SOL012 v3.4.1 | [v3.5.1](https://forge.etsi.org/rep/nfv/api-tests/tree/3.5.1/) |
| v3.5.1-maintenance | SOL002 SOL003 SOL005 v3.5.1<br>SOL009 v3.5.1<br>SOL011 v3.3.1<br>SOL012 v3.4.1 | [v3.5.1-fix-plu](https://forge.etsi.org/rep/nfv/api-tests/tree/3.5.1-fix-plu/) |
| v3.6.1 | SOL002 SOL003 SOL005 v3.6.1<br>SOL009 v3.6.1<br>SOL011 v3.3.1<br>SOL012 v3.4.1 | [v3.6.1](https://forge.etsi.org/rep/nfv/api-tests/tree/3.6.1/) |
| v3.6.1-maintenance | SOL002 SOL003 SOL005 v3.6.1<br>SOL009 v3.6.1<br>SOL011 v3.3.1<br>SOL012 v3.4.1 | [v3.6.1-fix-plu](https://forge.etsi.org/rep/nfv/api-tests/tree/3.6.1-fix-plu/) |
## Test Specification Overview
The Test Specification is built as a collection of [Robot Framework](robotframework.org/) Test Description. [Robot Framework](robotframework.org/) is a generic test automation framework for acceptance testing and acceptance
test-driven development.
More information at [NFV API Conformance Test Specification wiki](https://forge.etsi.org/rep/nfv/api-tests/wikis/NFV-API-Conformance-Test-Specification).
## How to raise issues
Change requests can be filed at [ETSI Forge Bugzilla](<LINK>). Please report errors, bugs or other issues [here](https://forge.etsi.org/bugzilla/enter_bug.cgi?product=NFV).
Please report errors, bugs or other issues [here](https://forge.etsi.org/rep/nfv/api-tests/issues).
## How to contribute
ETSI Forge uses Gitlab to manage submissions to the repository.
For more information on setting up your environment and contributing, you may refer to the [ETSI Forge wiki](https://forge.etsi.org/wiki/index.php/Main_Page).
## License
Copyright (c) ETSI 2018.
This software is subject to copyrights owned by ETSI. Non-exclusive permission
is hereby granted, free of charge, to copy, reproduce and amend this file
under the following conditions: It is provided "as is", without warranty of any
kind, expressed or implied.
ETSI shall never be liable for any claim, damages, or other liability arising
from its use or inability of use.This permission does not apply to any documentation
associated with this file for which ETSI keeps all rights reserved. The present
copyright notice shall be included in all copies of whole or part of this
file and shall not imply any sub-license right.
......@@ -2,7 +2,7 @@
This folder includes the NFV API conformance test descriptions for NFV SOL002 APIs.
The reference spec version is v2.4.1: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/02.04.01_60/gs_NFV-SOL002v020401p.pdf
The reference spec version is v2.7.1: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/02.07.01_60/gs_NFV-SOL002v020701p.pdf
## License
......
*** Settings ***
Resource environment/variables.txt
Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT} ssl_verify=false
Library DependencyLibrary
Library JSONLibrary
Library JSONSchemaLibrary schemas/
*** Test Cases ***
POST API Version - Method not implemented
[Documentation] Test ID: 6.3.1.2.1
... Test title: POST API version - Method not implemented
... Test objective: The objective is to test that POST method is not implemented
... Pre-conditions: none
... Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
POST API Version
Check HTTP Response Status Code Is 405
GET API Version
[Documentation] Test ID: 6.3.1.2.2
... Test title: GET API Version
... Test objective: The objective is to test that GET method successfully return ApiVersionInformation
... Pre-conditions: none
... Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
GET API Version
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is ApiVersionInformation
PUT API Version - Method not implemented
[Documentation] Test ID: 6.3.1.2.3
... Test title: PUT API Version - Method not implemented
... Test objective: The objective is to test that PUT method is not implemented
... Pre-conditions: none
... Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
PUT API Version
Check HTTP Response Status Code Is 405
PATCH API Version - Method not implemented
[Documentation] Test ID: 6.3.1.2.4
... Test title: PATCH API Version - Method not implemented
... Test objective: The objective is to test that PATCH method is not implemented
... Pre-conditions: none
... Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
PATCH API Version
Check HTTP Response Status Code Is 405
DELETE API Version - Method not implemented
[Documentation] Test ID: 6.3.1.2.5
... Test title: DELETE API Version - Method not implemented
... Test objective: The objective is to test that DELETE method is not implemented
... Pre-conditions: none
... Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
DELETE API Version
Check HTTP Response Status Code Is 405
POST API Version with apiMajorVerion - Method not implemented
[Documentation] Test ID: 6.3.1.2.6
... Test title: POST API version with apiMajorVerion - Method not implemented
... Test objective: The objective is to test that POST method is not implemented
... Pre-conditions: none
... Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
POST API Version
Check HTTP Response Status Code Is 405
GET API Version with apiMajorVerion
[Documentation] Test ID: 6.3.1.2.7
... Test title: GET API Version with apiMajorVerion
... Test objective: The objective is to test that GET method successfully return ApiVersionInformation
... Pre-conditions: none
... Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
GET API Version
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is ApiVersionInformation
PUT API Version with apiMajorVerion - Method not implemented
[Documentation] Test ID: 6.3.1.2.8
... Test title: PUT API Version with apiMajorVerion - Method not implemented
... Test objective: The objective is to test that PUT method is not implemented
... Pre-conditions: none
... Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
PUT API Version
Check HTTP Response Status Code Is 405
PATCH API Version with apiMajorVerion - Method not implemented
[Documentation] Test ID: 6.3.1.2.9
... Test title: PATCH API Version with apiMajorVerion - Method not implemented
... Test objective: The objective is to test that PATCH method is not implemented
... Pre-conditions: none
... Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
PATCH API Version
Check HTTP Response Status Code Is 405
DELETE API Version with apiMajorVerion - Method not implemented
[Documentation] Test ID: 6.3.1.2.10
... Test title: DELETE API Version with apiMajorVerion - Method not implemented
... Test objective: The objective is to test that DELETE method is not implemented
... Pre-conditions: none
... Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
DELETE API Version
Check HTTP Response Status Code Is 405
*** Keywords ***
POST API Version
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Post ${apiRoot}/${apiName}/api_versions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
GET API Version
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Get ${apiRoot}/${apiName}/api_versions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
PUT API Version
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Put ${apiRoot}/${apiName}/api_versions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
PATCH API Version
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Patch ${apiRoot}/${apiName}/api_versions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
DELETE API Version
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Delete ${apiRoot}/${apiName}/api_versions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
POST API Version with apiMajorVersion
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
GET API Version with apiMajorVersion
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Get ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
PUT API Version with apiMajorVersion
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Put ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
PATCH API Version with apiMajorVersion
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Patch ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
DELETE API Version with apiMajorVersion
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Delete ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
Should Be Equal As Strings ${response['status']} ${expected_status}
Log Status code validated
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
${schema} = Catenate SEPARATOR= ${input} .schema.json
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
\ No newline at end of file
*** Settings ***
Resource environment/variables.txt
Library REST ${VNF_SCHEMA}://${VNF_HOST}:${VNF_PORT}
... spec=SOL002-VNFConfiguration-API.yaml
Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT} ssl_verify=false
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Library OperatingSystem
Library DependencyLibrary
*** Variables ***
${Etag}= an etag
${Etag_modified}= a modified etag
*** Test Cases ***
PATCH Set a new VNF Configuration
[Documentation] Test ID: 6.3.1.1.1
... Test title: PATCH Set a new VNF Configuration
... Test objective: The objective is to test the creation of a new VNF configuration and perform a JSON schema validation of the returned configuration data structure
... Pre-conditions: A VNF instance is instantiated
... Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v2.8.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers
... Post-Conditions: The configuration is successfully set in the VNF and it matches the issued configuration
Send VNF configuration
Check HTTP Response Status Code Is 200
Check HTTP Response Header Contains ETag
Check HTTP Response Body Json Schema Is vnfConfigModifications
Check Postcondition VNF Is Configured
*** Test cases ***
POST Configuration - Method not implemented
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiVersion}/configuration
Log Validate Status code
Integer response status 405
Get information about a VNF configuration
[Tags] no-etag
[Documentation] Test ID: 6.3.1.1.2
... Test title: Get information about a VNF configuration
... Test objective: The objective is to test the retrieval of an existing VNF instance configuration and perform a JSON schema validation of the collected configuration data structure
... Pre-conditions: A VNF instance is instantiated. The VNF instance is already configured.
... Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v2.8.1
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: none
Get VNF configuration
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is vnfConfiguration
Get information about a VNF configuration with HTTP Etag
[Tags] etag
[Documentation] Test ID: 6.3.1.1.3
... Test title: Get information about a VNF configuration with HTTP Etag
... Test objective: The objective is to test the retrieval of an existing VNF instance configuration, check the generation by the VNF of an HTTP Etag opaque identifier, and perform a JSON schema validation of the collected configuration data structure
... Pre-conditions: A VNF instance is instantiated. The VNF instance is already configured
... Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v2.8.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers
... Post-Conditions: none
Get VNF configuration
Check HTTP Response Status Code Is 200
Check HTTP Response Header Contains ETag
Check HTTP Response Body Json Schema Is vnfConfiguration
PATCH VNF Configuration - HTTP Etag precondition unsuccessful
[Tags] etag
[Documentation] Test ID: 6.3.1.1.4
... Test title: PATCH VNF Configuration - HTTP Etag precondition unsuccessful
... Test objective: The objective is to test the unsuccess in setting a duplication of VNF configuration identified by an already used HTTP Etag identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response.
... Pre-conditions: A VNF instance is instantiated. The VNF instance is already configured (Test ID 6.3.1.1.1) with a given HTTP Etag identifier.
... Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v2.8.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers
... Post-Conditions: The VNF configuration is not modified by the unsuccessful operation and it matches the configuration issued in Test ID 6.3.1.1.1
Send Duplicated VNF configuration
Check HTTP Response Status Code Is 412
Check HTTP Response Body Json Schema Is ProblemDetails
Check Postcondition VNF Configuration Unmodified (Implicit)
POST VNF Configuration - Method not implemented
[Documentation] Test ID: 6.3.1.1.5
... Test title: POST VNF Configuration - Method not implemented
... Test objective: The objective is to test that POST method is not allowed to create a new VNF configuration
... Pre-conditions: none
... Reference: Clause 9.4.2.3.1 - ETSI GS NFV-SOL 002 [2] v2.8.1
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: none
Send POST Request for VNF Configuration
Check HTTP Response Status Code Is 405
Get information about a configuration
PUT VNF Configuration - Method not implemented
[Documentation] Test ID: 6.3.1.1.6
... Test title: PUT VNF Configuration - Method not implemented
... Test objective: The objective is to test that PUT method is not allowed to modify an existing VNF configuration
... Pre-conditions: none
... Reference: Clause 9.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v2.8.1
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: none
Send PUT Request for VNF Configuration
Check HTTP Response Status Code Is 405
DELETE VNF Configuration - Method not implemented
[Documentation] Test ID: 6.3.1.1.7
... Test title: Delete VNF Configuration - Method not implemented
... Test objective: The objective is to test that DELETE method is not allowed to delete an existing VNF configuration
... Pre-conditions: none
... Reference: Clause 9.4.2.3.5 - ETSI GS NFV-SOL 002 [2] v2.8.1
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: none
Send DELETE Request for VNF Configuration
Check HTTP Response Status Code Is 405
*** Keywords ***
Get VNF configuration
Log Query VNF The GET method queries information about a configuration.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Log Execute Query and validate response
Get ${apiRoot}/${apiName}/${apiVersion}/configuration
${Etag}= Output response headers Etag
Log Validate Status code
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE}
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json vnfConfiguration.schema.json ${json}
Log Validation OK
PUT Config - Method not implemented
log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiVersion}/configuration
Log Validate Status code
Integer response status 405
Get ${apiRoot}/${apiName}/${apiMajorVersion}/configuration
${output}= Output response
Set Suite Variable ${response} ${output}
PATCH Config
log Trying to perform a PATCH. This method modifies the configuration
Send VNF configuration
log Trying to perform a PATCH. This method modifies the configuration
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File json/vnfConfigModifications.json
Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body}
Log Validate Status code
${Etag_modified}= Output response headers Etag
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE}
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json vnfConfigModifications.schema.json ${json}
Log Validation OK
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${body}= Get File jsons/vnfConfigModifications.json
Patch ${apiRoot}/${apiName}/${apiMajorVersion}/configuration ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
Should Be Equal As Strings ${response['status']} ${expected_status}
Log Status code validated
PATCH Config - Precondition failed
[Documentation] Precondition Failed
... Precondition Failed A precondition given in an HTTP request header is not fulfilled.
... Typically, this is due to an ETag mismatch, indicating that the resource was modified by another entity.
... The response body should contain a ProblemDetails structure, in which the “detail” attribute should convey more information about the error.
Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified
Check HTTP Response Header Contains
[Arguments] ${CONTENT_TYPE}
Log ${response['headers']}
Should Contain ${response['headers']} ${CONTENT_TYPE}
Log Header is present
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json
... ELSE Should Contain ${response['headers']['Content-Type']} application/json
${schema}= Catenate SEPARATOR= ${input} .schema.json
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
Check Postcondition VNF Configuration Unmodified (Implicit)
Log Check Implicit Postcondition
Check Postcondition VNF Is Configured
Check Postcondition VNF Is Configured
Log Check Postcondition for VNF Configuration
Get VNF configuration
${input_file}= Get File jsons/vnfConfigModifications.json
${input}= evaluate json.loads('''${input_file}''') json
Should Be Equal As Strings ${response['body']} ${input}
Send Duplicated VNF configuration
Depends On Test Send VNF configuration # If the previous test scceeded, it means that Etag has been modified
log Trying to perform a PATCH. This method modifies an individual alarm resource
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Set Headers {"If-Match": "${Etag}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File json/vnfConfigModifications.json
Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body}
Log Validate Status code
Integer response status 412
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Set Headers {"If-Match": "${etag}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${body}= Get File jsons/vnfConfigModifications.json
Patch ${apiRoot}/${apiName}/${apiMajorVersion}/configuration ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
DELETE Config - Method not implemented
log Trying to perform a DELETE. This method should not be implemented
Send POST Request for VNF Configuration
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/configuration
${output}= Output response
Set Suite Variable ${response} ${output}
Send PUT Request for VNF Configuration
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Put ${apiRoot}/${apiName}/${apiMajorVersion}/configuration
${output}= Output response
Set Suite Variable ${response} ${output}
Send DELETE Request for VNF Configuration
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Delete ${apiRoot}/${apiName}/${apiVersion}/configuration
Log Validate Status code
Integer response status 405
\ No newline at end of file
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Delete ${apiRoot}/${apiName}/${apiMajorVersion}/configuration
${output}= Output response
Set Suite Variable ${response} ${output}
\ No newline at end of file
*** Variables ***
${VNFM_HOST} localhost # Hostname of the VNFM
${VNFM_PORT} 8080 # Listening port of the VNFM
${VNF_HOST} localhost # Hostname of the NFVO
${VNF_PORT} 8081 # Listening port of the NFVO
${VNFM_SCHEMA} https
${VNF_SCHEMA} https
${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ==
${CONTENT_TYPE} application/json
${CONTENT_TYPE_PATCH} application/merge-patch+json
${Etag} an etag
${Etag_modified} 12345
${response}= httpresponse
${EM-VNF_HOST} localhost # Hostname of the NFVO
${EM-VNF_PORT} 8081 # Listening port of the NFVO
${EM-VNF_SCHEMA} https
${ACCEPT} application/json
${AUTH_USAGE} 1
${AUTHORIZATION_HEADER} Authorization
${AUTHORIZATION_TOKEN} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
${CONTENT_TYPE} application/json
${apiRoot} /
${apiName} vnfconfig
${apiVersion} v1
${AUTH_USAGE} 1
${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX
${alarm_filter} managedObjectId
${managedObjectId} 007c111c-38a1-42c0-a666-7475ecb1567c
${invalid_alarm_filter} badFilter
${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d
${vnfInstanceDescription} description vnf
${vnfInstanceDescription_Update} Updated description vnf
${SINGLE_FILE_VNFD} 1 # If VNFD is PLAIN TEXT
${ACCEPT_PLAIN} text/plain
${ACCEPT_ZIP} application/zip
${vnfPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c
${ARTIFACT_TYPE} application/octet-stream
${ARTIFACT_ID} artifactId
${WRONG_ACCEPT} application/json
${vnfLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d
${CancelMode} GRACEFUL
${LccnSubscriptionRequest} {}
${NVFM_DUPLICATION} 0
${sub_filter} filter
${sub_filter_invalid} filter_invalid
${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f
${notification_ep} /notification
${notification_port} 9091
${AlarmNotification} {}
${AlarmClearedNotification} {}
${AlarmListRebuiltNotification} {}
${PerceivedSeverity} CRITICAL
\ No newline at end of file
${apiMajorVersion} v1
${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX
\ No newline at end of file
......@@ -39,5 +39,6 @@
"dhcpServer": "string",
"vnfcSpecificData": {}
}
]
],
"vnfcConfigurationDataDeleteIds": []
}
\ No newline at end of file
{
"description": "This type represents API version information.\n",
"type": "object",
"required": [
"uriPrefix",
"apiVersions"
],
"properties": {
"uriPrefix": {
"description": "Specifies the URI prefix for the API, in the following form {apiRoot}/{apiName}/{apiMajorVersion}/.\n",
"type": "string"
},
"apiVersions": {
"description": "Version(s) supported for the API signaled by the uriPrefix attribute.\n",
"type": "array",
"items": {
"type": "object",
"required": [
"version"
],
"properties": {
"version": {
"description": "Identifies a supported version. The value of the version attribute shall be a version identifier as specified in clause 9.1 (SOL013).\n",
"type": "string"
},
"isDeprecated": {
"description": "If such information is available, this attribute indicates whether use of the version signaled by the version attribute is deprecated (true) or not (false).\nA deprecated version is still supported by the API producer but is recommended not to be used any longer. When a version is no longer supported, it does not appear in the response body.\n",
"type": "boolean"
},
"retirementDate": {
"description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
"type": "string",
"format": "date-time"
}
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.