Commit 08134a3f authored by Elian Kraja's avatar Elian Kraja
Browse files

Bug fix on SOL005

parent 329c05ad
Loading
Loading
Loading
Loading
+14 −19
Original line number Diff line number Diff line
*** Settings ***
Documentation     This clause defines all the resources and methods provided by the Individual NS descriptor interface. \
Library           JSONSchemaLibrary    schemas/
Resource          environment/generic.txt    # Generic Parameters
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/nsDescriptors.txt    # Specific nsDescriptors Parameters
Library           OperatingSystem
Library           JSONLibrary
@@ -24,8 +24,7 @@ GET Single Network Service Descriptor
    Log  Validation of Content-Type : OK
    Log    Trying to validate response
    ${result}=    Output    response body
    ${json}=    evaluate    json.loads('''${result}''')    json
    Validate Json    NsdInfo.schema.json    ${json}
    Validate Json    NsdInfo.schema.json    ${result}
    Log    Validation OK


@@ -40,8 +39,7 @@ GET Single Network Service Descriptor (Negative: Not found)
    Should Contain    ${contentType}    application/json
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK


@@ -62,28 +60,26 @@ PATCH Single Network Service Descriptor - (Disabling a nsdInfo)
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${body}=    Get File    json/NsdInfoModificationDisable.json
    ${body}=    Get File    jsons/NsdInfoModificationDisable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}    ${body}
    Integer    response status    200
    Log    Received 200 OK as expected
    ${result}=    Output    response body
    ${json}=    evaluate    json.loads('''${result}''')    json
    Validate Json    NsdInfoModification.schema.json    ${json}
    Validate Json    NsdInfoModification.schema.json    ${result}
    Log    Validation of NsdInfoModifications OK

PATCH Single Network Service Descriptor - (Enabling an previously disabled nsdInfo)
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in disabled operational state
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${body}=    Get File    json/NsdInfoModificationEnable.json
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}    ${body}
    Integer    response status    200
    Log    Received 200 OK as expected
    ${result}=    Output    response body
    ${json}=    evaluate    json.loads('''${result}''')    json
    Validate Json    NsdInfoModification.schema.json    ${json}
    Validate Json    NsdInfoModification.schema.json    ${result}
    Log    Validation of NsdInfoModifications OK
    

@@ -91,7 +87,7 @@ PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable an previous
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${body}=    Get File    json/NsdInfoModificationEnable.json
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${enabledNsdInfoId}    ${body}
    Integer    response status    409
@@ -100,8 +96,7 @@ PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable an previous
    Should Contain    ${contentType}    application/json
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
    
    
@@ -110,7 +105,7 @@ PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable an previous
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"If-Match": "${Etag}"}
    ${body}=    Get File    json/NsdInfoModificationEnable.json
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${modifiedNsdInfoId}    ${body}
    Integer    response status    412
@@ -122,8 +117,7 @@ PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable an previous
    Should Contain    ${contentType}    application/json
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK  
    

@@ -155,12 +149,12 @@ DELETE Single Network Service Descriptor (Negative: Trying to delete an enabled
    Should Contain    ${contentType}    application/json
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK


POST Single Network Service Descriptor (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.   
    Log    Trying to perform a POST. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
@@ -172,6 +166,7 @@ POST Single Network Service Descriptor (Method not implemented)


PUT Single Network Service Descriptor (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.   
    Log    Trying to perform a PUT. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
+7 −8
Original line number Diff line number Diff line
*** Settings ***
Documentation     This clause defines all the resources and methods provided by the Iindividual PNF descriptor interface. \
Library           JSONSchemaLibrary    schemas/
Resource          environment/generic.txt    # Generic Parameters
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/pnfDescriptors.txt    # Specific nsDescriptors Parameters
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
@@ -22,8 +22,7 @@ GET Single PNF Descriptor
    Log  Validation of Content-Type : OK
   Log    Trying to validate response
   ${result}=    Output    response body
   ${json}=    evaluate    json.loads('''${result}''')    json
   Validate Json    NsdInfo.schema.json    ${json}
   Validate Json    NsdInfo.schema.json    ${result}
   Log    Validation OK


@@ -38,8 +37,7 @@ GET Single PNF Descriptor (Negative: Not found)
    Should Contain    ${contentType}    application/json
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK


@@ -50,14 +48,13 @@ PATCH Single PNF Descriptor - (Disabling a nsdInfo)
    Log    The PATCH method modifies the user defined data of an individual PNF descriptor resource.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${body}=    Get File    json/PnfdInfoModification.json
    ${body}=    Get File    jsons/PnfdInfoModification.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}    ${body}
    Integer    response status    200
    Log    Received 200 OK as expected
   ${result}=    Output    response body
   ${json}=    evaluate    json.loads('''${result}''')    json
   Validate Json    PnfdInfoModification.schema.json    ${json}
   Validate Json    PnfdInfoModification.schema.json    ${result}
   Log    Validation of PnfdInfoModification OK


@@ -71,6 +68,7 @@ DELETE Single PNF Descriptor


POST Single PNF Descriptor (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log    Trying to perform a POST. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
@@ -82,6 +80,7 @@ POST Single PNF Descriptor (Method not implemented)


PUT Single PNF Descriptor (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log    Trying to perform a PUT. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
+7 −7
Original line number Diff line number Diff line
*** Settings ***
Library           JSONSchemaLibrary    schemas/
Resource          environment/generic.txt    # Generic Parameters
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/individualSubscription.txt
Library           OperatingSystem
Library           JSONLibrary
@@ -17,8 +17,7 @@ GET Individual Subscription
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    ${result}=    Output    response body
    ${json}=    evaluate    json.loads('''${result}''')    json
    Validate Json    NsdmSubscription.schema.json    ${json}
    Validate Json    NsdmSubscription.schema.json    ${result}
    Log    Validated NsdmSubscription schema

GET Subscription - Negative (Not Found)
@@ -32,8 +31,7 @@ GET Subscription - Negative (Not Found)
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK

DELETE Subscription
@@ -62,11 +60,11 @@ DELETE Subscription - Negative (Not Found)
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK

PUT Subscription - (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log    Trying to perform a PUT. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
@@ -75,6 +73,7 @@ PUT Subscription - (Method not implemented)
    Log    Received 405 Method not implemented as expected

PATCH Subscription - (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log    Trying to perform a PATCH. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
@@ -83,6 +82,7 @@ PATCH Subscription - (Method not implemented)
    Log    Received 405 Method not implemented as expected

POST Subscription - (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log    Trying to perform a POST. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
+8 −9
Original line number Diff line number Diff line
*** Settings ***
Documentation     This clause defines the content of the individual NS descriptor, i.e. NSD content
Library           JSONSchemaLibrary    schemas/
Resource          environment/generic.txt    # Generic Parameters
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/nsDescriptors.txt    # Specific nsDescriptors Parameters
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
@@ -78,8 +78,7 @@ GET NSD Content - Negative Range
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK        
        
        
@@ -96,8 +95,7 @@ GET NSD Content- Negative (Not Found)
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK

  
@@ -112,8 +110,7 @@ GET NSD Content - Negative (onboardingState issue)
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
      
        
@@ -189,13 +186,13 @@ PUT a NSD Content - Negative. Nsd in CREATING state
    Should Contain    ${contentType}    application/json
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
 
        

POST a NSD Content (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log    Trying to perform a PUT. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
@@ -205,6 +202,7 @@ POST a NSD Content (Method not implemented)


PATCH a NSD Content (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log    Trying to perform a PATCH. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
@@ -212,6 +210,7 @@ PATCH a NSD Content (Method not implemented)
    Log    Received 405 Method not implemented as expected

DELETE a NSD Content (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log    Trying to perform a DELETE. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
+3 −1
Original line number Diff line number Diff line
*** Setting ***
Resource	environment/variables.txt
Resource	environment/generic.txt
Suite Setup    Create Sessions
Suite Teardown    Terminate All Processes    kill=true
Library    MockServerLibrary
@@ -130,6 +129,7 @@ Post Notification Negative 404
    
    
PUT VNF Package Management Notification 
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log  PUT Method not implemented
    &{req}=  Create Mock Request Matcher	PUT  ${callback_endpoint}
    &{rsp}=  Create Mock Response  status_code=405
@@ -142,6 +142,7 @@ PUT VNF Package Management Notification
    
    
PATCH VNF Package Management Notification 
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log  PATCH Method not implemented
    &{req}=  Create Mock Request Matcher	PATCH  ${callback_endpoint}
    &{rsp}=  Create Mock Response  status_code=405
@@ -154,6 +155,7 @@ PATCH VNF Package Management Notification
    
    
DELETE VNF Package Management Notification 
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log  PATCH Method not implemented
    &{req}=  Create Mock Request Matcher	DELETE  ${callback_endpoint}
    &{rsp}=  Create Mock Response  status_code=405
Loading