sysinfo: Fail in case VTY returns "Unknown command"
diff --git a/sysinfo/Test.ttcn b/sysinfo/Test.ttcn
index c30ad6a..79b367b 100644
--- a/sysinfo/Test.ttcn
+++ b/sysinfo/Test.ttcn
@@ -459,6 +459,7 @@
/* VTY initialization */
map(self:BSCVTY, system:BSCVTY);
f_vty_set_prompts(BSCVTY)
+ f_vty_transceive(BSCVTY, "enable");
initialized := true;
}
@@ -612,6 +613,7 @@
const charstring NORMAL_PROMPT := "OpenBSC> ";
const charstring ENABLE_PROMPT := "OpenBSC# ";
const charstring CONFIG_PROMPT := "OpenBSC(*)\#";
+ template charstring t_vty_unknown := "% Unknown command.";
const ASP_TelnetDynamicConfig vty_prompt[3] := {
{
@@ -656,7 +658,7 @@
[] pt.receive(NORMAL_PROMPT) { };
[] pt.receive(ENABLE_PROMPT) { };
[] pt.receive(config_pattern) { };
- /* FIXME: "% Unknown command" and the like! */
+ [] pt.receive(t_vty_unknown) { setverdict(fail, "VTY: Unknown Command") };
[] pt.receive(charstring:?) -> value rx { buf := buf & rx; repeat };
[] T.timeout { setverdict(fail, "VTY Timeout for prompt"); return ""};
}
@@ -678,7 +680,6 @@
/* enter the'confiugration' mode of the VTY */
function f_vty_enter_config(TELNETasp_PT pt) {
- f_vty_transceive(pt, "enable");
f_vty_transceive(pt, "configure terminal")
}
@@ -743,7 +744,7 @@
testcase TC_telnet() runs on dummy_CT {
f_init();
-
+ f_vty_enter_config(BSCVTY);
f_vty_transceive(BSCVTY, "show network")
f_vty_transceive(BSCVTY, "network")
f_vty_transceive(BSCVTY, "bts 0")