aboutsummaryrefslogtreecommitdiffstats
path: root/library/Osmocom_VTY_Functions.ttcn
diff options
context:
space:
mode:
Diffstat (limited to 'library/Osmocom_VTY_Functions.ttcn')
-rw-r--r--library/Osmocom_VTY_Functions.ttcn9
1 files changed, 9 insertions, 0 deletions
diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn
index 6e4eb74c..427bd5c3 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -46,6 +46,7 @@ module Osmocom_VTY_Functions {
/* wait for any of the permitted prompts; buffer + return all intermediate output */
function f_vty_wait_for_prompt(TELNETasp_PT pt) return charstring {
var charstring rx, buf := "";
+ var integer fd;
timer T := 2.0;
T.start;
@@ -57,6 +58,14 @@ module Osmocom_VTY_Functions {
testcase.stop(fail, "VTY: Unknown Command");
};
[] pt.receive(charstring:?) -> value rx { buf := buf & rx; repeat };
+ [] pt.receive(integer:?) -> value fd {
+ if (fd == -1) {
+ setverdict(fail, "VTY Telnet Connection Failure");
+ mtc.stop;
+ } else {
+ repeat; /* telnet connection succeeded */
+ }
+ }
[] T.timeout {
setverdict(fail, "VTY Timeout for prompt");
mtc.stop;