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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
Y''[Documentation] robot --outputdir ../../../outputs ./RegisteredDevices.robot
... Test Suite to validate the Registered IOT Device (IOTDEV) operations.
*** Settings ***
Resource environment/variables.txt
Resource ../../../pics.txt
Resource ../../../GenericKeywords.robot
Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false
Library OperatingSystem
*** Test Cases ***
TP_MEC_MEC033_IOTS_IOTDEV_001_OK_01
[Documentation]
... Check that the IUT responds with the list of registered IoT devices when queried by a Service Consumer
... ETSI GS MEC 033 V3.1.1, clause 7.3.3.1
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Retrieve all registered IOT Device information
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is DeviceInfoList
FOR ${element} IN @{response['body']}
Log ${element}
Should Be Equal As Strings ${element}[imsi] ${EXPECTED_IMSI}
Should Be Equal As Strings ${element}[supi] ${EXPECTED_SUPI}
Should Be Equal As Strings ${element}[enabled] ${False}
END
TP_MEC_MEC033_IOTS_IOTDEV_001_OK_02
[Documentation]
... "Check that the IUT responds with the list of registered IoT devices when queried using a filter by a Service Consumer
... ETSI GS MEC 033 V3.1.1, clause 7.3.3.1
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Retrieve all registered IOT Device information with filter or query param ${FILTER_ON_ENABLE}
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is DeviceInfoList
FOR ${element} IN @{response['body']}
Should Be Equal As Strings ${element}[enabled] ${False}
END
TP_MEC_MEC033_IOTS_IOTDEV_001_OK_03
[Documentation]
... "Check that the IUT responds with the list of registered IoT devices when queried by a Service Consumer filtering one field
... ETSI GS MEC 033 V3.1.1, clause 7.3.3.1
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Retrieve all registered IOT Device information with filter or query param ${DEVICE_ID_FIELDS}
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is DeviceInfoList
TP_MEC_MEC033_IOTS_IOTDEV_001_OK_04
[Documentation]
... "Check that the IUT responds with the list of registered IoT devices when queried by a Service Consumer filtering one field
... ETSI GS MEC 033 V3.1.1, clause 7.3.3.1
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Retrieve all registered IOT Device information with filter or query param ${FIELDS_AND_FILTER}
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is DeviceInfoList
TP_MEC_MEC033_IOTS_IOTDEV_001_OK_02
[Documentation]
... Check that the IUT registers the information of an IoT device when requested by a Service Consumer
... ETSI GS MEC 033 V3.1.1, clause 7.3.3.4
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Register IOT Device information DeviceInfo
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is DeviceInfo
${file}= Catenate SEPARATOR= jsons/ DeviceInfo .json
${body}= Get File ${file}
${json}= evaluate json.loads('''${body}''') json
Should Be Equal As Strings ${response['body']['deviceId']} ${json}[deviceId]
Should Be Equal As Strings ${response['body']['imsi']} ${json}[imsi]
Should Be Equal As Strings ${response['body']['supi']} ${json}[supi]
Should Be Equal As Strings ${response['body']['enabled']} ${False}
TP_MEC_MEC033_IOTS_IOTDEV_001_BR_02
[Documentation]
... Check that the IUT returns an error when Service Consumer request to register an IoT device with incorrect parameters
... ETSI GS MEC 033 V3.1.1, clause 7.3.3.4
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Register IOT Device information DeviceInfoBR
Check HTTP Response Status Code Is 400
TP_MEC_MEC033_IOTS_IOTDEV_003_OK
[Documentation]
... Check that the IUT returns the IoT device information when requested by Service Consumer specifying the device identifier
... ETSI GS MEC 033 V3.1.1, clause 7.4.3.1
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Retrieve specific registered IOT Device information ${DEVICE_ID}
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is DeviceInfo
Should Be Equal As Strings ${response['body']['deviceId']} ${DEVICE_ID}
TP_MEC_MEC033_IOTS_IOTDEV_003_NF
[Documentation]
... Check that the IUT returns error when Service Consumer request to retrieve a not registered IoT device
... ETSI GS MEC 033 V3.1.1, clause 7.4.3.1
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Retrieve specific registered IOT Device information ${NOT_EXISTING_DEVICE_ID}
Check HTTP Response Status Code Is 404
TP_MEC_MEC033_IOTS_IOTDEV_004_OK
[Documentation]
... Check that the IUT returns an error when Service Consumer request to register an IoT device with incorrect parameters
... ETSI GS MEC 033 V3.1.1, clause 7.4.3.2
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Update IOT Device information ${DEVICE_ID} DeviceInfoUpdate
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is DeviceInfo
TP_MEC_MEC033_IOTS_IOTDEV_004_NF
[Documentation]
... Check that the IUT returns an error when a Service Consumer requests to update a not registered IoT device
... ETSI GS MEC 033 V3.1.1, clause 7.4.3.2
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Update IOT Device information ${NOT_EXISTING_DEVICE_ID} DeviceInfoUpdate
Check HTTP Response Status Code Is 404
TP_MEC_MEC033_IOTS_IOTDEV_004_BR
[Documentation]
... Check that the IUT returns an error when a Service Consumer requests to update an existing IoT device with incorrect parameters
... ETSI GS MEC 033 V3.1.1, clause 7.4.3.2
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Update IOT Device information ${NOT_EXISTING_DEVICE_ID} DeviceInfoUpdateBR
Check HTTP Response Status Code Is 400
TP_MEC_MEC033_IOTS_IOTDEV_005_OK
[Documentation]
... Check that the IUT deregisters an IoT device information when requested by a Service Consumer specifying the IoT registered device identifier
... ETSI GS MEC 033 V3.1.1, clause 7.4.3.5
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Deregister IOT Device information ${DEVICE_ID}
Check HTTP Response Status Code Is 204
TP_MEC_MEC033_IOTS_IOTDEV_005_NF
[Documentation]
... "Check that the IUT returns an error when a Service Consumer requests to deregisters an IoT device using incorrect parameters
... ETSI GS MEC 033 V3.1.1, clause 7.4.3.5
... https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
Deregister IOT Device information ${NOT_EXISTING_DEVICE_ID}
Check HTTP Response Status Code Is 404
############################################################################
############################################################################
############################################################################
*** Keywords ***
Retrieve all registered IOT Device information
Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"*/*"}
Set Headers {"Authorization":"${TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/registered_devices
${output}= Output response
Set Suite Variable ${response} ${output}
Retrieve all registered IOT Device information with filter or query param
[Arguments] ${filter_and_query_param}
Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"*/*"}
Set Headers {"Authorization":"${TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/registered_devices?${filter_and_query_param}
${output}= Output response
Set Suite Variable ${response} ${output}
Retrieve specific registered IOT Device information
[Arguments] ${deviceId}
Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"*/*"}
Set Headers {"Authorization":"${TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/registered_devices/${deviceId}
${output}= Output response
Set Suite Variable ${response} ${output}
Register IOT Device information
[Arguments] ${content}
Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
${file}= Catenate SEPARATOR= jsons/ ${content} .json
${body}= Get File ${file}
POST ${apiRoot}/${apiName}/${apiVersion}/registered_devices ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Update IOT Device information
[Arguments] ${deviceId} ${content}
Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
${file}= Catenate SEPARATOR= jsons/ ${content} .json
${body}= Get File ${file}
PUT ${apiRoot}/${apiName}/${apiVersion}/registered_devices/${deviceId} ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Deregister IOT Device information
[Arguments] ${deviceId}
Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"*/*"}
Set Headers {"Authorization":"${TOKEN}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/registered_devices/${deviceId}
${output}= Output response
Set Suite Variable ${response} ${output}
#####