ChangeVNFFlavourWorkflow.robot 2.8 KB
Newer Older
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}    
...    spec=SOL003-VNFLifecycleManagement-API.yaml
Library    OperatingSystem
Library    BuiltIn
Library    Collections
Library    JSONLibrary
Library    Process
Suite Setup    Initialize System
Suite Teardown    Terminate All Processes    kill=true


*** Test Cases ***
Giacomo Bernini's avatar
Giacomo Bernini committed
19
20
21
22
23
24
Change VNF Flavour
    [Documentation]    Test ID: 5.4.7.1
    ...    Test title: Change VNF Flavour Workflow
    ...    Test objective: The objective is to test the workflow for a change flavour of an existing VNF instance
    ...    Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.4.4.1). NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1)
    ...    Reference: section 5.4.7 - SOL003 v2.4.1
25
    ...    Config ID: Config_prod_VNFM
Giacomo Bernini's avatar
Giacomo Bernini committed
26
    ...    Applicability: Multiple flavours are supported for the VNF (as capability in the VNFD). NFVO is able to receive notifications from VNFM
27
    ...    Post-Conditions: VNF instance still in INSTANTIATED state and the flavour is changed
mengxuan.zhao's avatar
mengxuan.zhao committed
28
    Send Change VNF Flavour Request
29
30
31
32
33
34
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location 
    Check Operation Occurrence Id
    Check Operation Notification For Change Flavour    STARTING
    Check Operation Notification For Change Flavour    PROCESSING
    Check Operation Notification For Change Flavour    COMPLETED
Giacomo Bernini's avatar
Giacomo Bernini committed
35
36
37
    Check Postcondition VNF Flavor Changed
    
#Create a new Grant Sync - CHANGE_FLAVOU Scale REMOVED
38
39
40
41
42
43
44
45
46
47
48
49
50
51

*** Keywords ***

Initialize System
    Create Sessions
    ${body}=    Get File    json/changeVnfFlavourRequest.json
    ${changeVnfFlavourRequest}=    evaluate    json.loads('''${body}''')    json
    ${requestedFlavour}=    Get Value From Json    ${changeVnfFlavourRequest}    $..newFlavourId
    
Precondition Checks
    Check resource instantiated
    ${LccnSubscriptions}=    Check subscriptions about one VNFInstance and operation type    ${vnfInstanceId}    VnfLcmOperationOccurrenceNotification    operationType=SCALE
    ${scaleInfo}=    Get Vnf Scale Info        ${vnfInstanceId}

Giacomo Bernini's avatar
Giacomo Bernini committed
52
Check Postcondition VNF Flavor Changed
53
54
55
56
57
58
59
    Check resource instantiated
    ${newFlavour}=    Get Vnf Flavour Info    ${vnfInstanceId}
    Should be Equal    ${requestedFlavour}    ${newFlavour}
    
Create a new Grant - Sync - CHANGE_FLAVOUR
    Create a new Grant - Synchronous mode        ${vnfInstanceId}    ${vnfLcmOpOccId}    CHANGE_FLAVOUR
    
mengxuan.zhao's avatar
test    
mengxuan.zhao committed
60
Check Operation Notification For Change Flavour 
61
62
63
    [Arguments]    ${status}
    Check Operation Notification    VnfLcmOperationOccurrenceNotification   ${status}