Osmocom_CTRL: Fix matching on incoming trap; avoid generating error verdicts in functions
diff --git a/library/Osmocom_CTRL_Functions.ttcn b/library/Osmocom_CTRL_Functions.ttcn
index a9fccb9..b8e68e3 100644
--- a/library/Osmocom_CTRL_Functions.ttcn
+++ b/library/Osmocom_CTRL_Functions.ttcn
@@ -14,13 +14,16 @@
pt.send(ts_CtrlMsgGet(id, variable));
T.start;
alt {
- [] pt.receive(tr_CtrlMsgGetRepl(id, variable)) -> value rx { }
+ [] pt.receive(tr_CtrlMsgGetRepl(id, variable)) -> value rx {
+ }
[] pt.receive(tr_CtrlMsgTrap) { repeat; }
[] pt.receive(tr_CtrlMsgError) -> value rx {
setverdict(fail, "Error in CTRL GET ", variable, ": ", rx.err.reason);
+ return "FAIL";
}
[] T.timeout {
setverdict(fail, "Timeout waiting for CTRL GET REPLY ", variable);
+ return "TIMEOUT";
}
}
return rx.resp.val;
@@ -52,9 +55,11 @@
var CtrlMessage rx;
T.start;
alt {
- [] pt.receive(tr_CtrlMsgTrap(variable, val)) -> value rx {}
+ [] pt.receive(tr_CtrlMsgTrap(variable, val)) -> value rx {
+ }
[] T.timeout {
setverdict(fail, "Timeout waiting for TRAP ", variable);
+ return "TIMEOUT";
}
}
return rx.trap.val;
diff --git a/library/Osmocom_CTRL_Types.ttcn b/library/Osmocom_CTRL_Types.ttcn
index 9c993af..5d6ddae 100644
--- a/library/Osmocom_CTRL_Types.ttcn
+++ b/library/Osmocom_CTRL_Types.ttcn
@@ -3,7 +3,7 @@
type charstring CtrlVerb ("GET", "SET") with {
/* see https://www.eclipse.org/forums/index.php/t/1088893/ on why this
* match expression is needed here */
- variant "TEXT_CODING(,convert=upper_case,'((GET)|(SET)|(TRAP))',case_insensitive)"
+ variant "TEXT_CODING(,convert=upper_case,'((GET)|(SET))',case_insensitive)"
};
type charstring CtrlReplyVerb ("GET_REPLY", "SET_REPLY") with {
@@ -46,7 +46,7 @@
CtrlVariable variable,
CtrlValue val
} with {
- variant "BEGIN('TRAP ',,case_insensitive)"
+ variant "BEGIN('TRAP 0 ',,case_insensitive)"
variant "SEPARATOR(' ',)"
};