Newer
Older
/*
* @author TTF T016
* @version $Id$
* @desc This module provides the TCfunctions used by the test component
* for SCCAS tests.
*/
module AtsSccas_TCFunctions_TS124292 {
// XSD support
import from XSD all;
// LibCommon
import from LibCommon_Sync all;
import from LibCommon_VerdictControl all;
import from LibCommon_DataStrings all;
// LibSip
import from LibSip_SIPTypesAndValues all;
import from LibSip_SDPTypes all;
import from LibSip_Templates all;
import from LibSip_Steps all;
import from LibSip_Interface all;
import from LibSip_PIXITS all;
// LibIms
import from LibIms_Templates all;
import from LibIms_Steps all;
import from LibIms_SIPTypesAndValues all;
import from LibIms_Interface all;
// AtsSccas
// import from AtsSccas_TestSystem all;
import from AtsSccas_Templates all;
import from AtsSccas_Steps all;
import from AtsSccas_PICS all;
import from AtsSccas_PIXITS all;
group isc_registration {
/*
* @desc This is the test case function for TC_ISC_SCCAS_MSC_REG_01
* @param p_cSeq_s
*/
function f_TC_ISC_SCCAS_MSC_REG_01(in CSeq p_cSeq_s) runs on ImsComponent {
// Local variables
f_init_userprofile(c_userProfile_UE1atSUThome);
f_initSipUrl(c_serviceProfile_EMERGENCY);
f_init_interfaceprofile(c_interfaceProfile_IMS_SUT_PCSCF1);
f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync
// Registration
f_awaitingRegistration_IMS(
v_cSeq_s,
valueof(m_SipUrl_currDomain(vc_userprofile)),
mw_pChargingVector(-, *), // TODO To be refined during validation - Clause 6.3.2 Initial registration Point 11
mw_pVisitedNetworkID(?), // TODO To be refined during validation - Clause 6.3.2 Initial registration Point 12
-, // See helper f_check_contact_msc
mw_Authorization_digest( // Clause 6.3.2 Initial registration Point 4
{"username", {tokenOrHost := PX_IMS_TS_UE1_PRIVAT_USERNAME}},
{"realm", {tokenOrHost := PX_IMS_TS_UE1_PUBLIC_USER}},
{"integrity-protected", {tokenOrHost := "auth-done"}},
{"nonce", {tokenOrHost := ""}}
))
),
m_expires(600000), // Clause 6.3.2 Initial registration Point 7
mw_sccas_supported({"gruu"}), // Clause 6.3.2 Initial registration Point 8
mw_require_path, // Clause 6.3.2 Initial registration Point 9
mw_pAccessNetworkInfo // TODO To be refined during validation - Clause 6.3.2 Initial registration Point 13
));
// Check vc_request.msgHeader.contact for 3GPP requirement
f_check_contact_msc(vc_request.msgHeader.contact); // Clause 6.3.2 Initial registration Point 5
f_check_via_msc(vc_request.msgHeader.via); // Clause 6.3.2 Initial registration Point 6
f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); // sync
// Deregistration
f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync
} // End of function f_TC_ISC_SCCAS_MSC_REG_01
/*
* @desc This is the test case function for TC_ISC_SCCAS_MSC_REG_02
* @param p_cSeq_s
*/
function f_TC_ISC_SCCAS_MSC_REG_02(in CSeq p_cSeq_s) runs on ImsComponent {
// Local variables
var CSeq v_cSeq_s;
f_init_userprofile(c_userProfile_UE1atSUThome);
f_initSipUrl(c_serviceProfile_EMERGENCY);
f_init_interfaceprofile(c_interfaceProfile_IMS_SUT_PCSCF1);
f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync
// Registration
f_awaitingRegistration_IMS(
v_cSeq_s,
valueof(m_SipUrl_currDomain(vc_userprofile)),
-,
mw_pChargingVector(-, *), // TODO To be refined during validation - Clause 6.3.2 Initial registration Point 11
mw_pVisitedNetworkID(?), // TODO To be refined during validation - Clause 6.3.2 Initial registration Point 12
-, // See helper f_check_contact_msc
mw_Authorization_digest( // Clause 6.3.2 Initial registration Point 4
mw_digestResponse(
(
{"username", {tokenOrHost := PX_IMS_TS_UE1_PRIVAT_USERNAME}},
{"realm", {tokenOrHost := PX_IMS_TS_UE1_PUBLIC_USER}},
{"integrity-protected", {tokenOrHost := "auth-done"}},
{"nonce", {tokenOrHost := ""}}
))
),
m_expires(600000), // Clause 6.3.2 Initial registration Point 7
mw_sccas_supported({"gruu"}), // Clause 6.3.2 Initial registration Point 8
mw_require_path, // Clause 6.3.2 Initial registration Point 9
mw_pAccessNetworkInfo // TODO To be refined during validation - Clause 6.3.2 Initial registration Point 13
));
// Check vc_request.msgHeader.contact for 3GPP requirement
f_check_contact_msc(vc_request.msgHeader.contact); // Clause 6.3.2 Initial registration Point 5
f_check_via_msc(vc_request.msgHeader.via); // Clause 6.3.2 Initial registration Point 6
f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); // sync
// Deregistration
f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync
} // End of function f_TC_ISC_SCCAS_MSC_REG_02
} // End of group isc_registration
group isc_subscribe {
/*
* @desc This is the test case function for TC_ISC_SCCAS_MSC_SUB_01
* @param p_cSeq_s
*/
function f_TC_ISC_SCCAS_MSC_SUB_01(in CSeq p_cSeq_s) runs on ImsComponent {
// Local variables
var template SUBSCRIBE_Request v_subscibe;
// Preambule
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
m_SUBSCRIBE_Request_Base(
vc_requestUri,
vc_callId,
p_cSeq_s,
vc_from, vc_to, vc_via_REG
));
f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync
// Registration
f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); // sync
// Deregistration
f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync
} // End of function f_TC_ISC_SCCAS_MSC_SUB_01
/*
* @desc This is the test case function for TC_ISC_SCCAS_MSC_SUB_02
* @param p_cSeq_s
*/
function f_TC_ISC_SCCAS_MSC_SUB_02(in CSeq p_cSeq_s) runs on ImsComponent {
// Local variables
var template SUBSCRIBE_Request v_subscibe;
// Preambule
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
m_SUBSCRIBE_Request_Base(
vc_requestUri,
vc_callId,
p_cSeq_s,
vc_from, vc_to, vc_via_REG
));
f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync
// Registration
f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); // sync
// Deregistration
f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync
} // End of function f_TC_ISC_SCCAS_MSC_SUB_02
} // End of isc_subscribe
group isc_reregistration {
/*
* @desc This is the test case function for TC_ISC_SCCAS_MSC_REREG_01
* @param p_cSeq_s
*/
function f_TC_ISC_SCCAS_MSC_REREG_01(in CSeq p_cSeq_s) runs on ImsComponent {
// Local variables
var template REGISTER_Request v_register;
// Preambule
v_register := valueof(
m_REGISTER_Request_Base(
vc_requestUri,
vc_callId, p_cSeq_s, vc_from, vc_to, vc_via_REG, vc_contact,
vc_authorization
));
f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync
// Registration
f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); // sync
// Deregistration
f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync
} // End of function f_TC_ISC_SCCAS_MSC_REREG_01
/*
* @desc This is the test case function for TC_ISC_SCCAS_MSC_REREG_02
* @param p_cSeq_s
*/
function f_TC_ISC_SCCAS_MSC_REREG_02(in CSeq p_cSeq_s) runs on ImsComponent {
// Local variables
var template REGISTER_Request v_register;
// Preambule
v_register := valueof(
m_REGISTER_Request_Base(
vc_requestUri,
vc_callId, p_cSeq_s, vc_from, vc_to, vc_via_REG, vc_contact,
vc_authorization
));
f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync
// Registration
f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); // sync
// Deregistration
f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync
} // End of function f_TC_ISC_SCCAS_MSC_REREG_02
} // End of isc_reregistration
group call_origination {
/*
* @desc This is the test case function for TC_ISC_SCCAS_MSC_CALL_ORG_01
* @param p_cSeq_s
*/
function f_TC_ISC_SCCAS_MSC_CALL_ORG_01(in CSeq p_cSeq_s) runs on ImsComponent {
// Local variables
var template INVITE_Request v_invite;
// Preambule
/*f_init_userprofile(c_userProfile_UE1atSUThome);
f_initSipUrl(c_userProfile_UE1atSUThome);
f_init_interfaceprofile(c_interfaceProfile_IMS_SUT_BCF);
LibIms_Steps.f_setHeadersINVITE(p_cSeq_s, f_initSipUrl(c_serviceProfile_EMERGENCY), f_initSipUrl(c_userProfile_UE1atSUThome));
f_init_sdp_userprofile(vc_sdp_local, c_userProfile_UE1atSUThome, c_userProfile_Huawei);
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
m_INVITE_Request_sdp(
vc_requestUri,
vc_callId,
p_cSeq_s,
vc_from, vc_to, vc_via_REG,
vc_contact,
vc_authorization,
m_MBody_SDP(vc_sdp_local)
));*/
f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync
// Registration
f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); // sync
// Deregistration
f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync
} // End of function f_TC_ISC_SCCAS_MSC_CALL_ORG_01
/*
* @desc This is the test case function for TC_ISC_SCCAS_MSC_CALL_ORG_02
* @param p_cSeq_s
*/
function f_TC_ISC_SCCAS_MSC_CALL_ORG_02(in CSeq p_cSeq_s) runs on ImsComponent {
// Local variables
var template INVITE_Request v_invite;
// Preambule
m_REGISTER_Request_Base(
vc_requestUri,
vc_callId, p_cSeq_s, vc_from, vc_to, vc_via_REG, vc_contact,
vc_authorization
f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync
// Registration
f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); // sync
// Deregistration
f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync
} // End of function f_TC_ISC_SCCAS_MSC_CALL_ORG_02
} // End of group call_origination
group helpers {
// Check vc_request.msgHeader.contact for 3GPP requirement
function f_check_contact_msc(in Contact p_contact) runs on ImsComponent {
if (ischosen(p_contact.contactBody.wildcard) == false) {
log("f_check_contact_msc: FAIL: Invalid contact content");
f_setVerdict(e_error);
return;
}
// Looking for g.3gpp.icsi-ref
var template charstring m_found_pattern := pattern "*g.3gpp.icsi-ref*";
if (regexp(p_contact.contactBody.wildcard, m_found_pattern, 0) == "") {
log("f_check_contact_msc: FAIL: g.3gpp.icsi-ref is not present");
f_setVerdict(e_error); // g.3gpp.icsi-ref is not present
return;
}
// Looking for g.3gpp.icsi-ref media
m_found_pattern := pattern "*g.3gpp.icsi-ref media*";
if (regexp(p_contact.contactBody.wildcard, m_found_pattern, 0) == "") {
log("f_check_contact_msc: FAIL: g.3gpp.icsi-ref media is not present");
f_setVerdict(e_error); // g.3gpp.icsi-ref media is not present
return;
}
// not containing "reg-id"
m_found_pattern := pattern "*reg-id*";
if (regexp(p_contact.contactBody.wildcard, m_found_pattern, 0) != "") {
log("f_check_contact_msc: FAIL: reg-id should not be present");
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
f_setVerdict(e_error); // reg-id should not be present
return;
}
// Checking succeed, keep current status
} // End of f_check_contact_msc
// Check vc_request.msgHeader.via for IP address or FQDN of the MSC Server
function f_check_via_msc(in Via p_via) runs on ImsComponent {
for (var integer i := 0; i < lengthof(p_via.viaBody); i := i + 1) {
// TODO: check
/*record ViaBody {
SentProtocol sentProtocol,
HostPort sentBy,
SemicolonParam_List viaParams optional
}
record SentProtocol {
charstring protocolName,
charstring protocolVersion,
charstring transport
}
*/
} // End of 'for' statement
// Checking succeed, keep current status
} // End of function f_check_via_msc
} // End of group helpers