Change in osmo-ttcn3-hacks[master]: CTRL_Adapter: Add function to obtain FSM instance state

laforge gerrit-no-reply at
Thu Apr 1 19:31:12 UTC 2021

laforge has submitted this change. ( )

Change subject: CTRL_Adapter: Add function to obtain FSM instance state

CTRL_Adapter: Add function to obtain FSM instance state

This can be useful to verify expectations about the state of FSMs
in the IUT.

Change-Id: I33afc2e73be06e23147b5ac0b0fd3b9003935444
M library/Osmocom_CTRL_Adapter.ttcn
1 file changed, 17 insertions(+), 0 deletions(-)

  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve

diff --git a/library/Osmocom_CTRL_Adapter.ttcn b/library/Osmocom_CTRL_Adapter.ttcn
index adc2887..34ea300 100644
--- a/library/Osmocom_CTRL_Adapter.ttcn
+++ b/library/Osmocom_CTRL_Adapter.ttcn
@@ -112,5 +112,22 @@
 	f_ctrl_get_exp(pt, valueof(ts_bts_trx(bts_nr, trx_nr)) & suffix, exp);
+template (value) charstring ts_fsm_inst_id(charstring class_name, charstring inst_id) :=
+	"fsm." & class_name & ".id." & inst_id & ".";
+/* obtain the state of a specified FSM instance */
+function f_ctrl_get_fsm_inst_state(IPA_CTRL_PT pt, charstring fsm_class_name, charstring fsm_inst_id)
+return charstring {
+	return f_ctrl_get(pt, valueof(ts_fsm_inst_id(fsm_class_name, fsm_inst_id)) & "state");
+/* expect the state of a specified FSM instance to match template */
+function f_ctrl_get_exp_inst_state(IPA_CTRL_PT pt, charstring fsm_class_name,
+				   template (value) charstring fsm_inst_id,
+				   template (present) CtrlValue exp)
+	f_ctrl_get_exp(pt, valueof(ts_fsm_inst_id(fsm_class_name, valueof(fsm_inst_id))) & "state", exp);

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I33afc2e73be06e23147b5ac0b0fd3b9003935444
Gerrit-Change-Number: 23554
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at>
Gerrit-Reviewer: pespin <pespin at>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list