OperateVNFTask.robot 5.81 KB
Newer Older
mengxuan.zhao's avatar
mengxuan.zhao committed
1
*** Settings ***
2
Resource    environment/configuration.txt
3
Resource    environment/variables.txt 
4
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}     ssl_verify=false
mengxuan.zhao's avatar
mengxuan.zhao committed
5
Library     OperatingSystem
6
7
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
8
9
Resource    VnfLcmMntOperationKeywords.robot

10
Suite Setup    Check resource existence
mengxuan.zhao's avatar
mengxuan.zhao committed
11
12

*** Test Cases ***
aureliano sinatra's avatar
aureliano sinatra committed
13
14
15
16
17
POST Operate a vnfInstance
    [Documentation]    Test ID: 7.3.1.9.1
    ...    Test title: POST Operate a vnfInstance
    ...    Test objective: The objective is to test that POST method operate a VNF instance
    ...    Pre-conditions: none
Michele Carignani's avatar
Michele Carignani committed
18
    ...    Reference: Clause 5.4.10.3.1 - ETSI GS NFV-SOL 003 [1] v2.6.1
aureliano sinatra's avatar
aureliano sinatra committed
19
20
21
22
23
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: 
    POST Operate VNF
    Check HTTP Response Status Code Is    202
aureliano sinatra's avatar
aureliano sinatra committed
24
    Check Operation Occurrence Id existence
mengxuan.zhao's avatar
mengxuan.zhao committed
25

aureliano sinatra's avatar
aureliano sinatra committed
26
27
POST Operate a vnfInstance Conflict (Not-Instantiated)
    [Documentation]    Test ID: 7.3.1.9.2
aureliano sinatra's avatar
aureliano sinatra committed
28
    ...    Test title: POST Operate a vnfInstance Conflict (Not-Instantiated)
aureliano sinatra's avatar
aureliano sinatra committed
29
30
    ...    Test objective: The objective is to test that the operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. 
    ...    Pre-conditions: the VNF instance resource is in NOT-INSTANTIATED state
Michele Carignani's avatar
Michele Carignani committed
31
    ...    Reference: Clause 5.4.10.3.1 - ETSI GS NFV-SOL 003 [1] v2.6.1
aureliano sinatra's avatar
aureliano sinatra committed
32
33
34
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions:
Giacomo Bernini's avatar
Giacomo Bernini committed
35
    POST Operate VNF with conflict
aureliano sinatra's avatar
aureliano sinatra committed
36
37
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails 
38

mengxuan.zhao's avatar
mengxuan.zhao committed
39
    
aureliano sinatra's avatar
aureliano sinatra committed
40
41
POST Operate a vnfInstance Not Found
    [Documentation]    Test ID: 7.3.1.9.3
aureliano sinatra's avatar
aureliano sinatra committed
42
    ...    Test title: POST Operate a vnfInstance Not Found
aureliano sinatra's avatar
aureliano sinatra committed
43
44
    ...    Test objective: The objective is to test that the operation cannot be executed currently, because the resource is not existing
    ...    Pre-conditions: the VNF instance resource is in  not existing
Michele Carignani's avatar
Michele Carignani committed
45
    ...    Reference: Clause 5.4.10.3.1 - ETSI GS NFV-SOL 003 [1] v2.6.1
aureliano sinatra's avatar
aureliano sinatra committed
46
47
48
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions:
Giacomo Bernini's avatar
Giacomo Bernini committed
49
    POST Operate VNF not existing
aureliano sinatra's avatar
aureliano sinatra committed
50
51
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails
mengxuan.zhao's avatar
mengxuan.zhao committed
52
53
   
GET Operate VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
54
55
56
57
    [Documentation]    Test ID: 7.3.1.9.4
    ...    Test title: GET Operate a vnfInstance - Method not implemented
    ...    Test objective: The objective is to verify that the method is not implemented 
    ...    Pre-conditions: none
Michele Carignani's avatar
Michele Carignani committed
58
    ...    Reference: Clause 5.4.10.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
aureliano sinatra's avatar
aureliano sinatra committed
59
60
61
62
63
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions:
    GET Operate VNF
    Check HTTP Response Status Code Is    405
mengxuan.zhao's avatar
mengxuan.zhao committed
64
65

PUT Operate VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
66
67
68
69
    [Documentation]    Test ID: 7.3.1.9.5
    ...    Test title: PUT Operate a vnfInstance - Method not implemented
    ...    Test objective: The objective is to verify that the method is not implemented 
    ...    Pre-conditions: none
Michele Carignani's avatar
Michele Carignani committed
70
    ...    Reference: Clause 5.4.10.3.3 - ETSI GS NFV-SOL 003 [1] v2.6.1
aureliano sinatra's avatar
aureliano sinatra committed
71
72
73
74
75
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions:
    PUT Operate VNF
    Check HTTP Response Status Code Is    405
mengxuan.zhao's avatar
mengxuan.zhao committed
76
77

PATCH Operate VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
78
79
80
81
    [Documentation]    Test ID: 7.3.1.9.6
    ...    Test title: PATCH Operate a vnfInstance - Method not implemented
    ...    Test objective: The objective is to verify that the method is not implemented 
    ...    Pre-conditions: none
Michele Carignani's avatar
Michele Carignani committed
82
    ...    Reference: Clause 5.4.10.3.4 - ETSI GS NFV-SOL 003 [1] v2.6.1
aureliano sinatra's avatar
aureliano sinatra committed
83
84
85
86
87
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions:
    PATCH Operate VNF
    Check HTTP Response Status Code Is    405
mengxuan.zhao's avatar
mengxuan.zhao committed
88
89
    
DELETE Operate VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
90
    [Documentation]    Test ID: 7.3.1.9.7
aureliano sinatra's avatar
aureliano sinatra committed
91
92
93
    ...    Test title: DELETE Operate a vnfInstance - Method not implemented
    ...    Test objective: The objective is to verify that the method is not implemented 
    ...    Pre-conditions: none
Michele Carignani's avatar
Michele Carignani committed
94
    ...    Reference: Clause 5.4.10.3.5 - ETSI GS NFV-SOL 003 [1] v2.6.1
aureliano sinatra's avatar
aureliano sinatra committed
95
96
97
98
99
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions:
    DELETE Operate VNF
    Check HTTP Response Status Code Is    405
mengxuan.zhao's avatar
mengxuan.zhao committed
100

101
*** Keywords ***
102
Check resource existence
mengxuan.zhao's avatar
mengxuan.zhao committed
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} 
    Integer    response status    200

Check resource not instantiated
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} 
    String    response body instantiationState    NOT_INSTANTIATED

Check operate not supported
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} 
    # how to check if operate is not supported? "flavourId" doesn't exist?

Launch another LCM operation
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
Elian Kraja's avatar
Elian Kraja committed
127
    ${body}=    Get File    jsons/scaleVnfRequest.json
mengxuan.zhao's avatar
mengxuan.zhao committed
128
    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale    ${body}
mengxuan.zhao's avatar
mengxuan.zhao committed
129
    Integer    response status    202