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
Loading
Loading
Loading
Loading
+21 −9
Original line number Original line Diff line number Diff line
*** Settings ***
*** Settings ***
# Suite setup     Expect spec    SOL003-VNFLifecycleManagement-API.yaml
# Suite setup     Expect spec    SOL003-VNFLifecycleManagement-API.yaml
Resource    variables.txt 
Resource    variables.txt 
Library    REST    http://${VNFM_HOST}:${VNFM_PORT} 
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} 
...        spec=SOL003-VNFFaultManagement-API.yaml
...        spec=SOL003-VNFFaultManagement-API.yaml
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    OperatingSystem


*** Test cases ***
*** Test cases ***
POST Alarms - Method not implemented
POST Alarms - Method not implemented
@@ -11,7 +14,6 @@ POST Alarms - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Post    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Log    Validate Status code
    Log    Validate Status code
    Output    response
    Integer    response status    405
    Integer    response status    405


Get information about multiple alarms  
Get information about multiple alarms  
@@ -20,9 +22,14 @@ Get information about multiple alarms
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Output    response
    Log    Validate Status code
    Log    Validate Status code
    Integer    response status    200
    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 
Get information about multiple alarms with filters 
    Log    Query VNF The GET method queries 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}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${alarm_filter}=${managedObjectId} 
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${alarm_filter}=${managedObjectId} 
    Output    response
    Log    Validate Status code
    Log    Validate Status code
    Integer    response status    200
    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
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}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"} 
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${invalid_alarm_filter}=${managedObjectId} 
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${invalid_alarm_filter}=${managedObjectId} 
    Log    Validate Status code
    Log    Validate Status code
    Output    response
    Integer    response status    400
    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
PUT Alarms - Method not implemented
    log    Trying to perform a PUT. This method should not be 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}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Put    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Put    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Log    Validate Status code
    Log    Validate Status code
    Output    response
    Integer    response status    405
    Integer    response status    405


PATCH Alarms - Method not implemented
PATCH Alarms - Method not implemented
@@ -58,7 +72,6 @@ PATCH Alarms - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Log    Validate Status code
    Log    Validate Status code
    Output    response
    Integer    response status    405
    Integer    response status    405


DELETE Alarms - Method not implemented
DELETE Alarms - Method not implemented
@@ -67,6 +80,5 @@ DELETE Alarms - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Log    Validate Status code
    Log    Validate Status code
    Output    response
    Integer    response status    405
    Integer    response status    405
+24 −6
Original line number Original line Diff line number Diff line
*** Settings ***
*** Settings ***
# Suite setup     Expect spec    SOL003-VNFLifecycleManagement-API.yaml
# Suite setup     Expect spec    SOL003-VNFLifecycleManagement-API.yaml
Resource    variables.txt 
Resource    variables.txt 
Library    REST    http://${VNFM_HOST}:${VNFM_PORT} 
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} 
...        spec=SOL003-VNFFaultManagement-API.yaml
...        spec=SOL003-VNFFaultManagement-API.yaml
Library    OperatingSystem
Library    OperatingSystem
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    DependencyLibrary
Library    DependencyLibrary


*** Variables ***
*** Variables ***
@@ -27,10 +29,15 @@ Get information about an alarm
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    Output    response
    ${Etag}=    Output    response headers Etag
    ${Etag}=    Output    response headers Etag
    Log    Validate Status code
    Log    Validate Status code
    Integer    response status    200
    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
PUT Alarm - Method not implemented
    log    Trying to perform a PUT. This method should not be 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
    ${body}=    Get File    json/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Log    Validate Status code
    Log    Validate Status code
    Output    response
    ${Etag_modified}=    Output    response headers Etag
    ${Etag_modified}=    Output    response headers Etag
    Integer    response status    200
    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
PATCH Alarm - Conflict
    [Documentation]    Conflict
    [Documentation]    Conflict
@@ -67,8 +79,11 @@ PATCH Alarm - Conflict
    ${body}=    Get File    json/alarmModifications.json
    ${body}=    Get File    json/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Log    Validate Status code
    Log    Validate Status code
    Output    response
    Integer    response status    409
    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
PATCH Alarm - Precondition failed
    [Documentation]    Precondition Failed
    [Documentation]    Precondition Failed
@@ -84,8 +99,11 @@ PATCH Alarm - Precondition failed
    ${body}=    Get File    json/alarmModifications.json
    ${body}=    Get File    json/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Log    Validate Status code
    Log    Validate Status code
    Output    response
    Integer    response status    412
    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
DELETE Alarm - Method not implemented
    log    Trying to perform a DELETE. This method should not be implemented
    log    Trying to perform a DELETE. This method should not be implemented
+10 −3
Original line number Original line Diff line number Diff line
*** Settings ***
*** Settings ***
Resource    variables.txt 
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
...    spec=SOL003-VNFFaultManagement-API.yaml
Documentation    This resource represents an individual subscription for VNF alarms. 
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.
...    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}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Log    Validate Status code
    Log    Validate Status code
    Output    response
    Integer    response status    200
    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
PUT an individual subscription - Method not implemented
    log    Trying to perform a PUT. This method should not be 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
    log    Try to delete an individual subscription
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    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
    Log    Validate Status code
    Output    response
    Output    response
    Integer    response status    204
    Integer    response status    204
+0 −57
Original line number Original line Diff line number Diff line
*** 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
+3321 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading