summaryrefslogtreecommitdiffstats
path: root/sysinfo
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-16 01:34:15 +0200
committerHarald Welte <laforge@gnumonks.org>2017-07-16 01:34:40 +0200
commitfd512cb889d8c7cfc3d41ac403a788fb29821656 (patch)
tree5e37df834f005bc02f4a2ea661fbd9fc130a8dc3 /sysinfo
parentfe1052d32121343da4df1f29790a8920038e7237 (diff)
sysinfo: Fail in case VTY returns "Unknown command"
Diffstat (limited to 'sysinfo')
-rw-r--r--sysinfo/Test.ttcn7
1 files changed, 4 insertions, 3 deletions
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 @@ module Test {
/* VTY initialization */
map(self:BSCVTY, system:BSCVTY);
f_vty_set_prompts(BSCVTY)
+ f_vty_transceive(BSCVTY, "enable");
initialized := true;
}
@@ -612,6 +613,7 @@ module Test {
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 @@ module Test {
[] 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 @@ module Test {
/* 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 @@ module Test {
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")