<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14401">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">hlr: f_vty_subscr_show(): add invert arg<br><br>Allow inverting the pattern in f_vty_transceive_match() and<br>f_vty_subscr_show(). On failure, mention the pattern in the test<br>verdict, and whether it should have had an inverted match or not.<br><br>This will be used by upcoming tests for the check IMEI GSUP message<br>type, to check if the IMEI was not stored, depending on the OsmoHLR<br>configuration.<br><br>Change-Id: I176d8fd2ee74e1eb7ac797f931cd6005d398740f<br>---<br>M hlr/HLR_Tests.ttcn<br>1 file changed, 10 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/01/14401/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/hlr/HLR_Tests.ttcn b/hlr/HLR_Tests.ttcn</span><br><span>index b6bd1ad..21089dd 100644</span><br><span>--- a/hlr/HLR_Tests.ttcn</span><br><span>+++ b/hlr/HLR_Tests.ttcn</span><br><span>@@ -294,10 +294,15 @@</span><br><span>         return sl;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-function f_vty_transceive_match(TELNETasp_PT pt, charstring cmd, template charstring exp_ret) {</span><br><span style="color: hsl(120, 100%, 40%);">+function f_vty_transceive_match(TELNETasp_PT pt, charstring cmd, template charstring exp_ret,</span><br><span style="color: hsl(120, 100%, 40%);">+                             boolean invert := false) {</span><br><span>   var charstring ret := f_vty_transceive_ret(pt, cmd);</span><br><span style="color: hsl(0, 100%, 40%);">-    if (not match(ret, exp_ret)) {</span><br><span style="color: hsl(0, 100%, 40%);">-          setverdict(fail, "Non-matching VTY response: ", ret);</span><br><span style="color: hsl(120, 100%, 40%);">+       var boolean is_match := match(ret, exp_ret);</span><br><span style="color: hsl(120, 100%, 40%);">+  if (is_match and invert) {</span><br><span style="color: hsl(120, 100%, 40%);">+            setverdict(fail, "Non-matching VTY response: ", ret, ", should *not* have matched: ", exp_ret);</span><br><span style="color: hsl(120, 100%, 40%);">+           mtc.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+     } else if (not is_match and not invert) {</span><br><span style="color: hsl(120, 100%, 40%);">+             setverdict(fail, "Non-matching VTY response: ", ret, ", should have matched: ", exp_ret);</span><br><span>                mtc.stop;</span><br><span>    }</span><br><span> }</span><br><span>@@ -346,9 +351,9 @@</span><br><span> }</span><br><span> </span><br><span> /* perform 'show' on subscriber; match result with pattern 'exp' */</span><br><span style="color: hsl(0, 100%, 40%);">-function f_vty_subscr_show(TELNETasp_PT VTY, HlrSubscriber sub, template charstring exp) {</span><br><span style="color: hsl(120, 100%, 40%);">+function f_vty_subscr_show(TELNETasp_PT VTY, HlrSubscriber sub, template charstring exp, boolean invert := false) {</span><br><span>  var charstring prefix := valueof(t_subscr_prefix(sub.imsi));</span><br><span style="color: hsl(0, 100%, 40%);">-    f_vty_transceive_match(VTY, prefix & "show", exp);</span><br><span style="color: hsl(120, 100%, 40%);">+      f_vty_transceive_match(VTY, prefix & "show", exp, invert);</span><br><span> }</span><br><span> </span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14401">change 14401</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14401"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I176d8fd2ee74e1eb7ac797f931cd6005d398740f </div>
<div style="display:none"> Gerrit-Change-Number: 14401 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>