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

add documentation section to tests

parent de5e3885
......@@ -20,7 +20,15 @@ POST Configuration - Method not implemented
Log Validate Status code
Integer response status 405
Get information about a configuration
Get information about a configuration
[Documentation] Test ID: 9.4.2.1
... Test title: Get information about a configuration
... Test objective: The objective is to read configuration information about a VNF instance and/or its VNFC instances
... Pre-conditions:
... Reference: section 9.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
Log Query VNF The GET method queries information about a configuration.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
......@@ -46,6 +54,14 @@ PUT Config - Method not implemented
Integer response status 405
PATCH Config
[Documentation] Test ID: 9.4.2.2
... Test title: Set or modify a configuration resource
... Test objective: The objective is to set or modify a configuration resource
... Pre-conditions: A VNF instance and its VNFC instances exist
... Reference: section 9.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions: Configuration of the VNF instance and/or its VNFC instances has been set
log Trying to perform a PATCH. This method modifies the configuration
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
......@@ -63,10 +79,14 @@ PATCH Config
Log Validation OK
PATCH Config - Precondition failed
[Documentation] Precondition Failed
... Precondition Failed A precondition given in an HTTP request header is not fulfilled.
... Typically, this is due to an ETag mismatch, indicating that the resource was modified by another entity.
... The response body should contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error.
[Documentation] Test ID: 9.4.2.2-1
... Test title: Set or modify a configuration resource - Precondition failed
... Test objective: The objective is to set or modify a configuration resource, but a precondition given in an HTTP request header is not fulfilled
... Pre-conditions: A VNF instance and its VNFC instances exist, ETag modified in the meanwhile
... Reference: section 9.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified
log Trying to perform a PATCH. This method modifies an individual alarm resource
Set Headers {"Accept":"${ACCEPT}"}
......
......@@ -16,7 +16,15 @@ POST Alarms - Method not implemented
Log Validate Status code
Integer response status 405
Get information about multiple alarms
Get information about multiple alarms
[Documentation] Test ID: 7.4.2.1
... Test title: Get information about multiple alarms
... Test objective: The objective is to retrieve information about the alarm list
... Pre-conditions:
... Reference: section 7.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
Log Query VNF The GET method queries information about multiple alarms.
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
......@@ -32,6 +40,14 @@ Get information about multiple alarms
Log Validation OK
Get information about multiple alarms with filters
[Documentation] Test ID: 7.4.2.2
... Test title: Get information about multiple alarms - with filters
... Test objective: The objective is to retrieve information about the alarm list
... Pre-conditions:
... Reference: section 7.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
Log Query VNF The GET method queries information about multiple alarms with filters.
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
......@@ -47,6 +63,14 @@ Get information about multiple alarms with filters
Log Validation OK
Get information about multiple alarms Bad Request Invalid attribute-based filtering parameters
[Documentation] Test ID: 7.4.2.2-1
... Test title: Get information about multiple alarms - with Invalid attribute-based filtering parameters
... Test objective: The objective is to retrieve information about the alarm list
... Pre-conditions:
... Reference: section 7.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
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}"}
......
......@@ -6,7 +6,14 @@ Suite Setup Check resource existance
*** Test Cases ***
Escalate the perceived severity
[Documentation] escalate the perceived severity of an alarm with the VNFM
[Documentation] Test ID: 7.4.4.1
... Test title: Escalate the perceived severity
... Test objective: To enable the consumer to escalate the perceived severity of an alarm that is represented by an individual alarm resource.
... Pre-conditions: The resource representing the individual alarm has been created
... Reference: section 7.4.4 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
Log escalate the perceived severity of an alarm with the VNFM
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
......
......@@ -21,7 +21,15 @@ POST Alarm - Method not implemented
Log Validate Status code
Integer response status 405
Get information about a configuration
Get information about a configuration
[Documentation] Test ID: 7.4.3.1
... Test title: Get information about an alarm
... Test objective: The objective is to read an individual alarm.
... Pre-conditions: The related alarm exists
... Reference: section 7.4.3 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
Log Query VNF The GET method queries information about an alarm.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
......@@ -47,7 +55,14 @@ PUT Alarm - Method not implemented
Integer response status 405
PATCH Alarm
[Documentation] This method modifies an individual alarm resource
[Documentation] Test ID: 7.4.3.2
... Test title: Modify an individual alarm resource
... Test objective: The objective is to Modify an individual alarm resource
... Pre-conditions: The related alarm exists
... Reference: section 7.4.3 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
log Trying to perform a PATCH. This method modifies an individual alarm resource
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"}
......@@ -65,10 +80,14 @@ PATCH Alarm
Log Validation OK
PATCH Alarm - Conflict
[Documentation] Conflict
... The operation cannot be executed currently, due to a conflict with the state of the �Individual alarm� resource.
... Typically, this is due to the fact that the alarm is already in the state that is requested to be set (such as trying to acknowledge an already-acknowledged alarm).
... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error.
[Documentation] Test ID: 7.4.3.2-1
... Test title: Modify an individual alarm resource - Conflict
... Test objective: The objective is to Modify an individual alarm resource
... Pre-conditions: The related alarm exists
... Reference: section 7.4.3 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions: The alarm resource is not modified
Depends On Test PATCH Alarm # If the previous test scceeded, it means that the alarm is in ackownledged state
log Trying to perform a PATCH. This method modifies an individual alarm resource
Set Headers {"Accept":"${ACCEPT}"}
......@@ -84,10 +103,14 @@ PATCH Alarm - Conflict
Log Validation OK
PATCH Alarm - Precondition failed
[Documentation] Precondition Failed
... A precondition given in an HTTP request header is not fulfilled. Typically, this is due to an ETag mismatch,
... indicating that the resource was modified by another entity. The response body should contain a ProblemDetails structure,
... in which the �detail� attribute should convey more information about the error.
[Documentation] Test ID: 7.4.3.2-1
... Test title: Modify an individual alarm resource - Precondition failed
... Test objective: The objective is to Modify an individual alarm resource
... Pre-conditions: The related alarm exists
... Reference: section 7.4.3 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions: The alarm resource is not modified
Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified
log Trying to perform a PATCH. This method modifies an individual alarm resource
Set Headers {"Accept":"${ACCEPT}"}
......
......@@ -19,6 +19,14 @@ Post Individual Subscription - Method not implemented
Integer response status 405
Get Information about an individual subscription
[Documentation] Test ID: 7.4.6.1
... Test title: Retrieve the alarm subscriptions
... Test objective: The objective is to read an individual subscription for VNF alarms subscribed by the client
... Pre-conditions: The subscription with the given id exists
... Reference: section 7.4.6 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
log Trying to get information about an individual subscription
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
......
......@@ -7,25 +7,37 @@ Library Process
Library OperatingSystem
Library REST ${CONSUMER_SCHEMA}://${CONSUMER_HOST}:${notification_port}
*** Variables ***
${sleep_interval} 20s
*** Test Cases ***
Deliver a notification - Alarm
[Documentation] Test ID: 7.4.5.1
... Test title: Deliver a notification - Alarm
... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt.
... Pre-conditions: The VNF has subscribed to the VNFM alarm
... Reference: section 7.4.5 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
log The POST method delivers a notification - Information of a VNF alarm.
${json}= Get File schemas/alarmNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle alarmNotification
&{req}= Create Mock Request Matcher POST ${notification_ep} body_type="JSON_SCHEMA" body=${BODY}
&{req}= Create Mock Request Matcher POST ${notification_ep} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${notification_ep}
Deliver a notification - Alarm Clearance
[Documentation] Test ID: 7.4.5.2
... Test title: Deliver a notification - Alarm Clearance
... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt.
... Pre-conditions: The VNF has subscribed to the VNFM alarm
... Reference: section 7.4.5 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
log The POST method delivers a notification - Information of a VNF alarm.
${json}= Get File schemas/alarmClearedNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
......@@ -33,34 +45,48 @@ Deliver a notification - Alarm Clearance
&{req}= Create Mock Request Matcher POST ${notification_ep} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${notification_ep}
Deliver a notification - Alarm List Rebuilt
[Documentation] Test ID: 7.4.5.3
... Test title: Deliver a notification - Alarm List Rebuilt
... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt.
... Pre-conditions: The VNF has subscribed to the VNFM alarm
... Reference: section 7.4.5 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
log The POST method delivers a notification - Information of a VNF alarm.
${json}= Get File schemas/alarmListRebuiltNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle alarmNotification
&{req}= Create Mock Request Matcher POST ${notification_ep} body_type="JSON_SCHEMA" body=${BODY}
&{req}= Create Mock Request Matcher POST ${notification_ep} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${notification_ep}
Test a notification end point
[Documentation] Test ID: 7.4.5.4
... Test title: Test a notification end point
... Test objective: The objective is to allow the server to test the notification endpoint that is provided by the client, e.g. during subscription
... Pre-conditions:
... Reference: section 7.4.5 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
log The GET method allows the server to test the notification endpoint
&{req}= Create Mock Request Matcher GET ${notification_ep}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Verify Mock Expectation ${req}
Clear Requests ${notification_ep}
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${notification_ep}
Log Validate Status code
Integer response status 204
Log Validation OK
PUT notification - Method not implemented
log Trying to perform a PUT. This method should not be implemented
......@@ -87,4 +113,4 @@ DELETE subscriptions - Method not implemented
Create Sessions
Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${notification_port} alias=mockInstance
Wait For Process handle=mockInstance timeout=5s on_timeout=continue
Create Mock Session ${CONSUMER_SCHEMA}://${CONSUMER_HOST}:${notification_port} #The API producer is set to NFVO according to SOL003-7.3.4
\ No newline at end of file
Create Mock Session ${CONSUMER_SCHEMA}://${CONSUMER_HOST}:${notification_port} #The API producer is set to NFVO according to SOL002-7.3.4
\ No newline at end of file
......@@ -8,6 +8,14 @@ Library JSONSchemaLibrary schemas/
*** Test Cases ***
Create a new subscription
[Documentation] Test ID: 7.4.5.1
... Test title: Create a new alarm subscription
... Test objective: The objective is to create a new subscription.
... Pre-conditions: no subscription with the same filter and callbackUri exists
... Reference: section 7.4.5 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
......@@ -26,6 +34,14 @@ Create a new subscription
Log Validation OK
Create a new Subscription - DUPLICATION
[Documentation] Test ID: 7.4.5.2
... Test title: Create a new alarm subscription - DUPLICATION
... Test objective: The objective is to create a new subscription.
... Pre-conditions: subscription with the same filter and callbackUri exists
... Reference: section 7.4.5 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: the VNFM allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists
... Post-Conditions:
Log Trying to create a subscription with an already created content
Pass Execution If ${NVFM_DUPLICATION} == 0 NVFO is not permitting duplication. Skipping the test
Set Headers {"Accept": "${ACCEPT}"}
......@@ -43,6 +59,14 @@ Create a new Subscription - DUPLICATION
Log Validation OK
Create a new Subscription - NO-DUPLICATION
[Documentation] Test ID: 7.4.5.3
... Test title: Create a new alarm subscription - NO DUPLICATION
... Test objective: The objective is to create a new subscription.
... Pre-conditions: subscription with the same filter and callbackUri exists
... Reference: section 7.4.5 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: the VNFM decides to not create a duplicate subscription resource
... Post-Conditions:
Log Trying to create a subscription with an already created content
Pass Execution If ${NVFM_DUPLICATION} == 1 VNFM permits duplication. Skipping the test
Set Headers {"Accept": "${ACCEPT}"}
......@@ -57,6 +81,14 @@ Create a new Subscription - NO-DUPLICATION
Log Validation OK
GET Subscriptions
[Documentation] Test ID: 7.4.5.4
... Test title: Retrieve a list of alarm subscriptions
... Test objective: The objective is to retrieve the list of active subscriptions
... Pre-conditions:
... Reference: section 7.4.5 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
Log Get the list of active subscriptions
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
......@@ -71,6 +103,14 @@ GET Subscriptions
Log Validation OK
GET Subscription - Filter
[Documentation] Test ID: 7.4.5.5
... Test title: Retrieve a list of alarm subscriptions
... Test objective: The objective is to retrieve the list of active subscriptions with filter
... Pre-conditions:
... Reference: section 7.4.5 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
Log Get the list of active subscriptions using a filter
Set Headers {"Accept": "${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
......@@ -83,6 +123,14 @@ GET Subscription - Filter
Log Validation OK
GET subscriptions - Bad Request Invalid attribute-based filtering parameters
[Documentation] Test ID: 7.4.5.5-1
... Test title: Retrieve a list of alarm subscriptions
... Test objective: The objective is to retrieve the list of active subscriptions with Invalid attribute-based filtering parameters
... Pre-conditions:
... Reference: section 7.4.5 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
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}"}
......
......@@ -39,4 +39,5 @@ ${notification_port} 9091
${AlarmNotification} {}
${AlarmClearedNotification} {}
${AlarmListRebuiltNotification} {}
${PerceivedSeverity} CRITICAL
\ No newline at end of file
${PerceivedSeverity} CRITICAL
${sleep_interval} 20s
\ No newline at end of file
......@@ -19,7 +19,7 @@ Post Individual Subscription - Method not implemented
Integer response status 405
Get Information about an individual subscription
[Documentation] Test ID: 7.4.4.5
[Documentation] Test ID: 7.4.5.1
... Test title: Retrieve the alarm subscriptions
... Test objective: The objective is to read an individual subscription for VNF alarms subscribed by the client
... Pre-conditions: The subscription with the given id exists
......
......@@ -8,45 +8,54 @@ Library JSONSchemaLibrary schemas/
Documentation This resource represents grants. The client can use this resource to obtain permission
... from the NFVO to perform a particular VNF lifecycle operation.
*** Variables ***
${response} {}
*** Test Cases ***
Create a new Grant - Synchronous mode
Request a new Grant - Synchronous mode
[Documentation] Test ID: 9.4.2.1
... Test title: Requests a grant for a particular VNF lifecycle operation - Synchronous mode
... Test objective: The objective is to request a grant for a particular VNF lifecycle operation
... Pre-conditions:
... Reference: section 9.4.2 - SOL003 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: The NFVO can decide immediately what to respond to a grant request
... Post-Conditions: The grant information is available to the VNFM.
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
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File json/grantRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body}
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 grant.schema.json ${json}
Send Request Grant Request
Check HTTP Response Status Code Is 201
Check HTTP Response Header Contains Location
Check HTTP Response Body Json Schema Is grant.schema.json
Log Validation OK
Create a new Grant - Asynchronous mode
Request a new Grant - Asynchronous mode
[Documentation] Test ID: 9.4.2.2
... Test title: Requests a grant for a particular VNF lifecycle operation - Asynchronous mode
... Test objective: The objective is to request a grant for a particular VNF lifecycle operation
... Pre-conditions:
... Reference: section 9.4.2 - SOL003 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: The NFVO can not decide immediately what to respond to a grant request
... Post-Conditions: The grant information is available to the VNFM.
Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants
Pass Execution If ${SYNC_MODE} == 1 The Granting process is synchronous mode. 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/grantRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body}
Output response
Integer response status 202
Log Status code validated
${headers}= Output response headers
Should Contain ${headers} Location
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE}
Send Request Grant Request
Check HTTP Response Status Code Is 202
Check HTTP Response Header Contains Location
Check HTTP Response Body Json Schema Is grant.schema.json
Wait Until Keyword Succeeds 2 min 10 sec Get an individual grant - Successful
Log Validation OK
Create a new Grant - Forbidden
# TODO: How to set up the pre-condition for this test?
Request a new Grant - Forbidden
[Documentation] Test ID: 9.4.2.3
... Test title: Requests a grant for a particular VNF lifecycle operation - Forbidden
... Test objective: The objective is to request a grant for a particular VNF lifecycle operation
... Pre-conditions: The grant should not be accorded
... Reference: section 9.4.2 - SOL003 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants
Log The grant request should be rejected
Set Headers {"Accept": "${ACCEPT}"}
......@@ -56,7 +65,7 @@ Create a new Grant - Forbidden
Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body}
Integer response status 403
Log Status code validated
${problemDetails}= Output response body
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
......@@ -93,4 +102,41 @@ DELETE Grants - Method not implemented
Delete ${apiRoot}/${apiName}/${apiVersion}/grants
Log Validate Status code
Integer response status 405
*** Keywords ***
Send Request Grant Request
Set Headers {"Accept": "${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get File json/grantRequest.json
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body}
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
Should Be Equal ${response.status_code} ${expected_status}
Log Status code validated
Check HTTP Response Header Contains
[Arguments] ${CONTENT_TYPE}
Should Contain ${response.headers} ${CONTENT_TYPE}
Log Header is present
Check HTTP Response Body Json Schema Is
[Arguments] ${schema}
${json}= evaluate json.loads('''${response.body}''') json
Validate Json ${schema} ${json}
Log Json Schema Validation OK
Get an individual grant - Successful
log Trying to read an individual grant
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${response.headers.Location}
Log Validate Status code
Integer response status 200
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json grant.schema.json ${json}
Log Validation OK
\ No newline at end of file
......@@ -20,7 +20,14 @@ Post Individual Grant - Method not implemented
Integer response status 405
Get an individual grant - Successful
# TODO: How to set up the precondition?
[Documentation] Test ID: 9.4.3.1
... Test title: Requests a grant for a particular VNF lifecycle operation - Successful
... Test objective: The objective is to request a grant for a particular VNF lifecycle operation
... Pre-conditions: The related grant information is available to the VNFM
... Reference: section 9.4.3 - SOL003 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
log Trying to read an individual grant
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
......@@ -35,7 +42,14 @@ Get an individual grant - Successful
Log Validation OK
Get an individual grant - Process ongoing
# TODO: How to set up the precondition?
[Documentation] Test ID: 9.4.3.2
... Test title: Requests a grant for a particular VNF lifecycle operation - Process ongoing
... Test objective: The objective is to request a grant for a particular VNF lifecycle operation
... Pre-conditions: The process of creating the grant is ongoing, no grant is available yet.
... Reference: section 9.4.3 - SOL003 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability:
... Post-Conditions:
log Trying to read an individual grant
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
......@@ -44,7 +58,14 @@ Get an individual grant - Process ongoing