Commit 721232d7 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

Fixes of configuration variables

parent 565d7b62
Loading
Loading
Loading
Loading
+14 −1
Original line number Original line Diff line number Diff line
*** Settings ***
*** Settings ***
Resource    environments/variables.txt 
Resource   environment/variables.txt
Library    REST    ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
Library    REST    ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
...        spec=SOL002-VNFConfiguration-API.yaml
...        spec=SOL002-VNFConfiguration-API.yaml
Library    JSONLibrary
Library    JSONLibrary
@@ -7,6 +7,9 @@ Library JSONSchemaLibrary schemas/
Library    OperatingSystem
Library    OperatingSystem
Library    DependencyLibrary
Library    DependencyLibrary


*** Variables ***
${response}=    httpresponse

*** Test Cases ***
*** Test Cases ***
POST Configuration - Method not implemented
POST Configuration - Method not implemented
    log    Trying to perform a POST. This method should not be implemented
    log    Trying to perform a POST. This method should not be implemented
@@ -135,3 +138,13 @@ Check Postcondition VNF Is Configured
    ${output}=    evaluate    json.loads('''${response.body}''')    json
    ${output}=    evaluate    json.loads('''${response.body}''')    json
    ${input}=    Get File    json/vnfConfigModifications.json
    ${input}=    Get File    json/vnfConfigModifications.json
    Should Be Equal  ${output}    ${input}   
    Should Be Equal  ${output}    ${input}   

Send Duplicated VNF configuration
    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}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers    {"If-Match": "${Etag}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    json/vnfConfigModifications.json
    ${response}=    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
+27 −0
Original line number Original line Diff line number Diff line
@@ -11,3 +11,30 @@ ${apiName} vnfconfig
${apiVersion}     v1
${apiVersion}     v1
${Etag}=    an etag
${Etag}=    an etag
${Etag_modified}=    a modified etag
${Etag_modified}=    a modified etag
${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
+1 −1
Original line number Original line Diff line number Diff line
@@ -68,7 +68,7 @@ Create a new Subscription - NO-DUPLICATION
    ...    Applicability: the VNFM decides to not create a duplicate subscription resource 
    ...    Applicability: the VNFM decides to not create a duplicate subscription resource 
    ...    Post-Conditions:
    ...    Post-Conditions:
    Log    Trying to create a subscription with an already created content
    Log    Trying to create a subscription with an already created content
    Pass Execution If    ${NVFM_DUPLICATION} == 1    VNFM permits duplication. Skipping the test
    Pass Execution If    ${VNFM_DUPLICATION} == 1    VNFM permits duplication. Skipping the test
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
+7 −0
Original line number Original line Diff line number Diff line
@@ -34,3 +34,10 @@ ${AlarmClearedNotification} {}
${AlarmListRebuiltNotification}    {}
${AlarmListRebuiltNotification}    {}
${PerceivedSeverity}    CRITICAL
${PerceivedSeverity}    CRITICAL
${sleep_interval}    20s
${sleep_interval}    20s
${alarm_filter}       managedObjectId
${managedObjectId}    007c111c-38a1-42c0-a666-7475ecb1567c
${invalid_alarm_filter}    badFilter
${notification_ep}    /notification
${notification_port}    9091

+7 −7
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@ Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
GET Individual Subscription
GET Individual Subscription
    Log    Trying to get a given subscription identified by subscriptionId
    Log    Trying to get a given subscription identified by subscriptionId
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    200
    Integer    response status    200
    Log    Received a 200 OK as expected
    Log    Received a 200 OK as expected
@@ -24,7 +24,7 @@ GET Individual Subscription
GET Subscription - Negative (Not Found)
GET Subscription - Negative (Not Found)
    Log    Trying to perform a request on a subscriptionID which doesn't exist
    Log    Trying to perform a request on a subscriptionID which doesn't exist
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    Integer    response status    404
    Integer    response status    404
    Log    Received 404 Not Found as expected
    Log    Received 404 Not Found as expected
@@ -39,7 +39,7 @@ GET Subscription - Negative (Not Found)
DELETE Subscription
DELETE Subscription
    Log    Trying to perform a DELETE on a subscriptionId
    Log    Trying to perform a DELETE on a subscriptionId
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    204
    Integer    response status    204
    Log    Received 204 No Content as expected
    Log    Received 204 No Content as expected
@@ -47,7 +47,7 @@ DELETE Subscription
DELETE Subscription - Negative (Not Found)
DELETE Subscription - Negative (Not Found)
    Log    Trying to perform a DELETE on a subscriptionId which doesn't exist
    Log    Trying to perform a DELETE on a subscriptionId which doesn't exist
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    Integer    response status    404
    Integer    response status    404
    Log    The subscriptionId is not present in database
    Log    The subscriptionId is not present in database
@@ -62,7 +62,7 @@ DELETE Subscription - Negative (Not Found)
PUT Subscription - (Method not implemented)
PUT 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
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    405
    Integer    response status    405
    Log    Received 405 Method not implemented as expected
    Log    Received 405 Method not implemented as expected
@@ -70,7 +70,7 @@ PUT Subscription - (Method not implemented)
PATCH Subscription - (Method not implemented)
PATCH Subscription - (Method not implemented)
    Log    Trying to perform a PATCH. This method should not be implemented
    Log    Trying to perform a PATCH. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    405
    Integer    response status    405
    Log    Received 405 Method not implemented as expected
    Log    Received 405 Method not implemented as expected
@@ -78,7 +78,7 @@ PATCH Subscription - (Method not implemented)
POST Subscription - (Method not implemented)
POST Subscription - (Method not implemented)
    Log    Trying to perform a POST. This method should not be implemented
    Log    Trying to perform a POST. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    405
    Integer    response status    405
    Log    Received 405 Method not implemented as expected
    Log    Received 405 Method not implemented as expected
Loading