library/VTY: fix CONFIG prompt matching in f_vty_wait_for_prompt()
Matching the CONFIG prompt using implicit '\w+(*)' pattern is
a bad idea, because it can actually match almost anything:
- 'OsmoBlaBla(config)# ',
- 'OsmoBlaBla(config) ',
- 'OsmoBlaBla> ',
- 'Mahlzeit'!
One problem is that the parentheses are interpreted as a matching
operator (which is used to group an expression), so they should
have been escaped by '\'. Another problem is that this pattern
is not complete, because '\# ' is missing. Let's fix this!
Change-Id: I8a0e3fcfb0c4e5854b7b1e39296052e679c63c73
Related: OS#3675
diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn
index b822645..86f58f1 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -53,7 +53,7 @@
alt {
[] pt.receive(pattern "\w+" & VTY_VIEW_SUFFIX) { };
[] pt.receive(pattern "\w+\# ") { };
- [] pt.receive(pattern "\w+" & VTY_CFG_SUFFIX) { };
+ [] pt.receive(pattern "\w+\(*\)\# ") { };
[] pt.receive(t_vty_unknown) {
testcase.stop(fail, "VTY: Unknown Command");
};