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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Mar 30 14:33:59 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23554 )


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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/23554/1

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 https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23554
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I33afc2e73be06e23147b5ac0b0fd3b9003935444
Gerrit-Change-Number: 23554
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210330/95d30050/attachment.htm>


More information about the gerrit-log mailing list