Change in osmo-ttcn3-hacks[master]: BTS_Tests: Use Misc_Helpers.f_shutdown consistently
daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/11452 ) Change subject: BTS_Tests: Use Misc_Helpers.f_shutdown consistently .. BTS_Tests: Use Misc_Helpers.f_shutdown consistently Replace all calls to setverdict(fail) with f_shutdown() since I'd rather fail and stop early in case we encounter an error. Only replace setverdict(pass) with f_shutdown() if it is followed by mtc.stop Remove internal function f_shutdown and use the one from Misc_Helpers Change-Id: Ia8b01a1876e969d6f0760ea625e4df83af4f54ca --- M bts/BTS_Tests.ttcn M bts/gen_links.sh 2 files changed, 131 insertions(+), 208 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index fe0a933..5b073ef 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -1,5 +1,6 @@ module BTS_Tests { +import from Misc_Helpers all; import from General_Types all; import from GSM_Types all; import from GSM_RR_Types all; @@ -270,8 +271,7 @@ pcu_last_info := sd.data; } [] pt.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(?, ?, ?))) -> value sd { - setverdict(fail, "Invalid PCU Version/BTS Number received"); - mtc.stop; + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Invalid PCU Version/BTS Number received"); } } @@ -289,8 +289,7 @@ alt { [] as_pcu_info_ind(pt, pcu_conn_id, pcu_last_info); [] T.timeout { - setverdict(fail, "Timeout waiting for PCU INFO_IND"); - mtc.stop; + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for PCU INFO_IND"); } } } @@ -341,8 +340,7 @@ alt { [] RSL_CCHAN.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}); [] T.timeout { - setverdict(fail, "Timeout waiting for ASP_IPA_EVENT_UP"); - mtc.stop; + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for ASP_IPA_EVENT_UP"); } } f_sleep(0.5); /* workaround for OS#3000 */ @@ -366,12 +364,6 @@ } } -function f_shutdown() runs on test_CT { - /* mtc.stop cleanly stops testcase execution to avoid unclean shutdown */ - all component.stop; - mtc.stop; -} - /* Attach L1CTL to master test_CT (classic tests, non-handler mode) */ function f_init_l1ctl() runs on test_CT { map(self:L1CTL, system:L1CTL); @@ -415,8 +407,7 @@ private altstep as_Tguard() runs on ConnHdlr { [] g_Tguard.timeout { - setverdict(fail, "Tguard timeout"); - mtc.stop; + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Tguard timeout"); } } @@ -430,8 +421,7 @@ res := TRXC_CodecPort_CtrlFunct.f_IPL4_connect(BB_TRXC, mp_bb_trxc_ip, mp_bb_trxc_port, "", -1, -1, {udp:={}}, {}); if (not ispresent(res.connId)) { - setverdict(fail, "Could not connect to trx-control interface of trxcon, check your configuration"); - mtc.stop; + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Could not connect to trx-control interface of trxcon, check your configuration"); } g_bb_trxc_conn_id := res.connId; } @@ -481,15 +471,13 @@ setverdict(pass); } [] T.timeout { - setverdict(fail, "Timeout expecting " & id); - mtc.stop; + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout expecting " & id); } [not ignore_other] as_l1_sacch(); [not ignore_other] as_meas_res(); [not ignore_other] as_l1_dcch(); [not ignore_other] RSL.receive { - setverdict(fail, "Unexpected RSL message received"); - mtc.stop; + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Unexpected RSL message received"); } [ignore_other] RSL.receive { repeat; } } @@ -566,7 +554,7 @@ f_init(testcasename()); vc_conn := f_start_handler(refers(f_TC_chan_act_stress), pars); vc_conn.done; - f_shutdown(); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); } /* Test if re-activation of an already active channel fails as expected */ @@ -576,8 +564,7 @@ RSL.send(ts_RSL_CHAN_ACT(g_chan_nr, g_pars.chan_mode)); alt { [] RSL.receive(tr_RSL_CHAN_ACT_ACK(g_chan_nr)) { - setverdict(fail, "Unexpected CHAN ACT ACK on double activation"); - mtc.stop; + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Unexpected CHAN ACT ACK on double activation"); } [] RSL.receive(tr_RSL_CHAN_ACT_NACK(g_chan_nr)) {
Change in osmo-ttcn3-hacks[master]: BTS_Tests: Use Misc_Helpers.f_shutdown consistently
Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/11452 ) Change subject: BTS_Tests: Use Misc_Helpers.f_shutdown consistently .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/11452 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia8b01a1876e969d6f0760ea625e4df83af4f54ca Gerrit-Change-Number: 11452 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Oct 2018 14:15:59 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmo-ttcn3-hacks[master]: BTS_Tests: Use Misc_Helpers.f_shutdown consistently
Hello Pau Espin Pedrol, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/11452 to look at the new patch set (#2). Change subject: BTS_Tests: Use Misc_Helpers.f_shutdown consistently .. BTS_Tests: Use Misc_Helpers.f_shutdown consistently Replace all calls to setverdict(fail) with f_shutdown() since I'd rather fail and stop early in case we encounter an error. Only replace setverdict(pass) with f_shutdown() if it is followed by mtc.stop Remove internal function f_shutdown and use the one from Misc_Helpers Change-Id: Ia8b01a1876e969d6f0760ea625e4df83af4f54ca --- M bts/BTS_Tests.ttcn M bts/gen_links.sh 2 files changed, 131 insertions(+), 208 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/11452/2 -- To view, visit https://gerrit.osmocom.org/11452 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia8b01a1876e969d6f0760ea625e4df83af4f54ca Gerrit-Change-Number: 11452 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Pau Espin Pedrol
Change in osmo-ttcn3-hacks[master]: BTS_Tests: Use Misc_Helpers.f_shutdown consistently
Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/11452 ) Change subject: BTS_Tests: Use Misc_Helpers.f_shutdown consistently .. Patch Set 1: I like it, but see my comment on adding __LINE__ and __FILE__ in previous commit. -- To view, visit https://gerrit.osmocom.org/11452 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia8b01a1876e969d6f0760ea625e4df83af4f54ca Gerrit-Change-Number: 11452 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Oct 2018 11:27:11 + Gerrit-HasComments: No Gerrit-HasLabels: No
Change in osmo-ttcn3-hacks[master]: BTS_Tests: Use Misc_Helpers.f_shutdown consistently
daniel has uploaded this change for review. ( https://gerrit.osmocom.org/11452 Change subject: BTS_Tests: Use Misc_Helpers.f_shutdown consistently .. BTS_Tests: Use Misc_Helpers.f_shutdown consistently Replace all calls to setverdict(fail) with f_shutdown() since I'd rather fail and stop early in case we encounter an error. Only replace setverdict(pass) with f_shutdown() if it is followed by mtc.stop Remove internal function f_shutdown and use the one from Misc_Helpers Change-Id: Ia8b01a1876e969d6f0760ea625e4df83af4f54ca --- M bts/BTS_Tests.ttcn M bts/gen_links.sh 2 files changed, 131 insertions(+), 208 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/11452/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index fe0a933..38cfe78 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -1,5 +1,6 @@ module BTS_Tests { +import from Misc_Helpers all; import from General_Types all; import from GSM_Types all; import from GSM_RR_Types all; @@ -270,8 +271,7 @@ pcu_last_info := sd.data; } [] pt.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(?, ?, ?))) -> value sd { - setverdict(fail, "Invalid PCU Version/BTS Number received"); - mtc.stop; + Misc_Helpers.f_shutdown(fail, "Invalid PCU Version/BTS Number received"); } } @@ -289,8 +289,7 @@ alt { [] as_pcu_info_ind(pt, pcu_conn_id, pcu_last_info); [] T.timeout { - setverdict(fail, "Timeout waiting for PCU INFO_IND"); - mtc.stop; + Misc_Helpers.f_shutdown(fail, "Timeout waiting for PCU INFO_IND"); } } } @@ -341,8 +340,7 @@ alt { [] RSL_CCHAN.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}); [] T.timeout { - setverdict(fail, "Timeout waiting for ASP_IPA_EVENT_UP"); - mtc.stop; + Misc_Helpers.f_shutdown(fail, "Timeout waiting for ASP_IPA_EVENT_UP"); } } f_sleep(0.5); /* workaround for OS#3000 */ @@ -366,12 +364,6 @@ } } -function f_shutdown() runs on test_CT { - /* mtc.stop cleanly stops testcase execution to avoid unclean shutdown */ - all component.stop; - mtc.stop; -} - /* Attach L1CTL to master test_CT (classic tests, non-handler mode) */ function f_init_l1ctl() runs on test_CT { map(self:L1CTL, system:L1CTL); @@ -415,8 +407,7 @@ private altstep as_Tguard() runs on ConnHdlr { [] g_Tguard.timeout { - setverdict(fail, "Tguard timeout"); - mtc.stop; + Misc_Helpers.f_shutdown(fail, "Tguard timeout"); } } @@ -430,8 +421,7 @@ res := TRXC_CodecPort_CtrlFunct.f_IPL4_connect(BB_TRXC, mp_bb_trxc_ip, mp_bb_trxc_port, "", -1, -1, {udp:={}}, {}); if (not ispresent(res.connId)) { - setverdict(fail, "Could not connect to trx-control interface of trxcon, check your configuration"); - mtc.stop; + Misc_Helpers.f_shutdown(fail, "Could not connect to trx-control interface of trxcon, check your configuration"); } g_bb_trxc_conn_id := res.connId; } @@ -481,15 +471,13 @@ setverdict(pass); } [] T.timeout { - setverdict(fail, "Timeout expecting " & id); - mtc.stop; + Misc_Helpers.f_shutdown(fail, "Timeout expecting " & id); } [not ignore_other] as_l1_sacch(); [not ignore_other] as_meas_res(); [not ignore_other] as_l1_dcch(); [not ignore_other] RSL.receive { - setverdict(fail, "Unexpected RSL message received"); - mtc.stop; + Misc_Helpers.f_shutdown(fail, "Unexpected RSL message received"); } [ignore_other] RSL.receive { repeat; } } @@ -566,7 +554,7 @@ f_init(testcasename()); vc_conn := f_start_handler(refers(f_TC_chan_act_stress), pars); vc_conn.done; - f_shutdown(); + Misc_Helpers.f_shutdown(); } /* Test if re-activation of an already active channel fails as expected */ @@ -576,8 +564,7 @@ RSL.send(ts_RSL_CHAN_ACT(g_chan_nr, g_pars.chan_mode)); alt { [] RSL.receive(tr_RSL_CHAN_ACT_ACK(g_chan_nr)) { - setverdict(fail, "Unexpected CHAN ACT ACK on double activation"); - mtc.stop; + Misc_Helpers.f_shutdown(fail, "Unexpected CHAN ACT ACK on double activation"); } [] RSL.receive(tr_RSL_CHAN_ACT_NACK(g_chan_nr)) { setverdict(pass); @@ -591,7 +578,7 @@ f_init(); vc_conn := f_start_handler(refers(f_TC_chan_act_react), pars); vc_conn.done; - f_shutdown(); +