sgsn: Proper shutdown of RAN_Adapter components
Otherwise TTCN3 errors sproadically during shutdown:
""""
SCCP_Emulation.ttcn:5661 Receive operation on port SCCP_SP_PORT succeeded, message from SGSN_Test_0-RAN(414)
...
SCCP_Emulation.ttcn:5293 Sent on MTP3_SCCP_PORT to SGSN_Test_0-M3UA(415) @SCCP_Types.ASP_MTP3_TRANSFERreq_sccp
SCCP_Emulation.ttcn:5293 Outgoing message was mapped to @MTP3asp_Types.ASP_MTP3_TRANSFERreq
SCCP_Emulation.ttcn:5293 Dynamic test case error: Sending data on the connection of port MTP3_SCCP_PORT to 415:MTP3_SP_PORT failed. (Broken pipe)
SCCP_Emulation.ttcn:5293 setverdict(error): none -> error
"""
Similar shutdown is already done in f_cleanup() of SCCP_Tests.ttcn.
Related: OS#4176
Change-Id: I471eb851e5d41de5d8d974ec81be27024d7d313a
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index b68df85..c9309dd 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -332,6 +332,14 @@
f_vty_enable_echo_interval(g_use_echo);
}
+function f_cleanup() runs on test_CT {
+ var integer i;
+ for (i := 0; i < NUM_RNC; i := i+1) {
+ f_ran_adapter_cleanup(g_ranap[i]);
+ }
+ self.stop;
+}
+
private function RncUnitdataCallback(RANAP_PDU ranap)
runs on RAN_Emulation_CT return template RANAP_PDU {
var template RANAP_PDU resp := omit;
@@ -458,6 +466,7 @@
testcase TC_wait_ns_up() runs on test_CT {
f_init();
f_sleep(20.0);
+ f_cleanup();
}
function f_send_llc(template (value) PDU_LLC llc_pdu, integer gb_index := 0) runs on BSSGP_ConnHdlr {
@@ -688,6 +697,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach), testcasename(), g_gb, 1);
vc_conn.done;
+ f_cleanup();
}
testcase TC_attach_mnc3() runs on test_CT {
@@ -696,6 +706,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach), testcasename(), g_gb, 1001);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_attach_umts_aka_umts_res(charstring id) runs on BSSGP_ConnHdlr {
@@ -708,6 +719,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_umts_aka_umts_res), testcasename(), g_gb, 1002);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_attach_umts_aka_gsm_sres(charstring id) runs on BSSGP_ConnHdlr {
@@ -720,6 +732,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_umts_aka_gsm_sres), testcasename(), g_gb, 1003);
vc_conn.done;
+ f_cleanup();
}
/* MS never responds to ID REQ, expect ATTACH REJECT */
@@ -746,6 +759,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_auth_id_timeout), testcasename(), g_gb, 2, 40.0);
vc_conn.done;
+ f_cleanup();
}
/* HLR never responds to SAI REQ, expect ATTACH REJECT */
@@ -766,6 +780,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_timeout), testcasename(), g_gb, 3);
vc_conn.done;
+ f_cleanup();
}
/* HLR rejects SAI, expect ATTACH REJECT */
@@ -787,6 +802,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_reject), testcasename(), g_gb, 4);
vc_conn.done;
+ f_cleanup();
}
/* HLR never responds to UL REQ, expect ATTACH REJECT */
@@ -816,6 +832,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_timeout), testcasename(), g_gb, 5);
vc_conn.done;
+ f_cleanup();
}
/* HLR rejects UL REQ, expect ATTACH REJECT */
@@ -846,6 +863,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_reject), testcasename(), g_gb, 6);
vc_conn.done;
+ f_cleanup();
}
@@ -871,6 +889,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_combined), testcasename(), g_gb, 7);
vc_conn.done;
+ f_cleanup();
}
/* Attempt of GPRS ATTACH in 'accept all' mode */
@@ -895,6 +914,7 @@
f_vty_config(SGSNVTY, "sgsn", "auth-policy accept-all");
vc_conn := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb, 8);
vc_conn.done;
+ f_cleanup();
}
/* Attempt of GPRS ATTACH in 'accept all' mode */
@@ -933,6 +953,7 @@
/* test with home IMSI: Must Accept */
vc_conn := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb, 10);
vc_conn.done;
+ f_cleanup();
}
/* Routing Area Update from Unknown TLLI -> REJECT */
@@ -954,6 +975,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_rau_unknown), testcasename(), g_gb, 11);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_attach_rau(charstring id) runs on BSSGP_ConnHdlr {
@@ -969,6 +991,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_rau), testcasename(), g_gb, 12);
vc_conn.done;
+ f_cleanup();
}
/* general GPRS DETACH helper */
@@ -1022,6 +1045,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_detach_unknown_nopoweroff), testcasename(), g_gb, 13);
vc_conn.done;
+ f_cleanup();
}
/* IMSI DETACH (power-off) for unknown TLLI */
@@ -1034,6 +1058,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_detach_unknown_poweroff), testcasename(), g_gb, 14);
vc_conn.done;
+ f_cleanup();
}
/* IMSI DETACH (non-power-off) for known TLLI */
@@ -1049,6 +1074,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_detach_nopoweroff), testcasename(), g_gb, 15);
vc_conn.done;
+ f_cleanup();
}
/* IMSI DETACH (power-off) for known TLLI */
@@ -1064,6 +1090,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_detach_poweroff), testcasename(), g_gb, 16);
vc_conn.done;
+ f_cleanup();
}
type record PdpActPars {
@@ -1364,6 +1391,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_pdp_act), testcasename(), g_gb, 17);
vc_conn.done;
+ f_cleanup();
}
/* PDP Context activation for not-attached subscriber; expect fail */
@@ -1392,6 +1420,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_pdp_act_unattached), testcasename(), g_gb, 18);
vc_conn.done;
+ f_cleanup();
}
/* ATTACH + PDP CTX ACT + user plane traffic */
@@ -1411,6 +1440,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user), testcasename(), g_gb, 19);
vc_conn.done;
+ f_cleanup();
}
/* ATTACH + PDP CTX ACT; reject from GGSN */
@@ -1430,6 +1460,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_ggsn_reject), testcasename(), g_gb, 20);
vc_conn.done;
+ f_cleanup();
}
/* ATTACH + PDP CTX ACT + user plane traffic + PDP CTX DEACT in MO direction */
@@ -1451,6 +1482,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user_deact_mo), testcasename(), g_gb, 21);
vc_conn.done;
+ f_cleanup();
}
/* ATTACH + PDP CTX ACT + user plane traffic + PDP CTX DEACT in MT direction */
@@ -1472,6 +1504,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user_deact_mt), testcasename(), g_gb, 22);
vc_conn.done;
+ f_cleanup();
}
/* Test MS sending a duplicate Deact PDP Ctx (OS#3956). */
@@ -1522,6 +1555,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_deact_dup), testcasename(), g_gb, 46);
vc_conn.done;
+ f_cleanup();
}
/* ATTACH + ATTACH (2nd) */
@@ -1541,6 +1575,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_forget_tlli_attach), testcasename(), g_gb, 22);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_attach_echo_timeout(charstring id) runs on BSSGP_ConnHdlr {
@@ -1600,6 +1635,7 @@
vc_conn := f_start_handler(refers(f_TC_attach_echo_timeout), testcasename(), g_gb, 67, 50.0);
vc_conn.done;
g_use_echo := false;
+ f_cleanup();
}
private function f_TC_attach_restart_ctr_echo(charstring id) runs on BSSGP_ConnHdlr {
@@ -1641,6 +1677,7 @@
vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_echo), testcasename(), g_gb, 23, 30.0);
vc_conn.done;
g_use_echo := false
+ f_cleanup();
}
private function f_TC_attach_restart_ctr_create(charstring id) runs on BSSGP_ConnHdlr {
@@ -1680,6 +1717,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_create), testcasename(), g_gb, 24, 30.0);
vc_conn.done;
+ f_cleanup();
}
/* ATTACH + PDP CTX ACT + user plane traffic + PDP CTX DEACT in MT direction + trigger T3395 */
@@ -1716,6 +1754,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_deact_mt_t3395_expire), testcasename(), g_gb, 25, 60.0);
vc_conn.done;
+ f_cleanup();
}
/* ATTACH + PDP CTX ACT dropped + retrans */
@@ -1774,6 +1813,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_deact_gtp_retrans), testcasename(), g_gb, 27);
vc_conn.done;
+ f_cleanup();
}
/* Test that SGSN GTP response retransmit queue works fine */
@@ -1833,6 +1873,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_deact_gtp_retrans_resp), testcasename(), g_gb, 28);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_hlr_location_cancel_request_update(charstring id) runs on BSSGP_ConnHdlr {
@@ -1881,6 +1922,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user_error_ind_ggsn), testcasename(), g_gb, 26);
vc_conn.done;
+ f_cleanup();
}
testcase TC_hlr_location_cancel_request_update() runs on test_CT {
@@ -1893,6 +1935,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_hlr_location_cancel_request_update), testcasename(), g_gb, 31);
vc_conn.done;
+ f_cleanup();
}
@@ -1924,6 +1967,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_hlr_location_cancel_request_withdraw), testcasename(), g_gb, 29);
vc_conn.done;
+ f_cleanup();
}
@@ -1954,6 +1998,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_hlr_location_cancel_request_unknown_subscriber_withdraw), testcasename(), g_gb, 30);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_hlr_location_cancel_request_unknown_subscriber_update(charstring id) runs on BSSGP_ConnHdlr {
@@ -1970,6 +2015,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_hlr_location_cancel_request_unknown_subscriber_update), testcasename(), g_gb, 30);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_attach_detach_check_subscriber_list(charstring id) runs on BSSGP_ConnHdlr {
@@ -1991,6 +2037,7 @@
vc_conn.done;
f_vty_transceive_not_match(SGSNVTY, "show subscriber cache", pattern "* IMSI: {imsi}*");
+ f_cleanup();
}
/* Attempt an attach, but loose the Identification Request (IMEI) */
@@ -2036,6 +2083,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_no_imei_response), testcasename(), g_gb, 32, 60.0);
vc_conn.done;
+ f_cleanup();
}
/* Attempt an attach, but loose the Identification Request (IMSI) */
@@ -2084,6 +2132,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_no_imsi_response), testcasename(), g_gb, 35, 60.0);
vc_conn.done;
+ f_cleanup();
}
private function f_sgsn_vty_destroy_subscriber_imsi(TELNETasp_PT pt, charstring imsi) {
@@ -2105,6 +2154,7 @@
f_vty_transceive_match(SGSNVTY, "show subscriber cache", pattern "* IMSI: {imsi}*");
f_sgsn_vty_destroy_subscriber_imsi(SGSNVTY, imsi);
+ f_cleanup();
}
private function f_TC_attach_closed_imsi_added(charstring id) runs on BSSGP_ConnHdlr {
@@ -2167,6 +2217,7 @@
/* test with foreign IMSI: Must Reject */
vc_conn := f_start_handler(refers(f_TC_attach_closed_add_vty), testcasename(), g_gb, 9);
vc_conn.done;
+ f_cleanup();
}
/* Attempt an attach, but never answer a Attach Complete */
@@ -2207,6 +2258,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_check_complete_resend), testcasename(), g_gb, 36, 60.0);
vc_conn.done;
+ f_cleanup();
}
private function f_routing_area_update(RoutingAreaIdentificationV ra, integer bssgp := 0) runs on BSSGP_ConnHdlr {
@@ -2254,6 +2306,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_rau_a_a), testcasename(), g_gb, 37);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_attach_rau_a_b(charstring id) runs on BSSGP_ConnHdlr {
@@ -2285,6 +2338,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_rau_a_b), testcasename(), g_gb, 38);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_attach_gmm_attach_req_while_gmm_attach(charstring id) runs on BSSGP_ConnHdlr {
@@ -2357,6 +2411,7 @@
f_vty_config(SGSNVTY, "sgsn", "auth-policy accept-all");
vc_conn := f_start_handler(refers(f_TC_attach_gmm_attach_req_while_gmm_attach), testcasename(), g_gb, 39);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_attach_usim_resync(charstring id) runs on BSSGP_ConnHdlr {
@@ -2485,6 +2540,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_attach_usim_resync), testcasename(), g_gb, 40);
vc_conn.done;
+ f_cleanup();
}
@@ -2502,6 +2558,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_llc_null), testcasename(), g_gb, 41);
vc_conn.done;
+ f_cleanup();
}
/* Send LLC SABM to see if the SGSN rejects it properly with DM */
@@ -2518,6 +2575,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_llc_sabm_dm_llgmm), testcasename(), g_gb, 42);
vc_conn.done;
+ f_cleanup();
}
/* Send LLC SABM to see if the SGSN rejects it properly with DM */
@@ -2534,6 +2592,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_llc_sabm_dm_ll5), testcasename(), g_gb, 43);
vc_conn.done;
+ f_cleanup();
}
/* test XID handshake with empty L3 info: expect empty return (some phones require that, OS#3426 */
@@ -2563,6 +2622,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_xid_empty_l3), testcasename(), g_gb, 44);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_xid_n201u(charstring id) runs on BSSGP_ConnHdlr {
@@ -2591,6 +2651,7 @@
f_sleep(1.0);
vc_conn := f_start_handler(refers(f_TC_xid_n201u), testcasename(), g_gb, 45);
vc_conn.done;
+ f_cleanup();
}
private function f_TC_attach_pdp_act_gmm_detach(charstring id) runs on BSSGP_ConnHdlr {
@@ -2617,6 +2678,7 @@
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_gmm_detach), testcasename(), g_gb, 26);
vc_conn.done;
+ f_cleanup();
}