Commit 4c0a20dd authored by mengxuan.zhao's avatar mengxuan.zhao
Browse files

Update on VirtualisedResourcesQuotaAvailableNotification-API,...

Update on VirtualisedResourcesQuotaAvailableNotification-API, VNFFaultManagement-API, VNFLifecycleManagement-API
parent 424b5955
*** Settings ***
# Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml
Resource variables.txt
Library REST http://${VNFM_HOST}:${VNFM_PORT}
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}
... spec=SOL003-VNFFaultManagement-API.yaml
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Library OperatingSystem
*** Test cases ***
POST Alarms - Method not implemented
......@@ -11,7 +14,6 @@ POST Alarms - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiVersion}/alarms
Log Validate Status code
Output response
Integer response status 405
Get information about multiple alarms
......@@ -20,9 +22,14 @@ Get information about multiple alarms
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Log Execute Query and validate response
Get ${apiRoot}/${apiName}/${apiVersion}/alarms
Output response
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 alarm.schema.json ${json}
Log Validation OK
Get information about multiple alarms with filters
Log Query VNF The GET method queries information about multiple alarms with filters.
......@@ -30,18 +37,26 @@ Get information about multiple alarms with filters
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Log Execute Query and validate response
Get ${apiRoot}/${apiName}/${apiVersion}/alarms?${alarm_filter}=${managedObjectId}
Output response
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 alarm.schema.json ${json}
Log Validation OK
Get information about multiple alarms Bad Request Invalid attribute-based filtering parameters
Log Query VNF The GET method queries information about multiple VNF instances.
Log Query VNF The GET method queries information about multiple alarm instances.
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/alarms?${invalid_alarm_filter}=${managedObjectId}
Log Validate Status code
Output response
Integer response status 400
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
PUT Alarms - Method not implemented
log Trying to perform a PUT. This method should not be implemented
......@@ -49,7 +64,6 @@ PUT Alarms - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiVersion}/alarms
Log Validate Status code
Output response
Integer response status 405
PATCH Alarms - Method not implemented
......@@ -58,7 +72,6 @@ PATCH Alarms - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Patch ${apiRoot}/${apiName}/${apiVersion}/alarms
Log Validate Status code
Output response
Integer response status 405
DELETE Alarms - Method not implemented
......@@ -67,6 +80,5 @@ DELETE Alarms - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Delete ${apiRoot}/${apiName}/${apiVersion}/alarms
Log Validate Status code
Output response
Integer response status 405
*** Settings ***
# Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml
Resource variables.txt
Library REST http://${VNFM_HOST}:${VNFM_PORT}
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}
... spec=SOL003-VNFFaultManagement-API.yaml
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Library DependencyLibrary
*** Variables ***
......@@ -27,10 +29,15 @@ Get information about an alarm
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Log Execute Query and validate response
Get ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
Output response
${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 alarm.schema.json ${json}
Log Validation OK
PUT Alarm - Method not implemented
log Trying to perform a PUT. This method should not be implemented
......@@ -50,9 +57,14 @@ PATCH Alarm
${body}= Get File json/alarmModifications.json
Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body}
Log Validate Status code
Output response
${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 alarmModifications.schema.json ${json}
Log Validation OK
PATCH Alarm - Conflict
[Documentation] Conflict
......@@ -67,8 +79,11 @@ PATCH Alarm - Conflict
${body}= Get File json/alarmModifications.json
Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body}
Log Validate Status code
Output response
Integer response status 409
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
PATCH Alarm - Precondition failed
[Documentation] Precondition Failed
......@@ -84,8 +99,11 @@ PATCH Alarm - Precondition failed
${body}= Get File json/alarmModifications.json
Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body}
Log Validate Status code
Output response
Integer response status 412
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
DELETE Alarm - Method not implemented
log Trying to perform a DELETE. This method should not be implemented
......
*** Settings ***
Resource variables.txt
Library REST http://${VNFM_HOST}:${VNFM_PORT}
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}
... spec=SOL003-VNFFaultManagement-API.yaml
Documentation This resource represents an individual subscription for VNF alarms.
... The client can use this resource to read and to terminate a subscription to notifications related to VNF fault management.
......@@ -22,8 +24,13 @@ Get Information about an individual subscription
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Log Validate Status code
Output response
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 subscriptions.schema.json ${json}
Log Validation OK
PUT an individual subscription - Method not implemented
log Trying to perform a PUT. This method should not be implemented
......@@ -48,7 +55,7 @@ DELETE an individual subscription
log Try to delete an individual subscription
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Log Validate Status code
Output response
Integer response status 204
......
*** Settings ***
Resource variables.txt
Library REST http://${NFVO_HOST}:${NFVO_PORT}
... spec=SOL003-VNFFaultManagement-API.yaml
*** Test Cases ***
Deliver a notification - Operation Occurence
log The POST method delivers a notification from the server to the client.
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Post ${notification_ep} ${AlarmNotification}
Log Validate Status code
Output response
Integer response status 204
Deliver a notification - Id Creation
log The POST method delivers a notification from the server to the client.
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Post ${notification_ep} ${AlarmClearedNotification}
Log Validate Status code
Output response
Integer response status 204
Deliver a notification - Id deletion
log The POST method delivers a notification from the server to the client.
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Post ${notification_ep} ${AlarmListRebuiltNotification}
Log Validate Status code
Output response
Integer response status 204
Test a notification end point
log The GET method allows the server to test the notification endpoint
Get ${notification_ep}
Log Validate Status code
Output response
Integer response status 204
PUT notification - Method not implemented
log Trying to perform a PUT. This method should not be implemented
Put ${notification_ep}
Log Validate Status code
Output response
Integer response status 405
PATCH subscriptions - Method not implemented
log Trying to perform a PATCH. This method should not be implemented
Patch ${notification_ep}
Log Validate Status code
Output response
Integer response status 405
DELETE subscriptions - Method not implemented
log Trying to perform a DELETE. This method should not be implemented
Delete ${notification_ep}
Log Validate Status code
Output response
Integer response status 405
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
*** Settings ***
Resource variables.txt
Library REST http://${VNFM_HOST}:${VNFM_PORT}
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}
... spec=SOL003-VNFFaultManagement-API.yaml
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
*** Test Cases ***
Create a new subscription
......@@ -12,21 +14,33 @@ Create a new subscription
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File json/fmSubscriptionRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
Output response
Integer response status 201
Log Status code validated
${headers}= Output response headers
Should Contain ${headers} Location
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE}
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json subscriptions.schema.json ${json}
Log Validation OK
Create a new Subscription - DUPLICATION
Log Trying to create a subscription with an already created content
Pass Execution If ${NVFM_DUPLICATION} == 0 VNFM is not permitting duplication. Skipping the test
Pass Execution If ${NVFM_DUPLICATION} == 0 NVFO is not permitting duplication. Skipping the test
Set Headers {"Accept": "${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get File json/fmSubscriptionRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
Output response
Integer response status 201
Log Status code validated
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE}
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json subscriptions.schema.json ${json}
Log Validation OK
Create a new Subscription - NO-DUPLICATION
Log Trying to create a subscription with an already created content
......@@ -36,9 +50,11 @@ Create a new Subscription - NO-DUPLICATION
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get File json/fmSubscriptionRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
Output response
Integer response status 303
Log Status code validated
${headers}= Output response headers
Should Contain ${headers} Location
Log Validation OK
GET Subscriptions
Log Get the list of active subscriptions
......@@ -47,9 +63,12 @@ GET Subscriptions
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Log Execute Query and validate response
Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Output response
Log Validate Status code
Integer response status 200
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json subscriptions.schema.json ${json}
Log Validation OK
GET Subscription - Filter
Log Get the list of active subscriptions using a filter
......@@ -58,6 +77,10 @@ GET Subscription - Filter
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter}
Integer response status 200
Log Received a 200 OK as expected
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json subscriptions.schema.json ${json}
Log Validation OK
GET subscriptions - Bad Request Invalid attribute-based filtering parameters
Log Get the list of active subscriptions using an invalid filter
......@@ -66,6 +89,12 @@ GET subscriptions - Bad Request Invalid attribute-based filtering parameters
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid}
Integer response status 400
Log Received a 400 Bad Request as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE}
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
PUT subscriptions - Method not implemented
log Trying to perform a PUT. This method should not be implemented
......@@ -73,7 +102,6 @@ PUT subscriptions - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Log Validate Status code
Output response
Integer response status 405
PATCH subscriptions - Method not implemented
......@@ -82,7 +110,6 @@ PATCH subscriptions - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Log Validate Status code
Output response
Integer response status 405
DELETE subscriptions - Method not implemented
......@@ -91,6 +118,5 @@ DELETE subscriptions - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Log Validate Status code
Output response
Integer response status 405
\ No newline at end of file
{
"description": "The alarm data type encapsulates information about an alarm.\n",
"type": "object",
"required": [
"id",
"managedObjectId",
"rootCauseFaultyResource",
"alarmRaisedTime",
"ackState",
"perceivedSeverity",
"eventTime",
"eventType",
"probableCause",
"isRootCause",
"_links"
],
"properties": {
"id": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"managedObjectId": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"rootCauseFaultyResource": {
"description": "This type represents the faulty virtual resources that have a negative impact on a VNF.\n",
"type": "object",
"required": [
"faultyResource",
"faultyResourceType"
],
"properties": {
"faultyResource": {
"required": [
"vimConnectionId",
"resourceId"
],
"type": "object",
"description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
"properties": {
"vimConnectionId": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"resourceProviderId": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"resourceId": {
"description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
"type": "string"
},
"vimLevelResourceType": {
"description": "Type of the resource in the scope of the VIM or the resource provider.\n",
"type": "string"
}
}
},
"faultyResourceType": {
"description": "The enumeration FaultyResourceType represents those types of faulty resource.\n",
"type": "string",
"enum": [
"COMPUTE",
"STORAGE",
"NETWORK"
]
}
}
},
"alarmRaisedTime": {
"description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
"type": "string",
"format": "date-time"
},
"alarmChangedTime": {
"description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
"type": "string",
"format": "date-time"
},
"alarmClearedTime": {
"description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
"type": "string",
"format": "date-time"
},
"ackState": {
"description": "Acknowledgement state of the alarm. Permitted values: * UNACKNOWLEDGED * ACKNOWLEDGED.\n",
"type": "string",
"enum": [
"UNACKNOWLEDGED",
"ACKNOWLEDGED"
]
},
"perceivedSeverity": {
"description": "Indicates the relative level of urgency for operator attention. * CRITICAL: The Critical severity level indicates that a service affecting condition has occurred and an immediate corrective action\n is required. Such a severity can be reported, for example, when a\n managed object becomes totally out of service and its capability needs\n to be restored (ITU-T Recommendation X.733).\n* MAJOR: The Major severity level indicates that a service affecting condition has developed and an urgent corrective action is required.\n Such a severity can be reported, for example, when there is a severe\n degradation in the capability of the managed object and its full\n capability needs to be restored (ITU-T Recommendation X.733).\n* MINOR: The Minor severity level indicates the existence of a non-service affecting fault condition and that corrective action\n should be taken in order to prevent a more serious (for example,\n service affecting) fault. Such a severity can be reported, for\n example, when the detected alarm condition is not currently degrading\n the capacity of the managed object (ITU-T Recommendation X.733).\n* WARNING: The Warning severity level indicates the detection of a potential or impending service affecting fault, before any significant\n effects have been felt. Action should be taken to further diagnose (if\n necessary) and correct the problem in order to prevent it from\n becoming a more serious service affecting fault (ITU-T Recommendation\n X.733).\n* INDETERMINATE: The Indeterminate severity level indicates that the severity level cannot be determined (ITU-T Recommendation X.733).\n* CLEARED: The Cleared severity level indicates the clearing of one or more previously reported alarms. This alarm clears all alarms for this\n managed object that have the same Alarm type, Probable cause and\n Specific problems (if given) (ITU-T Recommendation X.733).\n",
"type": "string",
"enum": [
"CRITICAL",
"MAJOR",
"MINOR",
"WARNING",
"INDETERMINATE",
"CLEARED"
]
},
"eventTime": {
"description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
"type": "string",
"format": "date-time"
},
"eventType": {
"description": "The enumeration EventType represents those types of events that trigger an alarm. * COMMUNICATIONS_ALARM: An alarm of this type is associated with the procedure and/or process required conveying information from one point\n to another (ITU-T Recommendation X.733).\n* PROCESSING_ERROR_ALARM: An alarm of this type is associated with a software or processing fault (ITU-T Recommendation X.733).\n* ENVIRONMENTAL_ALARM: An alarm of this type is associated with a condition related to an enclosure in which the equipment resides\n (ITU-T Recommendation X.733).\n* QOS_ALARM: An alarm of this type is associated with degradation in the quality of a service (ITU-T Recommendation X.733).\n* EQUIPMENT_ALARM: An alarm of this type is associated with an equipment fault (ITU-T Recommendation X.733).\n",
"type": "string",
"enum": [
"COMMUNICATIONS_ALARM",
"PROCESSING_ERROR_ALARM",
"ENVIRONMENTAL_ALARM",
"QOS_ALARM",
"EQUIPMENT_ALARM"
]
},
"faultType": {
"description": "Additional information to clarify the type of the fault.\n",
"type": "string"
},
"probableCause": {
"description": "Information about the probable cause of the fault.\n",
"type": "string"
},
"isRootCause": {
"description": "Attribute indicating if this fault is the root for other correlated alarms. If TRUE, then the alarms listed in the attribute CorrelatedAlarmId are caused by this fault.\n",
"type": "boolean"
},
"correlatedAlarmIds": {
"description": "List of identifiers of other alarms correlated to this fault.\n",
"type": "array",
"items": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
}
},
"faultDetails": {
"description": "Provides additional information about the fault.\n",
"type": "array",
"items": {
"type": "string"
}
},
"_links": {
"description": "Links for this resource.\n",
"type": "object",
"required": [
"self"
],
"properties": {
"self": {
"description": "This type represents a link to a resource.\n",
"type": "object",
"required": [
"href"
],
"properties": {
"href": {
"description": "URI of the referenced resource.\n",
"type": "string",
"format": "url"
}
}
},
"objectInstance": {
"description": "This type represents a link to a resource.\n",
"type": "object",
"required": [
"href"
],
"properties": {
"href": {
"description": "URI of the referenced resource.\n",
"type": "string",
"format": "url"
}
}
}
}
}
}
}
\ No newline at end of file
{
"description": "This type represents attribute modifications for an \"Individual alarm\" resource, i.e. modifications to a resource representation based on the \"Alarm\" data type. The attributes of \"Alarm\" that can be modified are included in the \"AlarmModifications\" data type.\n",
"type": "object",
"required": [
"ackState"
],
"properties": {
"ackState": {
"description": "New value of the \"ackState\" attribute in \"Alarm\". Permitted values: * ACKNOWLEDGED\n",
"type": "string",
"enum": [
"ACKNOWLEDGED"
]
}
}
}
\ No newline at end of file
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "The definition of the gen