Commit 2ad234c8 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added new tests for feasibility check

parent 70868527
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -16,11 +16,25 @@ POST Instantiate a nsInstance
    ...    Reference: Clause 6.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS instance is instantiated on the NFVO
    ...    Post-Conditions: none
    POST Instantiate nsInstance
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location
    Check resource INSTANTIATED
    Check Operation Occurrence Id

POST Instantiate a nsInstance with feasibility check only
    [Documentation]    Test ID: 5.3.2.3.1a
    ...    Test title: POST Instantiate a nsInstance with feasibility check
    ...    Test objective: The objective is to test that POST method instantiate a new NS instance with feasibility check only
    ...    Pre-conditions: An NS instance created and it is in NOT_INSTANTIATED state
    ...    Reference: Clause 6.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    POST Instantiate nsInstance with feasibility check only
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location
    Check Operation Occurrence Id

POST Instantiate a nsInstance Conflict
    [Documentation]    Test ID: 5.3.2.3.2
@@ -34,7 +48,6 @@ POST Instantiate a nsInstance Conflict
    POST Instantiate nsInstance
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails
    Check resource not_instantiated
    
GET Instantiate NSInstance - Method not implemented
    [Documentation]    Test ID: 5.3.2.3.3
+43 −4
Original line number Diff line number Diff line
@@ -595,6 +595,18 @@ GET Instantiate NSInstance
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
POST Instantiate nsInstance with feasibility check only
    Log    Trying to Instantiate a ns Instance
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File
    ${template}=    Get File    jsons/InstantiateNs_withFeasibilityCheck.json
    ${body}=        Format String   ${template}     nsFlavourId=${nsFlavourId}   vimAccountId=${vimAccountId}   nsdId=${nsdId}    sapdId=${SAP_IDs[0]}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId}/instantiate    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
DELETE Scale NSInstance
    log    Trying to delete an Scale NS instance. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
@@ -688,6 +700,19 @@ POST Update NSInstance
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
 
POST Update NSInstance with feasibility check only
	Log    Trying to Instantiate a Update NS Instance
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${check_descriptors} == 1    PARSE the Descriptor File
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File  
    ${template} =    Get File    jsons/UpdateNsRequest_withFeasibilityCheck.json
    ${body}=        Format String   ${template}     vnfdId=${descriptor_id}    vnfFlavourId=${Flavour_ID}    newFlavourId=${Flavour_ID}    vnfVirtualLinkDescId=${VirtualLink_IDs[0]}    instantiationLevelId=${InstantiationLevel_IDs[1]}    vnfInstantiationLevelId=${InstantiationLevel_IDs[0]}    newNsdId=${NS_DescriptorID}    sapdId=${SAP_IDs[0]}    vnfInstanceId=${vnfInstanceId}    
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId}/update    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

DELETE Heal NSInstance
    log    Trying to Delete an Heal NS instance. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
@@ -894,10 +919,24 @@ PUT Individual NS LCM OP Occurrence
	Set Global Variable    ${response}    ${outputResponse}
	
PATCH Individual NS LCM OP Occurrence
    log    Trying to perform a PATCH. This method should not be implemented
    log    Trying to perform a PATCH.
    Set Headers  {"Accept":"${ACCEPT}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${body}=    Get File    jsons/NsLcmInfoModificationRequest.json
    ${body}=        Format String   ${body}     scheduledTime=${schedule_for_new_operation_start}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_lcm_op_occs/${nsLcmOpOccId_scheduledOp_notStarted}    ${body}	 	
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

PATCH Individual NS LCM OP Occurrence of Already Started Scheduled Operation 
    log    Trying to perform a PATCH.
    Set Headers  {"Accept":"${ACCEPT}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_lcm_op_occs/${nsLcmOpOccId} 	 	
    ${body}=    Get File    jsons/NsLcmInfoModificationRequest.json
    ${body}=        Format String   ${body}     scheduledTime=${schedule_for_new_operation_start}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_lcm_op_occs/${nsLcmOpOccId_scheduledOp_alreadyStarted}    ${body}	 	
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

+13 −0
Original line number Diff line number Diff line
@@ -21,6 +21,19 @@ POST Update a NSInstance
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location

POST Update a NSInstance with feasibility check only
    [Documentation]    Test ID: 5.3.2.5.1a
    ...    Test title: POST Update a NSInstance
    ...    Test objective: The objective is to test that POST method update a NS instance with feasibility check only
    ...    Pre-conditions: An NS instance is in INSTANTIATED state
    ...    Reference: Clause 6.4.6.3.1 - ETSI GS NFV-SOL 005 [3] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    POST Update NSInstance with feasibility check only
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location

POST Update a NSInstance - Conflict (Not Instantited)
    [Documentation]    Test ID: 5.3.2.5.2
    ...    Test title: POST Update a NSInstance - Conflict (Not Instantited)
+5 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ ${AUTHORIZATION_TOKEN} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
${CONTENT_TYPE}    application/json
${ACCEPT_JSON}         application/json
${ACCEPT}         application/json
${CONTENT_TYPE_PATCH}    application/merge-patch+json
${apiRoot}        /
${apiName}        nslcm
${apiMajorVersion}     v2
@@ -23,6 +24,8 @@ ${nsFlavourId} 0
${nsDegreeHealing}      HEAL_RESTORE
${vimAccountId}      	931f6a4d-6a97-43f3-a6f0-13853ef577ea
${nsLcmOpOccId}    6fc3539c-e602-4afa-8e13-962fb5a7d81d
${nsLcmOpOccId_scheduledOp_notStarted}    6fc3539c-e602-4afa-8e13-962fb5a7d81d
${nsLcmOpOccId_scheduledOp_alreadyStarted}    6fc3539c-e602-4afa-8e13-962fb5a7d81d
${NFVO_DUPLICATION}    0
${sub_filter}    id=41fdd38a-3d4c-465c-83e0-f80e014425f8
${sub_filter_invalid}    nfvid=41fdd38a-3d4c-465c-83e0-f80e014425f8
@@ -31,6 +34,8 @@ ${fields_nsInstances} monitoringParameter,wanConnectionInfo
${POS_filter_nsInstances}    id=41fdd38a-3d4c-465c-83e0-f80e014425f8
${NEG_filter_nsInstances}    nfvid=41fdd38a-3d4c-465c-83e0-f80e014425f8 

${schedule_for_new_operation_start}    2023-05-12T07:20:50.52Z

${fields_nsLcmOpOcc}    cancelMode,error
${POS_filter_nsLcmOpOcc}    id=41fdd38a-3d4c-465c-83e0-f80e014425f8
${NEG_filter_nsLcmOpOcc}    nfvid=41fdd38a-3d4c-465c-83e0-f80e014425f8 
+17 −0
Original line number Diff line number Diff line
{
	"nsFlavourId": "flavour_id",
	"sapData":[
		"{sapdId}"
	],
	"addpnfData":[],
	"vnfInstanceData":[],
	"nestedNsInstanceData":[],
	"locationConstraints":[],
	"nestedNsLocationConstraints":[],
	"additionalParamsForNs":{},
	"additionalParamForNestedNs":[],
	"additionalParamsForVnf":[],
	"startTime": "",
	"nsInstantiationLevelId": "",
	"feasibilityCheckReserve": "FEASIBILITY_CHECK_ONLY"
}
 No newline at end of file
Loading