Commit 404a7fce authored by Elian Kraja's avatar Elian Kraja
Browse files

Bug Fix on SOL002

parent cbe2eeb6
*** Settings ***
Resource environments/variables.txt
Library REST ${VNF_SCHEMA}://${VNF_HOST}:${VNF_PORT}
Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
... spec=SOL002-VNFConfiguration-API.yaml
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Library OperatingSystem
Library DependencyLibrary
*** Variables ***
${Etag}= an etag
${Etag_modified}= a modified etag
*** Test Cases ***
POST Configuration - Method not implemented
log Trying to perform a POST. This method should not be implemented
......
*** Variables ***
${VNFM_HOST} localhost # Hostname of the VNFM
${VNFM_PORT} 8080 # Listening port of the VNFM
${VNF_HOST} localhost # Hostname of the NFVO
${VNF_PORT} 8081 # Listening port of the NFVO
${VNFM_SCHEMA} https
${VNF_SCHEMA} https
${EM-VNF_HOST} localhost # Hostname of the NFVO
${EM-VNF_PORT} 8081 # Listening port of the NFVO
${EM-VNF_SCHEMA} https
${ACCEPT} application/json
${AUTH_USAGE} 1
${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ==
${CONTENT_TYPE} application/json
${CONTENT_TYPE_PATCH} application/merge-patch+json
${ACCEPT} application/json
${apiRoot} /
${apiName} vnfconfig
${apiVersion} v1
${AUTH_USAGE} 1
${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX
${alarm_filter} managedObjectId
${managedObjectId} 007c111c-38a1-42c0-a666-7475ecb1567c
${invalid_alarm_filter} badFilter
${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d
${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
${LccnSubscriptionRequest} {}
${NVFM_DUPLICATION} 0
${sub_filter} filter
${sub_filter_invalid} filter_invalid
${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f
${notification_ep} /notification
${notification_port} 9091
${AlarmNotification} {}
${AlarmClearedNotification} {}
${AlarmListRebuiltNotification} {}
${PerceivedSeverity} CRITICAL
\ No newline at end of file
${apiVersion} v1
${Etag}= an etag
${Etag_modified}= a modified etag
......@@ -8,9 +8,6 @@ Library JSONLibrary
Library JSONSchemaLibrary schemas/
Library DependencyLibrary
*** Variables ***
${Etag}= an etag
${Etag_modified}= a modified etag
*** Test Cases ***
POST Alarm - Method not implemented
......
......@@ -5,10 +5,6 @@ Suite Teardown Terminate All Processes kill=true
Library MockServerLibrary
Library Process
Library OperatingSystem
Library REST ${CONSUMER_SCHEMA}://${CONSUMER_HOST}:${notification_port}
*** Variables ***
${sleep_interval} 20s
*** Test Cases ***
Deliver a notification - Alarm
......@@ -16,75 +12,75 @@ Deliver a notification - 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 Schema POST ${notification_ep} body=${BODY}
&{req}= Create Mock Request Matcher Schema POST ${callback_uri} body=${BODY}
&{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${notification_ep}
Clear Requests ${callback_uri}
Deliver a notification - Alarm Clearance
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
Log Creating mock request and response to handle alarmNotification
&{req}= Create Mock Request Matcher Schema POST ${notification_ep} body=${BODY}
&{req}= Create Mock Request Matcher Schema POST ${callback_uri} body=${BODY}
&{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${notification_ep}
Clear Requests ${callback_uri}
Deliver a notification - Alarm List Rebuilt
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 Schema POST ${notification_ep} body=${BODY}
&{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY}
&{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${notification_ep}
Clear Requests ${callback_endpoint}
Test a notification end point
log The GET method allows the server to test the notification endpoint
&{req}= Create Mock Request Matcher Schema GET ${notification_ep}
&{req}= Create Mock Request Matcher Schema GET ${callback_endpoint}
&{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Verify Mock Expectation ${req}
Clear Requests ${notification_ep}
Clear Requests ${callback_endpoint}
PUT notification - Method not implemented
log Trying to perform a PUT. This method should not be implemented
Put ${notification_ep}
Put ${callback_endpoint}
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}
Patch ${callback_endpoint}
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}
Delete ${callback_endpoint}
Log Validate Status code
Output response
Integer response status 405
*** Keywords ***
Create Sessions
Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${notification_port} alias=mockInstance
Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_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 ${callback_schema}://${callback_uri}:${callback_port} #The API producer is set to NFVO according to SOL003-7.3.4
\ No newline at end of file
......@@ -27,7 +27,7 @@ Create a new subscription
Create a new Subscription - DUPLICATION
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
Pass Execution If ${VNFM_DUPLICATION} == 0 VNFM 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}"}
......
*** Variables ***
${VNFM_HOST} localhost # Hostname of the VNFM
${VNFM_PORT} 8080 # Listening port of the VNFM
${CONSUMER_HOST} localhost # Hostname of the NFVO
${CONSUMER_PORT} 8081 # Listening port of the NFVO
${VNFM_SCHEMA} https
${CONSUMER_SCHEMA} https
${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ==
${CONTENT_TYPE} application/json
${CONTENT_TYPE_PATCH} application/merge-patch+json
${ACCEPT} application/json
${apiRoot} /
${apiName} vnffm
${apiVersion} v1
${apiVersion} v1
${AUTH_USAGE} 1
${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX
${alarm_filter} managedObjectId
${managedObjectId} 007c111c-38a1-42c0-a666-7475ecb1567c
${invalid_alarm_filter} badFilter
${CONTENT_TYPE} application/json
${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d
${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
${LccnSubscriptionRequest} {}
${NVFM_DUPLICATION} 0
${Etag}= an etag
${Etag_modified}= a modified etag
${CONTENT_TYPE_PATCH} application/merge-patch+json
${PerceivedSeverity} CRITICAL
${VNFM_DUPLICATION} 0
${sub_filter} filter
${sub_filter_invalid} filter_invalid
${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f
${notification_ep} /notification
${notification_port} 9091
${sleep_interval} 20s
${callback_schema} http
${callback_uri} localhost
${callback_port} 9091
${callback_endpoint} /notification
${AlarmNotification} {}
${AlarmClearedNotification} {}
${AlarmListRebuiltNotification} {}
${PerceivedSeverity} CRITICAL
\ No newline at end of file
*** Settings ***
Library JSONSchemaLibrary schemas/
Resource environment/generic.txt # Generic Parameters
Resource environment/variables.txt # Generic Parameters
Resource environment/individualSubscription.txt
Library OperatingSystem
Library REST ${PRODUCER_SCHEMA}://${PRODUCER_HOST}:${PRODUCER_PORT}
Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
*** Test Cases ***
GET Individual Subscription
Log Trying to get a given subscription identified by subscriptionId
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 200
Log Received a 200 OK as expected
......@@ -24,7 +24,7 @@ GET Individual Subscription
GET Subscription - Negative (Not Found)
Log Trying to perform a request on a subscriptionID which doesn't exist
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
Integer response status 404
Log Received 404 Not Found as expected
......@@ -39,7 +39,7 @@ GET Subscription - Negative (Not Found)
DELETE Subscription
Log Trying to perform a DELETE on a subscriptionId
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 204
Log Received 204 No Content as expected
......@@ -47,7 +47,7 @@ DELETE Subscription
DELETE Subscription - Negative (Not Found)
Log Trying to perform a DELETE on a subscriptionId which doesn't exist
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
Integer response status 404
Log The subscriptionId is not present in database
......@@ -62,7 +62,7 @@ DELETE Subscription - Negative (Not Found)
PUT Subscription - (Method not implemented)
Log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUHORIZATION}"}
PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 405
Log Received 405 Method not implemented as expected
......@@ -70,7 +70,7 @@ PUT Subscription - (Method not implemented)
PATCH Subscription - (Method not implemented)
Log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 405
Log Received 405 Method not implemented as expected
......@@ -78,7 +78,7 @@ PATCH Subscription - (Method not implemented)
POST Subscription - (Method not implemented)
Log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 405
Log Received 405 Method not implemented as expected
*** Settings ***
Library JSONSchemaLibrary schemas/
Resource environment/generic.txt # Generic Parameters
Resource environment/variables.txt # Generic Parameters
Resource environment/individualVnfIndicator.txt
Library REST ${PRODUCER_SCHEMA}://${PRODUCER_HOST}:${PRODUCER_PORT}
Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
*** Test Cases ***
GET Individual VNF Indicator
Log The GET method reads a VNF indicator.
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
Integer response status 200
${contentType}= Output response headers Content-Type
......@@ -22,7 +22,7 @@ GET Individual VNF Indicator
GET Individual VNF Indicator - Negative (Not Found)
Log Trying to perform a negative get, using an erroneous package ID
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${erroneousIndicatorId}
Integer response status 404
Log Received 404 Not Found as expected
......@@ -37,7 +37,7 @@ GET Individual VNF Indicator - Negative (Not Found)
POST Individual VNF Indicator (Method not implemented)
Log Trying to perform a POST (method should not be implemented)
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
Integer response status 405
Log Received 405 Method not implemented as expected
......@@ -45,7 +45,7 @@ POST Individual VNF Indicator (Method not implemented)
PUT Individual VNF Indicator (Method not implemented)
Log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PUT ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
Integer response status 405
Log Received 405 Method not implemented as expected
......@@ -53,7 +53,7 @@ PUT Individual VNF Indicator (Method not implemented)
PATCH Individual VNF Indicator (Method not implemented)
Log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
Integer response status 405
Log Received 405 Method not implemented as expected
......@@ -61,7 +61,7 @@ PATCH Individual VNF Indicator (Method not implemented)
DELETE Individual VNF Indicator (Method not implemented)
Log Trying to perform a DELETE. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
Integer response status 405
Log Received 405 Method not implemented as expected
*** Settings ***
Library JSONSchemaLibrary schemas/
Resource environment/generic.txt # Generic Parameters
Resource environment/variables.txt # Generic Parameters
Resource environment/subscriptions.txt
Library OperatingSystem
Library JSONLibrary
Library REST ${PRODUCER_SCHEMA}://${PRODUCER_HOST}:${PRODUCER_PORT}
Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
*** Test Cases ***
GET Subscription
Log Trying to get the list of subscriptions
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 200
Log Received a 200 OK as expected
......@@ -24,7 +24,7 @@ GET Subscription
GET Subscription - Filter
Log Trying to get the list of subscriptions using filters
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${POS_FILTER}
Integer response status 200
${contentType}= Output response headers Content-Type
......@@ -38,7 +38,7 @@ GET Subscription - Filter
GET Subscription - Negative Filter
Log Trying to get the list of subscriptions using filters with wrong attribute name
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${NEG_FILTER}
Integer response status 400
Log Received a 400 Bad Request as expected
......@@ -53,7 +53,7 @@ GET Subscription - Negative Filter
GET Subscription - Negative (Not Found)
Log Trying to perform a request on a Uri which doesn't exist
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscription
Integer response status 404
Log Received 404 Not Found as expected
......@@ -70,7 +70,7 @@ POST Subscription
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
${body}= Get File json/subscriptions.json
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
Integer response status 201
Log Received 201 Created as expected
......@@ -85,7 +85,7 @@ POST Subscription
PUT Subscription - (Method not implemented)
Log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected
......@@ -93,7 +93,7 @@ PUT Subscription - (Method not implemented)
PATCH Subscription - (Method not implemented)
Log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected
......@@ -101,7 +101,7 @@ PATCH Subscription - (Method not implemented)
DELETE Subscription - (Method not implemented)
Log Trying to perform a DELETE. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${PRODUCER_AUTH_USAGE} == 1 Set Headers {"Authorization": "${PRODUCER_AUTHENTICATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected
*** Settings ***
Documentation This clause defines all the resources and methods provided by the VNF Indicator interface. \
Library JSONSchemaLibrary schemas/
Resource environment/generic.txt # Generic Parameters
Resource environment/variables.txt # Generic Parameters
Library JSONLibrary
Resource environment/vnfIndicators.txt
Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
......
*** Settings ***
Documentation This resource represents VNF indicators related to a VNF instance. The client can use this resource to query multiple VNF indicators that are related to a particular VNF instance.
Library JSONSchemaLibrary schemas/
Resource environment/generic.txt # Generic Parameters
Resource environment/variables.txt # Generic Parameters
Resource environment/vnfIndicatorinVnfInstance.txt
Library JSONLibrary
Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
......
*** Variables ***
${PRODUCER_HOST} localhost # Hostname of the NFVO
${PRODUCER_PORT} 8081 # Listening port of the NFVO
${PRODUCER_SCHEMA} https
${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
${CONTENT_TYPE_JSON} application/json
${EM-VNF_HOST} localhost
${EM-VNF_PORT} 8002
${EM-VNF_SCHEMA} https
${ACCEPT_JSON} application/json
${apiRoot} /
${AUTH_USAGE} 1
${NEG_AUTHORIZATION} Bearer negativetoken
${apiRoot} /
${apiVersion} v1
${apiName} vnfind
${FIELD_USAGE} 1
${PRODUCER_AUTHENTICATION} Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
${PRODUCER_AUTH_USAGE} 1
${EM-VNF_HOST} localhost
${EM-VNF_PORT} 8002
${EM-VNF_SCHEMA} https
${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
${NEG_AUTHORIZATION} Bearer negativetoken
${CONTENT_TYPE_JSON} application/json
......@@ -11,10 +11,6 @@ Documentation This resource represents an individual VNF instance. The client
... underlying VNF instance, and to read information about the VNF instance.
Suite Setup Check resource existance
*** Variables ***
${Etag}= an etag
${Etag_modified}= a modified etag
*** Test Cases ***
Post Individual VNFInstance - Method not implemented
Log Trying to perform a POST. This method should not be implemented
......
......@@ -5,7 +5,6 @@ Resource environment/variables.txt
Library MockServerLibrary
Library Process
Library OperatingSystem
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${notification_port}
*** Variables ***
${sleep_interval} 20s
......@@ -16,75 +15,75 @@ Deliver a notification - Operation Occurence
${json}= Get File schemas/vnfLcmOperationOccurrenceNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification
&{req}= Create Mock Request Matcher Schema POST ${notification_ep} body=${BODY}
&{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY}
&{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${notification_ep}
Clear Requests ${callback_endpoint}
Deliver a notification - Id Creation
log The POST method delivers a notification from the server to the client.
${json}= Get File schemas/vnfIdentifierCreationNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification
&{req}= Create Mock Request Matcher Schema POST ${notification_ep} body=${BODY}
&{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY}
&{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${notification_ep}
Clear Requests ${callback_endpoint}
Deliver a notification - Id deletion
log The POST method delivers a notification from the server to the client.
${json}= Get File schemas/vnfIdentifierCreationNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification
&{req}= Create Mock Request Matcher Schema POST ${notification_ep} body=${BODY}
&{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY}
&{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${notification_ep}
Clear Requests ${callback_endpoint}
Test a notification end point
log The GET method allows the server to test the notification endpoint
&{req}= Create Mock Request Matcher Schema GET ${notification_ep}
&{req}= Create Mock Request Matcher Schema GET ${callback_endpoint}
&{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Verify Mock Expectation ${req}
Clear Requests ${notification_ep}
Clear Requests ${callback_endpoint}