summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-06-07 12:27:33 +0200
committerlaforge <laforge@gnumonks.org>2019-06-13 09:35:05 +0000
commit141620d3430308ada9d9196557af0c9284bfec87 (patch)
tree4c869ec7f3f37a66e815ed50b46a6a62289eab12
parent61edb7e974e1aacce45f46b3f13e26fea55e552f (diff)
hlr: add f_vty_subscr_show_nomatch()
Allow to check if a certain pattern does not match the "show subscriber" output. This will be used by upcoming tests for the check IMEI GSUP message type, to check if the IMEI was not stored, depending on the OsmoHLR configuration. Change-Id: I176d8fd2ee74e1eb7ac797f931cd6005d398740f
-rw-r--r--hlr/HLR_Tests.ttcn13
1 files changed, 13 insertions, 0 deletions
diff --git a/hlr/HLR_Tests.ttcn b/hlr/HLR_Tests.ttcn
index b6bd1ad..e58515b 100644
--- a/hlr/HLR_Tests.ttcn
+++ b/hlr/HLR_Tests.ttcn
@@ -302,6 +302,14 @@ function f_vty_transceive_match(TELNETasp_PT pt, charstring cmd, template charst
}
}
+function f_vty_transceive_nomatch(TELNETasp_PT pt, charstring cmd, template charstring exp_ret) {
+ var charstring ret := f_vty_transceive_ret(pt, cmd);
+ if (match(ret, exp_ret)) {
+ setverdict(fail, "Matching VTY response: ", ret, ", should *not* have matched: ", exp_ret);
+ mtc.stop;
+ }
+}
+
private template (value) charstring t_subscr_prefix(hexstring imsi) :=
"subscriber imsi " & hex2str(imsi) & " ";
@@ -351,6 +359,11 @@ function f_vty_subscr_show(TELNETasp_PT VTY, HlrSubscriber sub, template charstr
f_vty_transceive_match(VTY, prefix & "show", exp);
}
+/* perform 'show' on subscriber; result must not match with pattern 'exp' */
+function f_vty_subscr_show_nomatch(TELNETasp_PT VTY, HlrSubscriber sub, template charstring exp) {
+ var charstring prefix := valueof(t_subscr_prefix(sub.imsi));
+ f_vty_transceive_nomatch(VTY, prefix & "show", exp);
+}
/***********************************************************************
* Helper functions for ConnHdlr