Commit 116dc06d authored by Najam UI Hassan's avatar Najam UI Hassan Committed by Giacomo Bernini
Browse files

added keywords to check state is changed as intended

parent 5e8639d8
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -16,10 +16,11 @@ POST Change interface state task
    ...    Reference: clause 5.5.12.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1
    ...    Reference: clause 5.5.12.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Applicability: none
    ...    Post-Conditions: none
    ...    Post-Conditions: interface status changed
    Send Post request for Change interface state task
    Send Post request for Change interface state task
    Check HTTP Response Status Code Is    202
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains Location
    Check HTTP Response Header Contains Location
    Wait for interface state change success notification and validate status
    
    
POST Change interface state task - Conflict
POST Change interface state task - Conflict
    [Documentation]    Test ID: 8.3.1.7.2
    [Documentation]    Test ID: 8.3.1.7.2
+2 −1
Original line number Original line Diff line number Diff line
@@ -15,10 +15,11 @@ POST NFV-MANO functional entity application state change
    ...    Reference: clause 5.5.7.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1
    ...    Reference: clause 5.5.7.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Applicability: none
    ...    Post-Conditions: none
    ...    Post-Conditions: entity status changed
    Send Post request for NFV-MANO functional entity application state change
    Send Post request for NFV-MANO functional entity application state change
    Check HTTP Response Status Code Is    202
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains Location
    Check HTTP Response Header Contains Location
    Wait for entity state change success notification and validate status
    
    
POST NFV-MANO functional entity application state change - Conflict
POST NFV-MANO functional entity application state change - Conflict
    [Documentation]    Test ID: 8.3.1.2.2
    [Documentation]    Test ID: 8.3.1.2.2
+1 −0
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@ GET Individual NFV-MANO Service Interface - Not Found
    ...    Post-Conditions: none
    ...    Post-Conditions: none
    Get Individual NFV-MANO Service Interface
    Get Individual NFV-MANO Service Interface
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
    
PUT Individual NFV-MANO Service Interface - Method not implemented
PUT Individual NFV-MANO Service Interface - Method not implemented
    [Documentation]    Test ID: 8.3.1.6.4
    [Documentation]    Test ID: 8.3.1.6.4
+27 −1
Original line number Original line Diff line number Diff line
@@ -78,10 +78,24 @@ Send Post request for NFV-MANO functional entity application state change
    Log    Trying to perform a POST for NFV-MANO functional entity application state change
    Log    Trying to perform a POST for NFV-MANO functional entity application state change
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${template}=    Get File    jsons/ChangeStateRequest.json
    ${body}=        Format String   ${template}    state=${state}     operationalStateAction=${operationalStateAction} 
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/change_state
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/change_state
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Wait for entity state change success notification and validate status
    Wait Until Keyword Succeeds    ${retry}   ${polling}    Check entity state    
    
Check entity state
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${response['headers']['Location']}
    Log    Validate Status code
    Integer    response status    200
    Should Be Equal As Strings    response body manoApplicationState ${state}    ${operationalStateAction} 
    Log    Validated
    
Send Get request for NFV-MANO functional entity application state change
Send Get request for NFV-MANO functional entity application state change
    Log    Trying to perform a GET (method should not be implemented)
    Log    Trying to perform a GET (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -413,11 +427,23 @@ Send Post request for Change interface state task
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}   
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}   
    ${template}=    Get File    jsons/ChangeStateRequest.json
    ${template}=    Get File    jsons/ChangeStateRequest.json
    ${body}=        Format String   ${template}     operationalStateAction=${operationalStateAction} 
    ${body}=        Format String   ${template}    state=${state}     operationalStateAction=${operationalStateAction} 
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/mano_interfaces/${manoServiceInterfaceId}/change_state    ${body}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/mano_interfaces/${manoServiceInterfaceId}/change_state    ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Wait for interface state change success notification and validate status
    Wait Until Keyword Succeeds    ${retry}   ${polling}    Check interface state    
    
Check interface state
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${response['headers']['Location']}
    Log    Validate Status code
    Integer    response status    200
    Should Be Equal As Strings    response body interfaceState ${state}    ${operationalStateAction} 
    Log    Validated
    
Send Get request for Change interface state task
Send Get request for Change interface state task
    Log    Trying to perform a GET (method should not be implemented)
    Log    Trying to perform a GET (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
+6 −1
Original line number Original line Diff line number Diff line
@@ -59,4 +59,9 @@ ${origResponse} {}


${name}    EntityName
${name}    EntityName
${type}    NFVO
${type}    NFVO

${state}    operationalStateChange
${operationalStateAction}    START
${operationalStateAction}    START

${retry}   2 min
${polling}    10 sec
 No newline at end of file
Loading