CancelOperationWorkflow.robot 3.59 KB
Newer Older
mengxuan.zhao's avatar
mengxuan.zhao committed
1
2
3
4
*** Settings ***
Resource    environment/variables.txt
Resource    VnfLcmMntOperationKeywords.robot
Resource    SubscriptionKeywords.robot
5
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}      ssl_verify=false  
mengxuan.zhao's avatar
mengxuan.zhao committed
6
7
8
9
10
11
12
13
14
15
16
Library    OperatingSystem
Library    BuiltIn
Library    Collections
Library    JSONLibrary
Library    Process
Suite Setup    Initialize System
Suite Teardown    Terminate All Processes    kill=true


*** Test Cases ***
Cancel a VNF LCM Operation - STARTING
aureliano sinatra's avatar
aureliano sinatra committed
17
    [Documentation]    Test ID: 7.3.1.19.1
aureliano sinatra's avatar
aureliano sinatra committed
18
19
    ...    Test title: Cancel a VNF LCM Operation - STARTING
    ...    Test objective: The objective is to test the workflow for Cancelling a VNF LCM Operation being in the STARTING state
Giacomo Bernini's avatar
Giacomo Bernini committed
20
    ...    Pre-conditions: The VNF lifecycle management operation occurrence is in STARTING state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID 5.4.20.1)
Najam UI Hassan's avatar
Najam UI Hassan committed
21
    ...    Reference: Clause 5.4.17 - ETSI GS NFV-SOL 003 [1] v2.7.1
mengxuan.zhao's avatar
mengxuan.zhao committed
22
23
24
25
26
27
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: NFVO is able to receive notifications from VNFM
    ...    Post-Conditions: The VNF lifecycle management operation occurrence is in ROLLED_BACK state
    Send Cancel Operation Request
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location 
aureliano sinatra's avatar
aureliano sinatra committed
28
    Check Operation Occurrence Id existence
mengxuan.zhao's avatar
mengxuan.zhao committed
29
30
31
32
    Check Operation Notification For Cancel    ROLLED_BACK
    Check Postcondition VNF Cancel - STARTING

Cancel a VNF LCM Operation - PROCESSING - ROLLING_BACK
aureliano sinatra's avatar
aureliano sinatra committed
33
    [Documentation]    Test ID: 7.3.1.19.2
aureliano sinatra's avatar
aureliano sinatra committed
34
35
    ...    Test title: Cancel a VNF LCM Operation - PROCESSING - ROLLING_BACK
    ...    Test objective: The objective is to test the workflow for Cancelling a VNF LCM Operation being either in the PROCESSIONG or ROLLING_BACK state
36
    ...    Pre-conditions: The VNF lifecycle management operation occurrence is in PROCESSING or ROLLING_BACK state. NFVO is subscribed to VNF LCM Operation Occurrence notifications
Najam UI Hassan's avatar
Najam UI Hassan committed
37
    ...    Reference: Clause 5.3.10 - ETSI GS NFV-SOL 003 [1] v2.7.1
mengxuan.zhao's avatar
mengxuan.zhao committed
38
39
40
41
42
43
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: NFVO is able to receive notifications from VNFM
    ...    Post-Conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state
    Send Cancel Operation Request
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location 
aureliano sinatra's avatar
aureliano sinatra committed
44
    Check Operation Occurrence Id existence
mengxuan.zhao's avatar
mengxuan.zhao committed
45
46
47
48
49
50
51
52
53
54
    Check Operation Notification For Cancel    FAILED_TEMP
    Check Postcondition VNF Cancel - PROCESSING - ROLLING_BACK


*** Keywords ***

Initialize System
    Create Sessions
    
Precondition Checks - STARTING
55
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Najam UI Hassan's avatar
Najam UI Hassan committed
56
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} 
mengxuan.zhao's avatar
mengxuan.zhao committed
57
58
59
    String    response body operationState    STARTING

Check Postcondition VNF Cancel - STARTING
60
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Najam UI Hassan's avatar
Najam UI Hassan committed
61
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} 
mengxuan.zhao's avatar
mengxuan.zhao committed
62
63
64
    String    response body operationState    ROLLED_BACK

Check Postcondition VNF Cancel - PROCESSING - ROLLING_BACK
65
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Najam UI Hassan's avatar
Najam UI Hassan committed
66
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} 
mengxuan.zhao's avatar
mengxuan.zhao committed
67
68
69
70
    String    response body operationState    FAILED_TEMP
 
Check Operation Notification For Cancel 
    [Arguments]    ${status}
71
    Check Operation Notification    VnfLcmOperationOccurrenceNotification   ${status}