Commit 73a7ab39 authored by Frank Bryden's avatar Frank Bryden
Browse files

Issue fixes regarding NSD Management

parent ec254083
Loading
Loading
Loading
Loading
+61 −57
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ Library BuiltIn
Library    JSONLibrary
Library    Collections
Library    JSONSchemaLibrary    schemas/
Library    RequestsLibrary
Library    Process
Library    String

@@ -203,7 +204,6 @@ GET Individual Network Service Descriptor Information with invalid resource iden
    Integer    response status    404
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${usageState}    ${response['body']['nsdUsageState']}

Send PATCH to disable Individual Network Service Descriptor
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state
@@ -333,25 +333,24 @@ Get NSD Content in Zip Format
    Log    Trying to get a NSD present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdDownloadableZip}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Get single file NSD Content in Plain or Zip Format
    Log    Trying to get a NSD present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}, ${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdPlain}/nsd_content
    Rest Instances      frankie.json
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get multi file NSD Content in Plain or Zip Format
    Log    Trying to get a VNFD from a given NSD Management present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}, ${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdDownloadableZip}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

@@ -359,14 +358,13 @@ Get multi file NSD Content in Plain Format
    Log    Trying to get a negative case performing a get on a NSD present in the NFVO Catalogue. Accept will be text/plain but NSD is composed my multiple files.
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdDownloadableZip}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Get NSD Content with invalid resource identifier
    Log    Trying to perform a negative get, using an erroneous package ID
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}, ${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${erroneous_nsdInfoId}/nsd_content
    ${output}=    Output    response
@@ -374,8 +372,7 @@ Get NSD Content with invalid resource identifier

Get NSD Content with conflict due to onboarding state
    Log    Trying to get a VNFD from a given NSD Management present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}, ${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${notOnboardedNsdInfoId}/nsd_content
    ${output}=    Output    response
@@ -402,48 +399,54 @@ GET NSD Content with invalid Range Request
    Set Suite Variable    ${response}    ${output}

Send PUT Request to upload NSD Content as zip file in asynchronous mode
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get File  ${contentZipFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content    ${body}
    ${response}=    Output    response body
    Should Be Empty    ${response}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    Create Session      nbi     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}  headers={"Accept": "${ACCEPT_JSON}", "Content-Type": "application/zip", "Authorization": "${AUTHORIZATION}"}      verify=False
    ${body}=  Get Binary File  ${contentZipFile}
    ${response}=    Put Request     nbi     ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content     data=${body}
    Log     ${response}
    Should Be Empty     ${response.text}
    ${response}=    Create Dictionary   status=${response.status_code}
    Log     ${response}
    Set Suite Variable      ${response}     ${response}


Send PUT Request to upload NSD Content as plain text file in asynchronous mode
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Create Session      nbi     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}  headers={"Accept": "${ACCEPT_PLAIN}", "Authorization": "${AUTHORIZATION}", "Content-Type": "text/plain"}      verify=False
    ${body}=  Get File  ${contentPlainFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdPlain}/nsd_content    ${body}
    ${response}=    Output    response body
    Should Be Empty    ${response}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    ${response}=    Put Request     nbi     ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content     data=${body}
    Should Be Empty     ${response.text}
    ${response}=    Create Dictionary   status=${response.status_code}
    Set Suite Variable  ${response}     ${response} 

Send PUT Request to upload NSD Content as zip file in synchronous mode
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get File  ${contentZipFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content    ${body}
    ${response}=    Output    response body
    Should Be Empty    ${response} 
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    Create Session      nbi     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}  headers={"Accept": "${ACCEPT_JSON}", "Content-Type": "application/zip", "Authorization": "${AUTHORIZATION}"}      verify=False
    ${body}=  Get Binary File  ${contentZipFile}
    ${response}=    Put Request     nbi     ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content     data=${body}
    Should Be Empty     ${response.text}
    #Log     Got frankie's put with ${response.status_code}
    ${response}=    Create Dictionary   status=${response.status_code}
    Set Suite Variable      ${response}     ${response}

Send PUT Request to upload NSD Content as plain text file in synchronous mode
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Create Session      nbi     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}  headers={"Accept": "${ACCEPT_PLAIN}", "Authorization": "${AUTHORIZATION}", "Content-Type": "text/plain"}      verify=False
    ${body}=  Get File  ${contentPlainFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdPlain}/nsd_content    ${body}
    ${response}=    Put Request     nbi     ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content     data=${body}
    Should Be Empty     ${response.text}
    ${response}=    Create Dictionary   status=${response.status_code}
    Set Suite Variable  ${response}     ${response} 

Check Post Condition NSD Content has been Uploaded
    Log    Checking NsdOnboardingNotification Recieved
    Wait Until Keyword Succeeds    ${retry}    ${interval}  Check Response is NsdOnboardingNotification

Check Response is NsdOnboardingNotification
    ${response}=    Output    response body
    Should Be Empty    ${response}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    Should Contain    ${response['headers']['Content-Type']}    application/json
    ${schema} =    Catenate    SEPARATOR=    NsdOnboardingNotification    .schema.json
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK


Check Post Condition NSD Content has been Uploaded
    Log    Checking NsdOnboardingNotification Recieved
@@ -653,7 +656,6 @@ GET Individual PNF Descriptor Information with invalid resource identifier
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${erroneous_pnfdInfoId}
    Integer    response status    404
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

@@ -742,14 +744,16 @@ Get PNFD Content with conflict due to onboarding state

Send PUT Request to upload PNFD Content as plain text file
    Log    Trying to perform a PUT. This method upload the content of a PNFD
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get File  ${contentFilePnfd}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content    ${body}
    ${response}=    Output    response body
    Should Be Empty    ${response}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    Create Session    github         http://api.github.com
    Create Session      pnfd     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}      headers={"Accept": "${ACCEPT_PLAIN}", "Content-Type": "${ACCEPT_PLAIN}", "Authorization": "${AUTHORIZATION}"}      verify=False
    ${body}=  Get Binary File  ${contentZipFile}
    ${response}=    Put Request     pnfd     ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoUpld}/pnfd_content     data=${body}
    Log     ${response}
    Should Be Empty     ${response.text}
    ${response}=    Create Dictionary   status=${response.status_code}
    Log     ${response}
    Set Suite Variable      ${response}     ${response}


Send PUT Request to upload PNFD Content with conflict due to onboarding state
    Log    Trying to perform a PUT. This method upload the content of a PNFD
@@ -980,13 +984,13 @@ Send Delete request for individual NSD Management Subscription with invalid reso
    Set Suite Variable    ${response}    ${output}

Send Post request for individual NSD Management Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${newSubscriptionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Put request for individual NSD Management Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
@@ -995,7 +999,7 @@ Send Put request for individual NSD Management Subscription
    Set Suite Variable    ${response}    ${output}
    
Send Patch request for individual NSD Management Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
+2 −0
Original line number Diff line number Diff line
@@ -295,6 +295,8 @@ Configure Notification Forward
    Create Mock Expectation With Http Forward  ${notification_tmp}  ${notification_fwd}

Create Sessions
    ${dir}=     List Directory  ${MOCK_SERVER_DIR}
    Log     ${dir}
    Start Process  java  -jar ${MOCK_SERVER_JAR} -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port}
 No newline at end of file
+5 −4
Original line number Diff line number Diff line
*** Variables ***
${POS_FIELDS}     name=nsdOnboardingState
${NEG_FIELDS}     wrongName=any_value
${nsdInfoId}    5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${nsdInfoIdPlain}    5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${nsdInfoIdZip}    5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${nsdInfoId}    030b1c34-116a-4cfe-9226-19732c3a7b28
${nsdInfoIdPlain}    20734bbb-abf6-4cd8-a35d-f416f95dc180
${nsdInfoIdZip}    5548bf85-8580-4c52-90d1-13c1a7a1dcb0
${nsdDownloadableZip}   f3ce866a-a935-49db-9f39-8b14b662cedc
${erroneous_nsdInfoId}  erroneous_nsdInfoId
${disabledNsdInfoId}  5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${fields}    _links
@@ -19,7 +20,7 @@ ${NFVO_RANGE_OK} 1
${range}          bytes=0-1023
${erroneousRange}    bytes=100000-1000000    # Requesting a out of range number of bytes
${onboardingStateNsdInfoId}    b992a851-08b1-45a8-9282-a5f7a7df04a6
${contentZipFile}    files/nsdContent.zip
${contentZipFile}    files/nsdContent.tar.gz
${contentPlainFile}    files/nsdContent.yaml
${creatingNsdInfoId}    71241932-994a-46e2-ad6c-1740674dda44
${NEG_AUTHORIZATION}    Bearer negativetoken
+3 −2
Original line number Diff line number Diff line
*** Variables ***
${POS_FIELDS}     name=pnfdOnboardingState
${NEG_FIELDS}     wrongName=any_value
${pnfdInfoId}    40853bda-8a8f-4f63-9130-cef439f65348
${pnfdInfoId}     3327be9e-f716-43ac-aaeb-fcd54b0a5369 #used for testing downloads
${pnfdInfoUpld}   93c4cca6-b68b-4aa0-b06a-0e3725995585 #used for testing uploads 
${erroneous_pnfdInfoId}  erroneous_pnfdInfoId
${enabledPnfdInfoId}  40853bda-8a8f-4f63-9130-cef439f65348
${NFVO_FIELDS}    1
@@ -10,6 +11,6 @@ ${ACCEPT_PLAIN} text/plain
${CONTENT_TYPE_PLAIN}    text/plain
${erroneous_pnfdId}    erroneousPnfdId
${onboardingStatePnfdId}    8ed2bf1f-f6ae-4d18-b478-bfab02fd4cd2
${contentFilePnfd}    files/pnfdContent.zip
${contentFilePnfd}    files/nsdContent.yaml
${creatingPnfdId}    2e4ce0ef-3ea8-49f9-92dd-8771866015bb
${userDefinedDataSet}    some
 No newline at end of file
+10 −7
Original line number Diff line number Diff line
*** Variables ***
${NFVO_HOST}    localhost    # Hostname of the NFVO
${NFVO_PORT}    8081    # Listening port of the NFVO
${NFVO_HOST}    172.21.248.145    # Hostname of the NFVO
${NFVO_PORT}    9999    # Listening port of the NFVO
${NFVO_SCHEMA}    https
${AUTHORIZATION}    Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
#auth token for OSM Access
${AUTHORIZATION}    Bearer FJMG15bVJeJb4Y1t1fSKXFaCFUh0e8LD 
${CONTENT_TYPE_JSON}    application/json
${ACCEPT_JSON}    application/json
${apiRoot}        /
${apiRoot}        /osm/
${AUTH_USAGE}     1
${NEG_AUTHORIZATION}    Bearer negativetoken
${apiVersion}     v1
${apiName}        nsd
${FIELD_USAGE}    1
${NFVO_AUTHENTICATION}    Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
${NFVO_AUTH_USAGE}    1
${NFVO_AUTHENTICATION}    Bearer isDGF7TiifGUgzeNb0Fls9aatfZRy4iX #never referenced
${NFVO_AUTH_USAGE}    1 #never refernced

${MOCK_SERVER_JAR}    ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
#MOCK_SERVER_JAR one too many '..'
${MOCK_SERVER_JAR}    ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
${MOCK_SERVER_DIR}    ../../bin/

${callback_port}    9091
${callback_uri}    http://172.22.1.7:${callback_port}