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


*** Test Cases ***
Operate a VNF Instance
aureliano sinatra's avatar
aureliano sinatra committed
19
    [Documentation]    Test ID: 7.3.1.27
mengxuan.zhao's avatar
mengxuan.zhao committed
20
21
    ...    Test title: Operate a VNF Instance
    ...    Test objective: The objective is to change the operational state of a VNF instance.
aureliano sinatra's avatar
aureliano sinatra committed
22
    ...    Pre-conditions: VNF instance in INSTANTIATED state 
mengxuan.zhao's avatar
mengxuan.zhao committed
23
24
25
26
27
28
29
30
31
    ...    Reference: section 5.3.3 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: change the operational state of a VNF instance is supported for the VNF (as capability in the VNFD)
    ...    Post-Conditions: VNF instance still in INSTANTIATED state and the operational state is changed
    Send Change VNF Operational State Request
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location 
    Check Operation Occurrence Id
    Check Operation Notification For Operate    STARTING
mengxuan.zhao's avatar
mengxuan.zhao committed
32
    #Create a new Grant - Sync - OPERATE
mengxuan.zhao's avatar
Bug fix    
mengxuan.zhao committed
33
34
35
    Check Operation Notification For Operate    PROCESSING
    Check Operation Notification For Operate    COMPLETED
    Check Postcondition VNF OPERATE
mengxuan.zhao's avatar
mengxuan.zhao committed
36
37
38
39

*** Keywords ***
Initialize System
    Create Sessions
40
    ${body}=    Get File    jsons/operateVnfRequest.json
mengxuan.zhao's avatar
mengxuan.zhao committed
41
42
43
44
45
46
47
    ${changeVnfOperateRequest}=    evaluate    json.loads('''${body}''')    json
    ${requestedState}=    Get Value From Json    ${changeVnfOperateRequest}    $..changeStateTo 
    
Precondition Checks
    Check resource instantiated
    ${LccnSubscriptions}=    Check subscriptions about one VNFInstance and operation type    ${vnfInstanceId}    VnfLcmOperationOccurrenceNotification    operationType=SCALE

mengxuan.zhao's avatar
Bug fix    
mengxuan.zhao committed
48
Check Postcondition VNF OPERATE
mengxuan.zhao's avatar
mengxuan.zhao committed
49
50
51
52
53
54
55
56
57
58
59
    Check resource instantiated
    ${newState}=    Get Vnf Operational State Info    ${vnfInstanceId}
    Should be Equal    ${requestedState}    ${newState}
    
Create a new Grant - Sync - OPERATE
    Create a new Grant - Synchronous mode        ${vnfInstanceId}    ${vnfLcmOpOccId}    OPERATE
    
Check Operation Notification For Operate 
    [Arguments]    ${status}
    Check Operation Notification    VnfLcmOperationOccurrenceNotification   ${status}