diff --git a/README.md b/README.md index 4eec5b6c89eb3da975db9b57b22bc947aaf852e8..f25cd2987da8ad17c0d82227f023c19ecdd72110 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ including the scope of the test cases, are still under development. 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.** +**IMPORTANT: This repository and the NFV API Conformance Test Specification is Work in Progress. The current version focuses on conformance tests of individual SOL002, SOL003 and SOL005 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.** More information at [NFV API Conformance Test Specification wiki](https://forge.etsi.org/gitlab/nfv/api-tests/wikis/NFV-API-Conformance-Test-Specification). diff --git a/SOL002/VNFFaultManagement-API/Alarms.robot b/SOL002/VNFFaultManagement-API/Alarms.robot index 22c32579fe0fd1139615f94056b3eabe0cb5559e..617fbb69e74e84a873a36e1b5b22e8f41d7b3894 100644 --- a/SOL002/VNFFaultManagement-API/Alarms.robot +++ b/SOL002/VNFFaultManagement-API/Alarms.robot @@ -227,7 +227,8 @@ GET Alarms Task with exclude_fields attribute selector Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/alarms?exclude_fields=${fields} ${output}= Output response - Set Suite Variable ${response} ${output} + Set Suite Variable ${response} ${output} + Check HTTP Response Status Code Is [Arguments] ${expected_status} Should Be Equal ${response.status_code} ${expected_status} diff --git a/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot b/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot index b02e4968dd80bc38a6deaa9ce8ca0dd0c60503e1..17d33ea630941482074c7349be3e35ac15eb50f6 100644 --- a/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot +++ b/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot @@ -243,13 +243,12 @@ DELETE instantiate individual vnfInstance Set Global Variable @{response} ${outputResponse} POST Scale vnfInstance - [Arguments] ${instanceId} Log Trying to Instantiate a vnf Instance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${instanceId}/scale ${body} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET Scale vnfInstance diff --git a/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot b/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot index 640109b4fc0432d96c27a514fc023240970a2b04..d433752a9731c3e7078d5fb10f6d1330c911f37e 100644 --- a/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot +++ b/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot @@ -136,8 +136,8 @@ GET Alarms Task with exclude_default attribute selector GET ${apiRoot}/${apiName}/${apiVersion}/alarms?exclude_default ${output}= Output response Set Suite Variable ${response} ${output} -GET VNF Packages with fields attribute selector - Log Trying to get all VNF Packages present in the NFVO Catalogue, using fields +GET Alarms Task with fields attribute selector + Log Trying to get all alarms 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}"} diff --git a/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot b/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot index 8c535e751cf91c98b18379014bde121b96e9bc13..9a4e3ca08766f9d62afbb1ed40c3d4526d53caf4 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot @@ -66,4 +66,14 @@ PATCH Individual VNF LCM Operation occurrences - Method not implemented ... Applicability: none ... Post-Conditions: none Delete multiple VNF instances - Check HTTP Response Status Code Is 405 \ No newline at end of file + Check HTTP Response Status Code Is 405 + +*** Keywords *** +Get multiple VNF instances + Log Query status information about multiple VNF lifecycle management operation occurrences. + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot index 7a37ef9bd51c70f9d27e1ed0201c62aef28a87ea..f94a5510c83efaa5592d954b527bf5ec6aa55779 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -366,15 +366,6 @@ POST Create a new vnfInstance ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} -Get multiple VNF instances - Log Query status information about multiple VNF lifecycle management operation occurrences. - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} - GET multiple vnfInstances Log Query VNF The GET method queries information about multiple VNF instances. Set Headers {"Accept":"${ACCEPT}"} @@ -492,7 +483,6 @@ PATCH individual vnfInstance log Trying to modify an individual VNF instance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Set Headers {"If-Match": "${original_etag}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/patchBodyRequest.json Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} diff --git a/SOL003/VNFLifecycleManagement-API/environment/variables.txt b/SOL003/VNFLifecycleManagement-API/environment/variables.txt index 7d2807f15318317f721dc18e54064a383fcea9d6..75ef919b56af5f33f0d0d05d1ec96d087e9815ac 100644 --- a/SOL003/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL003/VNFLifecycleManagement-API/environment/variables.txt @@ -16,7 +16,7 @@ ${sub_filter_invalid} filter_invalid ${notInstantiatedVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f - +${fields} criteria,objectInstanceIds ${vnfInstanceName} Test-VnfInstance ${vnfInstanceDescription} description vnf diff --git a/SOL003/VNFLifecycleOperationGranting-API/Grants.robot b/SOL003/VNFLifecycleOperationGranting-API/Grants.robot index 2a8aff781ea5a131a59d73c15c9c9e2a0ecf71a4..854d10f535c2c634a47bc5198fd04e69573f9b93 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/Grants.robot +++ b/SOL003/VNFLifecycleOperationGranting-API/Grants.robot @@ -9,7 +9,8 @@ Documentation This resource represents grants. The client can use this resour *** Variables *** ${response} {} -${wait_time} 2 min 10 sec +${retry} 2 min +${polling} 10 sec *** Test Cases *** Requests a grant for a particular VNF lifecycle operation - Synchronous mode @@ -105,7 +106,7 @@ DELETE Grants - Method not implemented *** Keywords *** Wait for individual grant successful notification - Wait Until Keyword Succeeds ${wait_time} Get an individual grant - Successful + Wait Until Keyword Succeeds ${retry} ${polling} Get an individual grant - Successful Send Request Grant Request in Synchronous mode Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants Pass Execution If ${SYNC_MODE} == 0 The Granting process is asynchronous mode. Skipping the test diff --git a/SOL005/NSFaultManagement-API/Subscriptions.robot b/SOL005/NSFaultManagement-API/Subscriptions.robot index 07af9073d97d4c0455df290ab3ec5ce3e71eb2b6..e371035c124ba2877db5fd8bb9453ce1baae9095 100644 --- a/SOL005/NSFaultManagement-API/Subscriptions.robot +++ b/SOL005/NSFaultManagement-API/Subscriptions.robot @@ -46,7 +46,7 @@ Create a new alarm subscription - NO DUPLICATION ... Config ID: Config_prod_NFVO ... Applicability: the NFVO decides to not create a duplicate subscription resource ... Post-Conditions: none - Post Create subscription - NO DUPLICATION + Post Create subscription - NO-DUPLICATION Check HTTP Response Status Code Is 303 Check Operation Occurrence Id Check HTTP Response Body Json Schema Is FmSubscription diff --git a/SOL005/NSFaultManagement-API/environment/variables.txt b/SOL005/NSFaultManagement-API/environment/variables.txt index 748cfcfa62b004c40e86b2bb95ef918e90d175f1..281669313364190cdf8f6c5c5e6f714cdceeaf93 100644 --- a/SOL005/NSFaultManagement-API/environment/variables.txt +++ b/SOL005/NSFaultManagement-API/environment/variables.txt @@ -4,6 +4,7 @@ ${NFVO_PORT} 8080 # Listening port of the VNFM ${NFVO_SCHEMA} https ${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== ${ACCEPT} application/json +${ACCEPT_JSON} application/json ${AUTH_USAGE} 1 ${alarm_filter} nsInstanceId ${nsInstanceId} 007c111c-38a1-42c0-a666-7475ecb1567c @@ -15,6 +16,10 @@ ${CONTENT_TYPE} application/json ${NFVO_ALLOWS_DUPLICATE_SUBS} 0 +${fields} criteria,objectInstanceIds + +${VNFM_ALLOWS_DUPLICATE_SUBS} 0 + ${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d ${invalidAlarmId} invalidAlramID ${Etag}= an etag diff --git a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot index 2715070695dbaebf8f5ac52bc63def0bfbd5bbcc..1ad0bf92812c86d9a44afd490c34cce84051b645 100644 --- a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot +++ b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot @@ -126,7 +126,7 @@ Check operation resource state is not FAILED_TEMP Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId} - String response body instantiationState != FAILED_TEMP + String response body instantiationState not FAILED_TEMP Check resource is finally failed Set Headers {"Accept":"${ACCEPT}"} @@ -954,6 +954,14 @@ GET subscriptions with filter ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} +Get subscriptions - invalid filter + Log Get the list of active subscriptions using an invalid filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + POST Individual Subscription log Trying to perform a POST. This method should not be implemented Set Headers {"Accept":"${ACCEPT}"} @@ -1057,27 +1065,5 @@ PUT notification Log Verifying results Verify Mock Expectation ${req} Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -PATCH subscriptions - Log PATCH Method not implemented - &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -DELETE subscriptions - Log DELETE Method not implemented - &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint} \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/environment/variables.txt b/SOL005/NSLifecycleManagement-API/environment/variables.txt index dc3f6467e5275c7a1e65a11f979e0aa319f5630e..9efaee81e5c3e94b7624517650be63cbf2042229 100644 --- a/SOL005/NSLifecycleManagement-API/environment/variables.txt +++ b/SOL005/NSLifecycleManagement-API/environment/variables.txt @@ -9,6 +9,7 @@ ${NFVO_SCHEMA} https ${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== ${CONTENT_TYPE} application/json ${CONTENT_TYPE_PATCH} application/merge-patch+json +${ACCEPT_JSON} application/json ${ACCEPT} application/json ${apiRoot} / ${apiName} nslcm @@ -16,6 +17,7 @@ ${apiVersion} v1 ${AUTH_USAGE} 1 ${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX ${nsInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${ConflictNsInstanceId} 007c111c-e602-4afa-8e13-962fb5a7d81d ${nsInstanceName} Test-nsInstance ${nsInstanceDescription} description ns ${nsInstanceDescription_Update} Updated description ns @@ -31,6 +33,7 @@ ${CancelMode} GRACEFUL ${NFVO_DUPLICATION} 0 ${sub_filter} filter ${sub_filter_invalid} filter_invalid +${fields} criteria,objectInstanceIds ${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${VnfLcmOperationOccurrenceNotification} {} ${VnfIdentifierCreationNotification} {}