Skip to content
Snippets Groups Projects
Commit db6621c3 authored by AHMADABB's avatar AHMADABB
Browse files

Initial WOrk on NSLCM SOL005

parent 9fc274a4
No related branches found
No related tags found
1 merge request!8Master
*** Settings ***
Resource environment/variables.txt
Resource NSLCMOperationKeywords.robot
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
*** Test Cases ***
Create a new NsInstance
Do POST New vnfInstance
Check HTTP Response Status Code Is 201
Check HTTP Response Header Contains Location
Check HTTP Response Header ContentType is ${CONTENT_TYPE}
Check HTTP Response Body Json Schema Is NsInstance.schema.json
Get information about multiple NS instances
Do GET NsInstances
Check HTTP Response Status Code Is 200
Check HTTP Response Header ContentType is ${CONTENT_TYPE}
Check HTTP Response Body Json Schema Is vnfInstances.schema.json
Log Validation OK
*** Settings ***
Resource environment/variables.txt
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Library OperatingSystem
*** Keywords ***
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
Log Validate Status code
Should Be Equal ${response[0]['status']} ${expected_status}
Log Status code validated
Check HTTP Response Header Contains
[Arguments] ${HEADER_TOCHECK}
Should Contain ${response[0]['headers']} ${HEADER_TOCHECK}
Log Header is present
Check HTTP Response Body Json Schema Is
[Arguments] ${schema}
Validate Json ${schema} ${response[0]['body']}
Log Json Schema Validation OK
Check HTTP Response Header ContentType is
[Arguments] ${expected_contentType}
Log Validate content type
Should Be Equal ${response[0]['headers']['Content-Type']} ${expected_contentType}
Log Content Type validated
Do POST New vnfInstance
Log Create NS instance by POST to ${apiRoot}/${apiName}/${apiVersion}/ns_instances
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/CreateNsRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances ${body}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do GET NsInstances
Log Query NS The GET method queries information about multiple NS instances.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/ns_instances
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
\ No newline at end of file
*** Variables ***
${VNFM_HOST} localhost # Hostname of the VNFM
${VNFM_PORT} 8080 # Listening port of the VNFM
${NFVO_HOST} localhost # Hostname of the NFVO
${NFVO_PORT} 8081 # Listening port of the NFVO
${VNFM_SCHEMA} https
${NFVO_SCHEMA} https
${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ==
${CONTENT_TYPE} application/json
${CONTENT_TYPE_PATCH} application/merge-patch+json
${ACCEPT} application/json
${apiRoot} /
${apiName} nslcm
${apiVersion} v1
${AUTH_USAGE} 1
${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX
${vnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f
${vnfInstanceName} Test-VnfInstance
${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
${VNFM_DUPLICATION} 0
${sub_filter} filter
${sub_filter_invalid} filter_invalid
${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f
${VnfLcmOperationOccurrenceNotification} {}
${VnfIdentifierCreationNotification} {}
${VnfIdentifierDeletionNotification} {}
${callback_uri} http://localhost
${callback_port} 9091
${callback_endpoint} /endpoint
${callback_endpoint_error} /endpoint_404
${sleep_interval} 20s
${response} {}
{
"CreateNsRequest": {
"type": "object",
"required": [
"nsdId",
"nsName",
"nsDescription"
],
"properties": {
"nsdId": {
"description": "Identifier of the NSD that defines the NS instance to be created.\n",
"$ref": "SOL005_def.yaml#/definitions/Identifier"
},
"nsName": {
"description": "Human-readable name of the NS instance to be created.\n",
"type": "string"
},
"nsDescription": {
"description": "Human-readable description of the NS instance to be created.\n",
"type": "string"
}
}
}
}
\ No newline at end of file
This diff is collapsed.
{
"NsInstance": {
"description": "This type represents a response for Query NS operation. It shall comply with the provisions defined in Table 6.5.2.10-1.\n",
"type": "object",
"required": [
"id",
"nsInstanceName",
"nsInstanceDescription",
"nsdId",
"nsdInfoId",
"nsState"
],
"properties": {
"id": {
"description": "Identifier of the NS instance.\n",
"$ref": "SOL005_def.yaml#/definitions/Identifier"
},
"nsInstanceName": {
"description": "Human readable name of the NS instance.\n",
"type": "string"
},
"nsInstanceDescription": {
"description": "Human readable description of the NS instance.\n",
"type": "string"
},
"nsdId": {
"description": "Identifier of the NSD on which the NS instance is based.\n",
"$ref": "SOL005_def.yaml#/definitions/Identifier"
},
"nsdInfoId": {
"description": "Identifier of the NSD information object on which the NS instance is based. This identifier was allocated by the NFVO.\n",
"$ref": "SOL005_def.yaml#/definitions/Identifier"
},
"flavourId": {
"description": "Identifier of the NS deployment flavor applied to the NS instance. This attribute shall be present if the nsState attribute value is INSTANTIATED.\n",
"$ref": "SOL005_def.yaml#/definitions/IdentifierInNsd"
},
"vnfInstance": {
"description": "Information on constituent VNF(s) of the NS instance.\n",
"type": "array",
"items": {
"$ref": "#/definitions/VnfInstance"
}
},
"pnfInfo": {
"description": "Information on the PNF(s) that are part of the NS instance.\n",
"type": "array",
"items": {
"$ref": "#/definitions/PnfInfo"
}
},
"virtualLinkInfo": {
"description": "Information on the VL(s) of the NS instance. This attribute shall be present if the nsState attribute value is INSTANTIATED and if the NS instance has specified connectivity.\n",
"type": "array",
"items": {
"$ref": "#/definitions/NsVirtualLinkInfo"
}
},
"vnffgInfo": {
"description": "Information on the VNFFG(s) of the NS instance.\n",
"type": "array",
"items": {
"$ref": "#/definitions/VnffgInfo"
}
},
"sapInfo": {
"description": "Information on the SAP(s) of the NS instance.\n",
"type": "array",
"items": {
"$ref": "#/definitions/SapInfo"
}
},
"nestedNsInstanceId": {
"description": "Identifier of the nested NS(s) of the NS instance.\n",
"type": "array",
"items": {
"$ref": "SOL005_def.yaml#/definitions/Identifier"
}
},
"nsState": {
"description": "The state of the NS instance. Permitted values: NOT_INSTANTIATED: The NS instance is terminated or not instantiated. INSTANTIATED: The NS instance is instantiated.\n",
"type": "string",
"enum": [
"NOT_INSTANTIATED",
"INSTANTIATED"
]
},
"nsScaleStatus": {
"description": "Status of each NS scaling aspect declared in the applicable DF, how \"big\" the NS instance has been scaled w.r.t. that aspect. This attribute shall be present if the nsState attribute value is INSTANTIATED.\n",
"type": "array",
"items": {
"$ref": "#/definitions/NsScaleInfo"
}
},
"additionalAffinityOrAntiAffinityRule": {
"description": "Information on the additional affinity or anti-affinity rule from NS instantiation operation. Shall not conflict with rules already specified in the NSD.\n",
"type": "array",
"items": {
"$ref": "#/definitions/AffinityOrAntiAffinityRule"
}
},
"_links": {
"type": "object",
"description": "Links to resources related to this resource.",
"required": [
"self"
],
"properties": {
"self": {
"description": "URI of this resource.\n",
"$ref": "SOL005_def.yaml#/definitions/Link"
},
"nestedNsInstances": {
"description": "Links to resources related to this notification.\n",
"type": "array",
"items": {
"$ref": "SOL005_def.yaml#/definitions/Link"
}
},
"instantiate": {
"description": "Link to the \"instantiate\" task resource, if the related operation is possible based on the current status of this NS instance resource (i.e. NS instance in NOT_INSTANTIATED state).\n",
"$ref": "SOL005_def.yaml#/definitions/Link"
},
"terminate": {
"description": "Link to the \"terminate\" task resource, if the related operation is possible based on the current status of this NS instance resource (i.e. NS instance is in INSTANTIATED state).\n",
"$ref": "SOL005_def.yaml#/definitions/Link"
},
"update": {
"description": "Link to the \"update\" task resource, if the related operation is possible based on the current status of this NS instance resource (i.e. NS instance is in INSTANTIATED state).\n",
"$ref": "SOL005_def.yaml#/definitions/Link"
},
"scale": {
"description": "Link to the \"scale\" task resource, if the related operation is supported for this NS instance, and is possible based on the current status of this NS instance resource (i.e. NS instance is in INSTANTIATED state).\n",
"$ref": "SOL005_def.yaml#/definitions/Link"
},
"heal": {
"description": "Link to the \"heal\" task resource, if the related operation is supported for this NS instance, and is possible based on the current status of this NS instance resource (i.e. NS instance is in INSTANTIATED state).\n",
"$ref": "SOL005_def.yaml#/definitions/Link"
}
}
}
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment