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
*** Settings ***
Resource environment/variables.txt
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Library OperatingSystem
#Suite Teardown Terminate All Processes kill=true
Library Process
*** Keywords ***
Check Individual Subscription existance
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 200
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
Log Validate Status code
Should Be Equal ${response[0]['status']} ${expected_status}
Log Status code validated
Check HTTP Response Header Contains
[Arguments] ${HEADER_TOCHECK}
Should Contain ${response[0]['headers']} ${HEADER_TOCHECK}
Log Header is present
Check HTTP Response Body Json Schema Is
[Arguments] ${schema}
Validate Json ${schema} ${response[0]['body']}
Log Json Schema Validation OK
Check HTTP Response Header ContentType is
[Arguments] ${expected_contentType}
Log Validate content type
Should Be Equal ${response[0]['headers']['Content-Type']} ${expected_contentType}
Log Content Type validated
Do Post Individual Subscription
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do Put Individual Subscription
log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do Patch Individual Subscription
log Trying to perform a Patch. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do Get individual subscription
log Trying to get information about an individual subscription
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do Delete an individual subscription
log Try to delete an individual subscription
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do Post subscription
Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/vrQuotaAvailSubscriptionRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
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
Do Post subscription - DUPLICATION
Log Trying to create a subscription with an already created content
Pass Execution If ${NFVO_DUPLICATION} == 0 NVFO is not permitting duplication. Skipping the test
Set Headers {"Accept": "${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get File jsons/vrQuotaAvailSubscriptionRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do Post subscription - NO-DUPLICATION
Log Trying to create a subscription with an already created content
Pass Execution If ${NFVO_DUPLICATION} == 1 VNFM permits duplication. Skipping the test
Set Headers {"Accept": "${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get File jsons/vrQuotaAvailSubscriptionRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do Get Subscriptions
Log Get the list of active subscriptions
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Log Execute Query and validate response
Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do Get Subscriptions - Filter
Log Get the list of active subscriptions
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Log Execute Query and validate response
Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
DO Get subscriptions - Bad Request Invalid attribute-based filtering parameters
Log Get the list of active subscriptions using an invalid filter
Set Headers {"Accept": "${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do Put subscription
log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do Patch subscription
log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do Delete subscription
log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}