Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
*** Settings ***
Resource environment/configuration.txt
Resource environment/variables.txt
Resource environment/scaleVariables.txt
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}
Library OperatingSystem
Library BuiltIn
Library JSONLibrary
Library Collections
Library JSONSchemaLibrary schemas/
*** Keywords ***
Get Vnf Instance
[Arguments] ${vnfInstanceId}
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}
${body}= Output response body
[Return] ${body}
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
Should Be Equal ${response.status_code} ${expected_status}
Log Status code validated
Check Operation Occurrence Id
${vnfLcmOpOccId}= Get Value From Json ${response.headers} $..Location
Should Not Be Empty ${vnfLcmOpOccId}
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
${schema} = Catenate ${input} .schema.json
Validate Json ${schema} ${response[0]['body']}
Log Json Schema Validation OK
Check resource Instantiated
Check VNF Instance ${vnfInstanceId}
Check HTTP Response Status Code Is 200
Check VNF Status ${response.body.instantiationState} INSTANTIATED
Check resource not Instantiated
Check VNF Instance ${vnfInstanceId}
Check HTTP Response Status Code Is 200
Check VNF Status ${response.body.instantiationState} NOT_INSTANTIATED
Check VNF Instance
[Arguments] ${vnfId}
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfId}
Check VNF Status
[Arguments] ${current} ${expected}
Should Be Equal As Strings ${current} ${expected}
Log VNF Status in the correct status
Check resource has a temporary failure
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}
String response body instantiationState FAILED_TEMP
Get Vnf Scale Info
[Arguments] ${vnfInstanceId}
${vnfInstance}= Get Vnf Instance ${vnfInstanceId}
${scaleInfo}= Get Value From Json ${vnfInstance} $..scaleStatus
[Return] ${scaleInfo}
Get Vnf Flavour Info
[Arguments] ${vnfInstanceId}
${vnfInstance}= Get Vnf Instance ${vnfInstanceId}
${flavourInfo}= Get Value From Json ${vnfInstance} $..flavourId
[Return] ${flavourInfo}
Get Vnf Operational State Info
[Arguments] ${vnfInstanceId}
${vnfInstance}= Get Vnf Instance ${vnfInstanceId}
${stateInfo}= Get Value From Json ${vnfInstance} $..vnfState
[Return] ${stateInfo}
Get Vnf Ext Link Id
[Arguments] ${vnfInstanceId}
${vnfInstance}= Get Vnf Instance ${vnfInstanceId}
[Return] ${vnfInstance.instantiatedVnfInfo.extVirtualLinkInfo.id}
Check HTTP Response Header Contains
[Arguments] ${CONTENT_TYPE}
Should Contain ${response.headers} ${CONTENT_TYPE}
Log Header is present
Send VNF Scale Out Request
Log Trying to scale a vnf Instance
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/scaleVnfOutRequest.json
${json}= evaluate json.loads('''${body}''') json
${aspectId}= Set Variable ${json.aspectId}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body}
Send VNF Scale To Level Request
[Documentation] Instantiate VNF The POST method instantiates a VNF instance.
Log Trying to Instantiate a vnf Instance
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/scaleVnfToLevelRequest.json
${json}= evaluate json.loads('''${body}''') json
${aspectId}= Set Variable ${json.aspectId}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body}
Send VNF Instance Resource Create Request
Log Create VNF instance by POST to ${apiRoot}/${apiName}/${apiVersion}/vnf_instances
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/createVnfRequest.json
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances ${body}
Send VNF Instance Resource Delete Request
log Delete an individual VNF instance
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}
Send Change VNF Flavour Request
Log Trying to change the deployment flavour of a VNF instance.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/changeVnfFlavourRequest.json
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body}
Send Change VNF Operational State Request
Log Trying to change the operational state of a VNF instance.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/operateVnfRequest.json
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body}
Send Heal VNF Request
Log Trying to heal a VNF instance.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/healVnfRequest.json
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body}
Send Change Ext Connectivity Request
Log Trying to change the external connectivity of a VNF instance.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/changeExtVnfConnectivityRequest.json
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body}
Send Terminate VNF Request
Log Trying to terminate a VNF instance.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/terminateVnfRequest.json
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body}
Send Info Modification Request
Log Trying to update information of a VNF instance.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/patchBodyRequest.json
${response}= Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body}
Send Retry Operation Request
Log Retry a VNF lifecycle operation if that operation has experienced a temporary failure
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry
Send Roll back Operation Request
Log Rollback a VNF lifecycle operation if that operation has experienced a temporary failure
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback
Send Fail Operation Request
Log Fail a VNF lifecycle operation if that operation has experienced a temporary failure
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail
Send Cancel Operation Request
Log Cancel an ongoing VNF lifecycle operation
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel ${CancelMode}
Create a new Grant - Synchronous mode
[Arguments] ${vnfInstanceId} ${vnfLcmOpOccId} ${operation}
Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants
Pass Execution If ${SYNC_MODE} == 0 The Granting process is asynchronous mode. Skipping the test
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Loading full blame...