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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
/**
* @author STF 519
* @version $Id: $
* @desc This module provides functions used in S1AP
*/
module LibS1AP_Steps
{
//LibCommon
import from LibCommon_Sync all;
import from LibCommon_VerdictControl {type FncRetCode;
function f_setVerdict;};
import from LibCommon_BasicTypesAndValues {type UInt32;};
//LibS1AP
//import from LibS1AP_TypesAndValues all;
import from LibS1AP_Interface all;
import from LibS1AP_PIXITS all;
import from LibS1AP_Templates all;
// import from S1AP_Constants language "ASN.1:1997" all;
// import from S1AP_CommonDataTypes language "ASN.1:1997" all;
// import from S1AP_Containers language "ASN.1:1997" all;
// import from S1AP_IEs language "ASN.1:1997" all;
// import from S1AP_PDU_Contents language "ASN.1:1997" all;
import from S1AP_PDU_Descriptions language "ASN.1:1997" all;
group CommonFunctions{
/**
*
* @desc f_gtZero, return true if value of p_int greater than 0
* @param p_int - integer value
*/
function f_gtZero(integer p_int)
return boolean
{
if (p_int > 0){
return true;
}
else{
return false;
}
}
/**
*
* @desc f_Inc, return incremented value of p_int 0
* @param p_int - integer value
*/
function f_inc( inout UInt32 p_int)
return UInt32
{
p_int:=p_int+1;
return p_int;
}
}//end group CommonFunctions
group ReceivePDU {
/**
* @desc This is a test step that assign common S1AP
* @param
*/
function f_S1APPDU_Get( inout S1AP_PDU p_PDU)
runs on S1APComponent {
vc_recvS1AP_PDU := p_PDU;
if (ischosen(p_PDU.initiatingMessage)){
//TODO...
}
if (ischosen(p_PDU.successfulOutcome)){
//TODO...
}
if (ischosen(p_PDU.unsuccessfulOutcome)){
//TODO...
}
} // end function f_S1APPDU_Get
/**
*
* @desc receive S1AP PDU
* @param p_PDU template of the message to be received
*/
function f_recv_S1AP_PDU(in template S1AP_PDU p_PDU)
runs on S1APComponent
{
var S1AP_PDU v_PDU;
tc_wait.start;
alt
{
[]S1_MMEeNB_P.receive(p_PDU) -> value v_PDU
{
tc_wait.stop;
f_S1APPDU_Get(v_PDU)
}
[] tc_wait.timeout {
setverdict(inconc,"*** " & __SCOPE__ & ": INCONC: Message was not received in due time. ***");
//Stop the component in case of timeout
all timer.stop;
f_componentStop();
}
}
} // end f_recv_S1AP_PDU
function f_recv_S1AP_initiatingMessage(template (present)InitiatingMessage p_initiatingMessage)
runs on S1APComponent
{
f_recv_S1AP_PDU( {initiatingMessage := p_initiatingMessage})
}//end f_recv_S1AP_initiatingMessage
function f_recv_S1AP_successfulOutcome(template (present)SuccessfulOutcome p_successfulOutcome)
runs on S1APComponent
{
f_recv_S1AP_PDU( {successfulOutcome := p_successfulOutcome})
}//end f_recv_S1AP_successfulOutcome
function f_recv_S1AP_unsuccessfulOutcome(template (present)UnsuccessfulOutcome p_unsuccessfulOutcome)
runs on S1APComponent
{
f_recv_S1AP_PDU( {unsuccessfulOutcome := p_unsuccessfulOutcome})
}//end f_recv_S1AP_unsuccessfulOutcome
} // end ReceivePDU
group SendPDU {
/**
* @desc This is a test step that assign common S1AP
* @param
*/
function f_S1APPDU_Set( inout template (value) S1AP_PDU p_PDU)
runs on S1APComponent {
if (ischosen(p_PDU.initiatingMessage)){
//TODO...
vc_sendS1AP_PDU:=valueof(p_PDU);
}
if (ischosen(p_PDU.successfulOutcome)){
//TODO...
vc_sendS1AP_PDU:=valueof(p_PDU);
}
if (ischosen(p_PDU.unsuccessfulOutcome)){
//TODO...
vc_sendS1AP_PDU:=valueof(p_PDU);
}
} // end function f_S1APPDU_Set
/**
*
* @desc send S1AP PDU
* @param p_PDU template of the message to be sent
*/
function f_send_S1AP_PDU(template (value) S1AP_PDU p_PDU)
runs on S1APComponent
{
f_S1APPDU_Set(p_PDU);
S1_MMEeNB_P.send(p_PDU);
}//end f_send_S1APPDU
function f_send_S1AP_initiatingMessage(template (value)InitiatingMessage p_initiatingMessage)
runs on S1APComponent
{
f_send_S1AP_PDU( {initiatingMessage := p_initiatingMessage})
}//end f_send_S1AP_initiatingMessage
function f_send_S1AP_successfulOutcome(template (value)SuccessfulOutcome p_successfulOutcome)
runs on S1APComponent
{
f_send_S1AP_PDU( {successfulOutcome := p_successfulOutcome})
}//end f_send_S1AP_successfulOutcome
function f_send_S1AP_unsuccessfulOutcome(template (value)UnsuccessfulOutcome p_unsuccessfulOutcome)
runs on S1APComponent
{
f_send_S1AP_PDU( {unsuccessfulOutcome := p_unsuccessfulOutcome})
}//end f_send_S1AP_unsuccessfulOutcome
} // end SendPDU
group GlobalSteps{
/**
* @desc This is a test step that init S1AP component
* @param
*/
function f_S1AP_Init_Component()
runs on S1APComponent {
} // end function f_S1AP_Init_Component
/**
*
* @desc component termination
*/
function f_S1AP_terminate_component()
runs on S1APComponent {
log("component terminated - forced!");
deactivate;
stop;
}
/**
* @desc component termination
*/
function f_componentStop()
runs on S1APComponent {
syncPort.send(m_syncClientStop);
S1_MMEeNB_P.clear;
stop;
}
/**
*
* @desc original copied from older LibCommon_VerdictControl
*/
function f_getVerdict()
return FncRetCode {
var FncRetCode v_ret := e_error;
if (getverdict == pass or getverdict == none) {
v_ret := e_success;
}
return v_ret;
}
/**
*
* @desc function waits for particular time before next expected message
*/
function f_wait(float p_time)
runs on S1APComponent {
tc_wait.start(p_time);
alt {
[] tc_wait.timeout{}
}
}
}// end group GlobalSteps
group Preambles {
group preamble_S1AP{
function f_preambleS1AP_MME()
runs on S1APComponent {
//TODO:...
}
function f_preambleS1AP_eNB()
runs on S1APComponent {
//TODO:...
}
}//end group preamble_S1AP
}// end group Preambles
group Postambles {
group postamble_S1AP{
function f_postambleS1AP_MME()
runs on S1APComponent {
//TODO:...
}
function f_postambleS1AP_eNB()
runs on S1APComponent {
//TODO:...
}
}//end group postamble_S1AP
} //end group Postambles
group DefaultsTestStep
{
altstep a_defaultS1AP()
runs on S1APComponent
{
[] any timer.timeout
{
all timer.stop;
if (vc_serverStop==false) {
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
else {
stop;
}
}
[] S1_MMEeNB_P.receive (S1AP_PDU:{initiatingMessage := ?}) -> value vc_recvS1AP_PDUDefault
{
repeat;
}
[] S1_MMEeNB_P.receive (S1AP_PDU:{successfulOutcome := ?}) -> value vc_recvS1AP_PDUDefault
{
repeat;
}
[] S1_MMEeNB_P.receive (S1AP_PDU:{unsuccessfulOutcome := ?}) -> value vc_recvS1AP_PDUDefault
{
repeat;
}
[] S1_MMEeNB_P.receive (S1AP_PDU:?) -> value vc_recvS1AP_PDUDefault
{
if (vc_serverStop==false) {
f_selfOrClientSyncAndVerdict("error", e_error);
}
else {
stop;
}
}
[] S1_MMEeNB_P.receive
{
if (vc_serverStop==false) {
f_selfOrClientSyncAndVerdict("error", e_error);
}
else {
stop;
}
}
[] a_shutdown() {
// Process temination on error
log("*** a_defaultS1AP() : Process temination on error ***");
// Terminate component execution
stop;
}
}//end a_defaultS1AP
altstep a_defaultS1AP_MME()
runs on S1APComponent
{
[] any timer.timeout
{
all timer.stop;
if (vc_serverStop==false) {
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
else {
stop;
}
}
//TODO:...
}//end a_defaultS1AP_MME
altstep a_defaultS1AP_eNB()
runs on S1APComponent
{
[] any timer.timeout
{
all timer.stop;
if (vc_serverStop==false) {
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
else {
stop;
}
}
//TODO:...
}//end a_defaultS1AP_eNB
} // end of group DefaultsTestStep
} // end module LibS1AP_Steps