Commit 853737b1 authored by Elian Kraja's avatar Elian Kraja
Browse files

Fix issue #20

parent a2df1dea
Loading
Loading
Loading
Loading
+64 −46
Original line number Diff line number Diff line
@@ -22,33 +22,46 @@ Create a new subscription
    Check HTTP Response Header Contain Link
    Check Postcondition resource exists

Create a new Subscription - DUPLICATION
     [Documentation]    Test ID: 6.3.4.4.2
    ...    Test title: Create a new Subscription - DUPLICATION
# Create a new Subscription - DUPLICATION
     # [Documentation]    Test ID: 6.3.4.4.2
    # ...    Test title: Create a new Subscription - DUPLICATION
    # ...    Test objective: The objective is to create a duplicate subscription.
    # ...    Pre-conditions: subscription with the same filter and callbackUri exists
    # ...    Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v2.7.1
    # ...    Config ID: Config_prod_VNFM
    # ...    Applicability: the VNFM does not allow creation of a subscription resource if another subscription resource with the same filter and callbackUri already exists
    # ...    Post-Conditions: duplicated subscription is created
    # Post Create subscription - DUPLICATION
    # Check HTTP Response Status Code Is    201
    # Check HTTP Response Body Json Schema Is    FmSubscription
    # Check HTTP Response Header Contain Link
    # Check Postcondition Duplicate Subscription exsist
    
# Create a new Subscription - NO-DUPLICATION
    # [Documentation]    Test ID: 6.3.4.4.3
    # ...    Test title: Create a new Subscription - NO-DUPLICATION
    # ...    Test objective: The objective is to create a subscription in case of not allowed DUPLICATION.
    # ...    Pre-conditions: subscription with the same filter and callbackUri exists
    # ...    Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v2.7.1
    # ...    Config ID: Config_prod_VNFM
    # ...    Applicability: the VNFM does not allow creation of a duplicate subscription resource 
    # ...    Post-Conditions: duplicated subscription is not created
    # Post Create subscription - DUPLICATION
    # Check HTTP Response Status Code Is    303
    # Check HTTP Response Header Contain Link

Create a duplicated Subscription
     [Documentation]    Test ID: 6.3.4.4.2a
    ...    Test title: Create a duplicated Subscription
    ...    Test objective: The objective is to create a duplicate subscription.
    ...    Pre-conditions: subscription with the same filter and callbackUri exists
    ...    Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v2.7.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: the VNFM does not allow creation of a subscription resource if another subscription resource with the same filter and callbackUri already exists
    ...    Post-Conditions: duplicated subscription is created
    Post Create subscription - DUPLICATION
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is    FmSubscription
    Check HTTP Response Header Contain Link
    Check Postcondition Duplicate Subscription exsist
    ...    Applicability: 
    ...    Post-Conditions: duplicated subscription is created if the IUT allows duplications, otherwise the duplicated subscription is not created
    Post Create subscription
    Check Response for duplicated subscription

Create a new Subscription - NO-DUPLICATION
    [Documentation]    Test ID: 6.3.4.4.3
    ...    Test title: Create a new Subscription - NO-DUPLICATION
    ...    Test objective: The objective is to create a subscription in case of not allowed DUPLICATION.
    ...    Pre-conditions: subscription with the same filter and callbackUri exists
    ...    Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v2.7.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: the VNFM does not allow creation of a duplicate subscription resource 
    ...    Post-Conditions: duplicated subscription is not created
    Post Create subscription - DUPLICATION
    Check HTTP Response Status Code Is    303
    Check HTTP Response Header Contain Link

GET Subscriptions
    [Documentation]    Test ID: 6.3.4.4.4
@@ -311,28 +324,28 @@ Post Create subscription
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}				
Post Create subscription - DUPLICATION
    Log    Trying to create a subscription with an already created content
    Pass Execution If    ${VNFM_ALLOWS_DUPLICATE_SUBS} == 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}"}
    ${template}=    Get File    jsons/fmSubscriptionRequest.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}			
Post Create subscription - NO-DUPLICATION	
    Log    Trying to create a subscription with an already created content
    Pass Execution If    ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1    VNFM permits duplication. Skipping the test
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${template}=    Get File    jsons/fmSubscriptionRequest.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}		
# Post Create subscription - DUPLICATION
    # Log    Trying to create a subscription with an already created content
    # Pass Execution If    ${VNFM_ALLOWS_DUPLICATE_SUBS} == 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}"}
    # ${template}=    Get File    jsons/fmSubscriptionRequest.json
    # ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    # Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}		
    # ${outputResponse}=    Output    response
	# Set Global Variable    ${response}    ${outputResponse}			
# Post Create subscription - NO-DUPLICATION	
    # Log    Trying to create a subscription with an already created content
    # Pass Execution If    ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1    VNFM permits duplication. Skipping the test
    # Set Headers    {"Accept": "${ACCEPT}"}
    # Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    # Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    # ${template}=    Get File    jsons/fmSubscriptionRequest.json
    # ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    # Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}
    # ${outputResponse}=    Output    response
	# Set Global Variable    ${response}    ${outputResponse}		
Get subscriptions
    Log    Get the list of active subscriptions
    Set Headers  {"Accept":"${ACCEPT}"}  
@@ -506,3 +519,8 @@ Check Postcondition resource exists

Check Postcondition Duplicate Subscription exsist
    Should Not Be Equal As Strings    ${response['body']['callbackUri']}    ${subscriptionId} 
   
Check Response for duplicated subscription
    Run Keyword If    ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1    Check HTTP Response Status Code Is    201
    Run Keyword If    ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1    Check HTTP Response Body Json Schema Is    FmSubscription
    Run Keyword If    ${VNFM_ALLOWS_DUPLICATE_SUBS} == 0    Check HTTP Response Status Code Is    303
+27 −22
Original line number Diff line number Diff line
@@ -219,29 +219,29 @@ POST Subscription
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}

Post Create subscription - DUPLICATION
    Log    Trying to create a subscription with an already created content
    Pass Execution If    ${VNFM_ALLOWS_DUPLICATE_SUBS} == 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}"}
    ${template}=    Get File    jsons/fmSubscriptionRequest.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	
	
Post Create subscription - NO-DUPLICATION	
    Log    Trying to create a subscription with an already created content
    Pass Execution If    ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1    NVFO permits duplication. Skipping the test
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${template}=    Get File    jsons/fmSubscriptionRequest.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	
# Post Create subscription - DUPLICATION
    # Log    Trying to create a subscription with an already created content
    # Pass Execution If    ${VNFM_ALLOWS_DUPLICATE_SUBS} == 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}"}
    # ${template}=    Get File    jsons/fmSubscriptionRequest.json
    # ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    # Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}		
    # ${outputResponse}=    Output    response
	# Set Global Variable    ${response}    ${outputResponse}	
	
# Post Create subscription - NO-DUPLICATION	
    # Log    Trying to create a subscription with an already created content
    # Pass Execution If    ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1    NVFO permits duplication. Skipping the test
    # Set Headers    {"Accept": "${ACCEPT}"}
    # Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    # Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    # ${template}=    Get File    jsons/fmSubscriptionRequest.json
    # ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    # Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}
    # ${outputResponse}=    Output    response
	# Set Global Variable    ${response}    ${outputResponse}	
	
GET Subscriptions
    Log    Get the list of active subscriptions
@@ -617,3 +617,8 @@ Check PostCondition HTTP Response Body Subscriptions Matches the requested attri
    :FOR   ${item}   IN  @{response['body']}
    Should Contain Match    ${item['filter']['probableCauses']}   ${probableCause}    case_insensitive=True
    END

Check Response for duplicated subscription
    Run Keyword If    ${NFVO_ALLOWS_DUPLICATE_SUBS} == 1    Check HTTP Response Status Code Is    201
    Run Keyword If    ${NFVO_ALLOWS_DUPLICATE_SUBS} == 1    Check HTTP Response Body Json Schema Is    FmSubscription
    Run Keyword If    ${NFVO_ALLOWS_DUPLICATE_SUBS} == 0    Check HTTP Response Status Code Is    303
+33 −19
Original line number Diff line number Diff line
@@ -22,32 +22,46 @@ Create a new alarm subscription
    Check Operation Occurrence Id
    Check HTTP Response Body Json Schema Is  FmSubscription
  
Create a new alarm subscription - DUPLICATION
     [Documentation]    Test ID: 5.3.3.3.2
    ...    Test title: Create a new alarm subscription - DUPLICATION
# Create a new alarm subscription - DUPLICATION
     # [Documentation]    Test ID: 5.3.3.3.2
    # ...    Test title: Create a new alarm subscription - DUPLICATION
    # ...    Test objective: The objective is to create a new subscription with the NFV allowing duplication and perform a JSON schema and content validation of the returned fault management alarms subscription data structure..
    # ...    Pre-conditions: subscription with the same filter and callbackUri exists
    # ...    Reference: Clause 8.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    # ...    Config ID: Config_prod_NFVO 
    # ...    Applicability: the NFVO allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists
    # ...    Post-Conditions: none
    # Post Create subscription - DUPLICATION
    # Check HTTP Response Status Code Is    201
    # Check Operation Occurrence Id
    # Check HTTP Response Body Json Schema Is  FmSubscription

# Create a new alarm subscription - NO DUPLICATION
    # [Documentation]    Test ID: 5.3.3.3.3
    # ...    Test title: Create a new alarm subscription - NO DUPLICATION
    # ...    Test objective: The objective is to create a new subscription with the NFV not allowing duplication and perform a JSON schema and content validation of the returned fault management alarms subscription data structure.
    # ...    Pre-conditions: subscription with the same filter and callbackUri exists
    # ...    Reference: Clause 8.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    # ...    Config ID: Config_prod_NFVO 
    # ...    Applicability: the NFVO decides to not create a duplicate subscription resource 
    # ...    Post-Conditions: none
    # Post Create subscription - NO-DUPLICATION
    # Check HTTP Response Status Code Is    303
    # Check Operation Occurrence Id
    
Create a duplicated Subscription
     [Documentation]    Test ID: 5.3.3.3.2a
    ...    Test title: Create a duplicated alarm subscription
    ...    Test objective: The objective is to create a new subscription with the NFV allowing duplication and perform a JSON schema and content validation of the returned fault management alarms subscription data structure..
    ...    Pre-conditions: subscription with the same filter and callbackUri exists
    ...    Reference: Clause 8.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Config ID: Config_prod_NFVO 
    ...    Applicability: the NFVO allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists
    ...    Applicability: 
    ...    Post-Conditions: none
    Post Create subscription - DUPLICATION
    Check HTTP Response Status Code Is    201
    POST Subscription
    Check Response for duplicated subscription
    Check Operation Occurrence Id
    Check HTTP Response Body Json Schema Is  FmSubscription

Create a new alarm subscription - NO DUPLICATION
    [Documentation]    Test ID: 5.3.3.3.3
    ...    Test title: Create a new alarm subscription - NO DUPLICATION
    ...    Test objective: The objective is to create a new subscription with the NFV not allowing duplication and perform a JSON schema and content validation of the returned fault management alarms subscription data structure.
    ...    Pre-conditions: subscription with the same filter and callbackUri exists
    ...    Reference: Clause 8.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Config ID: Config_prod_NFVO 
    ...    Applicability: the NFVO decides to not create a duplicate subscription resource 
    ...    Post-Conditions: none
    Post Create subscription - NO-DUPLICATION
    Check HTTP Response Status Code Is    303
    Check Operation Occurrence Id

Retrieve a list of alarm subscriptions
    [Documentation]    Test ID: 5.3.3.3.4
+0 −2
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ ${NFVO_ALLOWS_DUPLICATE_SUBS} 0

${fields}         criteria,objectInstanceIds

${VNFM_ALLOWS_DUPLICATE_SUBS}    0

${alarmId}    6fc3539c-e602-4afa-8e13-962fb5a7d81d
${faultyNestedNsInstanceId}    faultyNestedNsInstanceId
${faultyNsVirtualLinkInstanceId}     faultyNsVirtualLinkInstanceId