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
/**
* @author ETSI / STF569
* @version $URL:$
* $ID:$
* @desc This module provides the MEC test cases.
* @copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* All rights reserved.
* @see ETSI GS MEC 003, Draft ETSI GS MEC 013 V2.0.3 (2018-10)
*/
module AtsMec_AppLCM_TestCases {
// Libcommon
import from LibCommon_Sync all;
// LibHttp
import from LibItsHttp_TypesAndValues all;
import from LibItsHttp_Functions all;
import from LibItsHttp_Templates all;
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_TestSystem all;
import from AppLCM_Templates all;
import from AppLCM_Pics all;
import from AppLCM_Pixits all;
// LibMec
import from LibMec_Functions all;
import from LibMec_Pics all;
import from LibMec_Pixits all;
group App_lifecycle_management {
/**
* @desc: Check that MEC API provider creates a new App Package when requested
* ETSI GS MEC 010-2 2.0.10, clause 7.5.1.3.1
* ETSI GS MEC 010-2 2.0.10, Table 6.2.2.3.2-1 //CreateAppInstanceRequest
* ETSI GS MEC 010-2 2.0.10, Table 6.2.2.4.2-1 //AppInstanceInfo
*/
testcase TP_MEC_MEX_LCM_001_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
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
var HttpMessage v_response;
// Test control
if (not(PIC_APP_LCM_MANAGEMENT)){
log("*** " & testcasename() & ": PIC_APP_LCM_MANAGEMENT required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_MEX_LCM_URI,
v_headers,
m_http_message_body_json(
m_body_json_lifecycle_management(
m_lifecycle_management_create(
PX_APP_D_ID
)
)
)
)
));
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_201_created(
mw_http_message_body_json(
mw_body_json_mex_lcm_instance_info(
mw_lcm_instance_info(
-,
PX_APP_D_ID,
PX_INSTANTIATION_STATE
)
))))) -> value v_response {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with the App LCM Instance info details ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
} // End of testcase TP_MEC_MEX_LCM_001_OK
/**
* @desc: Check that MEC API provider sends an error when it receives
* a malformed request for the creation of a new App Instance
* ETSI GS MEC 010-2 2.0.10, clause 7.5.1.3.1
* ETSI GS MEC 010-2 2.0.10, Table 6.2.2.3.2-1 //CreateAppInstanceRequest
*/
testcase TP_MEC_MEX_LCM_001_BR() runs on HttpComponent system HttpTestAdapter {
// Local variables
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
var HttpMessage v_response;
// Test control
if (not(PIC_APP_LCM_MANAGEMENT)){
log("*** " & testcasename() & ": PIC_APP_LCM_MANAGEMENT required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_MEX_LCM_URI,
v_headers,
m_http_message_body_json(
m_body_json_lifecycle_management_with_error(
m_lifecycle_management_create_with_error(
PX_APP_D_ID
)
)
)
)));
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_400_bad_request(
))) -> value v_response {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with a Bad response ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
} // End of testcase TP_MEC_MEX_LCM_001_BR
/**
* @desc: Check that MEC API provider retrieves the list of App instances when requested
* ETSI GS MEC 010-2 2.0.10, clause 7.5.1.3.2
* ETSI GS MEC 010-2 2.0.10, Table 6.2.3.3.2-1 //AppInstanceInfo
*/
testcase TP_MEC_MEX_LCM_002_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
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
var HttpMessage v_response;
// Test control
if (not(PIC_APP_LCM_MANAGEMENT)){
log("*** " & testcasename() & ": PIC_APP_LCM_MANAGEMENT required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_MEX_LCM_URI,
v_headers
)));
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_ok(
mw_http_message_body_json(
mw_body_json_mex_lcm_instance_info_list({
*,
mw_lcm_instance_info(
Loading
Loading full blame…