Change in osmo-ttcn3-hacks[master]: Osmocom_VTY_Functions: Generalize to handle multiple VTY ports

2018-09-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10978 )

Change subject: Osmocom_VTY_Functions: Generalize to handle multiple VTY ports
..

Osmocom_VTY_Functions: Generalize to handle multiple VTY ports

The existing Osmocom_VTY_Functions code was centered around a global
module parameter specifying the prompt prefix.  This prevented a
single test to use multiple VTY connections to different Osmocom
programs.

This patch generalize the code by widening the prompt matching
in f_vty_wait_for_prompt() and by allowing the caller to specify
the prompt prefix to override the modulepar.

Change-Id: I574b56c42fe95540af44a2c43d0fb469938c0e65
---
M library/Osmocom_VTY_Functions.ttcn
1 file changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/Osmocom_VTY_Functions.ttcn 
b/library/Osmocom_VTY_Functions.ttcn
index 427bd5c..b822645 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -12,24 +12,24 @@
template charstring t_vty_unknown := pattern "*% Unknown command.";

/* configure prompts in TELNETasp module */
-   function f_vty_set_prompts(TELNETasp_PT pt) {
+   function f_vty_set_prompts(TELNETasp_PT pt, charstring prompt_prefix := 
mp_prompt_prefix) {
var ASP_TelnetDynamicConfig vty_prompt[3] := {
{
prompt := {
id := 1,
-   prompt := mp_prompt_prefix & 
VTY_VIEW_SUFFIX,
+   prompt := prompt_prefix & 
VTY_VIEW_SUFFIX,
has_wildcards := false
}
}, {
prompt := {
id := 2,
-   prompt := mp_prompt_prefix & 
VTY_ENABLE_SUFFIX,
+   prompt := prompt_prefix & 
VTY_ENABLE_SUFFIX,
has_wildcards := false
}
}, {
prompt := {
id := 3,
-   prompt := mp_prompt_prefix & 
VTY_CFG_SUFFIX,
+   prompt := prompt_prefix & 
VTY_CFG_SUFFIX,
has_wildcards := true
}
}
@@ -51,9 +51,9 @@

T.start;
alt {
-   [] pt.receive(mp_prompt_prefix & VTY_VIEW_SUFFIX) { };
-   [] pt.receive(mp_prompt_prefix & VTY_ENABLE_SUFFIX) { };
-   [] pt.receive(pattern mp_prompt_prefix & 
VTY_CFG_SUFFIX) { };
+   [] pt.receive(pattern "\w+" & VTY_VIEW_SUFFIX) { };
+   [] pt.receive(pattern "\w+\# ") { };
+   [] pt.receive(pattern "\w+" & VTY_CFG_SUFFIX) { };
[] pt.receive(t_vty_unknown) {
testcase.stop(fail, "VTY: Unknown Command");
};

--
To view, visit https://gerrit.osmocom.org/10978
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I574b56c42fe95540af44a2c43d0fb469938c0e65
Gerrit-Change-Number: 10978
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ttcn3-hacks[master]: Osmocom_VTY_Functions: Generalize to handle multiple VTY ports

2018-09-16 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10978 )

Change subject: Osmocom_VTY_Functions: Generalize to handle multiple VTY ports
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10978
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: I574b56c42fe95540af44a2c43d0fb469938c0e65
Gerrit-Change-Number: 10978
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Comment-Date: Sun, 16 Sep 2018 10:43:41 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: Osmocom_VTY_Functions: Generalize to handle multiple VTY ports

2018-09-16 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/10978


Change subject: Osmocom_VTY_Functions: Generalize to handle multiple VTY ports
..

Osmocom_VTY_Functions: Generalize to handle multiple VTY ports

The existing Osmocom_VTY_Functions code was centered around a global
module parameter specifying the prompt prefix.  This prevented a
single test to use multiple VTY connections to different Osmocom
programs.

This patch generalize the code by widening the prompt matching
in f_vty_wait_for_prompt() and by allowing the caller to specify
the prompt prefix to override the modulepar.

Change-Id: I574b56c42fe95540af44a2c43d0fb469938c0e65
---
M library/Osmocom_VTY_Functions.ttcn
1 file changed, 7 insertions(+), 7 deletions(-)



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

diff --git a/library/Osmocom_VTY_Functions.ttcn 
b/library/Osmocom_VTY_Functions.ttcn
index 427bd5c..b822645 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -12,24 +12,24 @@
template charstring t_vty_unknown := pattern "*% Unknown command.";

/* configure prompts in TELNETasp module */
-   function f_vty_set_prompts(TELNETasp_PT pt) {
+   function f_vty_set_prompts(TELNETasp_PT pt, charstring prompt_prefix := 
mp_prompt_prefix) {
var ASP_TelnetDynamicConfig vty_prompt[3] := {
{
prompt := {
id := 1,
-   prompt := mp_prompt_prefix & 
VTY_VIEW_SUFFIX,
+   prompt := prompt_prefix & 
VTY_VIEW_SUFFIX,
has_wildcards := false
}
}, {
prompt := {
id := 2,
-   prompt := mp_prompt_prefix & 
VTY_ENABLE_SUFFIX,
+   prompt := prompt_prefix & 
VTY_ENABLE_SUFFIX,
has_wildcards := false
}
}, {
prompt := {
id := 3,
-   prompt := mp_prompt_prefix & 
VTY_CFG_SUFFIX,
+   prompt := prompt_prefix & 
VTY_CFG_SUFFIX,
has_wildcards := true
}
}
@@ -51,9 +51,9 @@

T.start;
alt {
-   [] pt.receive(mp_prompt_prefix & VTY_VIEW_SUFFIX) { };
-   [] pt.receive(mp_prompt_prefix & VTY_ENABLE_SUFFIX) { };
-   [] pt.receive(pattern mp_prompt_prefix & 
VTY_CFG_SUFFIX) { };
+   [] pt.receive(pattern "\w+" & VTY_VIEW_SUFFIX) { };
+   [] pt.receive(pattern "\w+\# ") { };
+   [] pt.receive(pattern "\w+" & VTY_CFG_SUFFIX) { };
[] pt.receive(t_vty_unknown) {
testcase.stop(fail, "VTY: Unknown Command");
};

--
To view, visit https://gerrit.osmocom.org/10978
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I574b56c42fe95540af44a2c43d0fb469938c0e65
Gerrit-Change-Number: 10978
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte