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
This commit is contained in:
Oliver Smith 2019-06-07 12:27:33 +02:00 committed by laforge
parent 61edb7e974
commit 141620d343
1 changed files with 13 additions and 0 deletions

View File

@ -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