Test specification questions

Nicolas Niclausse nicolas at niclux.org
Sun Dec 4 22:49:35 CET 2005


Mark Smith a écrit :
> Your patch works great, so far as I can tell!  Thanks!  I've
> specifically tested the following:
> 
> - The work-around for the Erlang bug works great.
> - The on_badmatch="stop" works great.
> - The on_badmatch="loop" works great in the "don't loop" state.  I
> haven't seen enough load to get it to loop yet.  I'll let you know how
> that goes when I generate that much load.  (Will probably require more
> client horse power than I have on my desktop, and we don't have all this
> installed on the cluster yet.)
> - I've not tried the neg_match="true" stuff yet.
> 
> I'd like to point out, however, that "str1.*str2" doesn't work is str1
> and str2 are on different lines.  I think the problem is that '.'
> doesn't normally match a new-line.  I tried doing "str1[.\n]*str2" but
> either Erlang or Tsunami tried to escape the back-slash, and it tried to
> match "str1[.\\n]*str2" which isn't going to work either.
> 
> In perl, there is a flag you pass to the RegEx engine that tells it to
> treat it as a multi-line match, and it lets '.' match a new-line.  Does
> Erlang have something similar?  (In perl, it's an 'm' at the end of the
> match:   /str1.*str2/m )
> 
> What I have so far is working and will do the job I need.  However, I
> would like to request another enhancement for a much more robust test: 
> The ability to specify multiple "match" strings, each with their own
> "on_badmatch" and "neg_match" options.  This would allow me to specify
> strings that I expect to see to tell me that I got to the right page as
> well as strings that I expect _NOT_ to see, such as error messages.
> Multiple "match" strings would also negate the need for the multi-line
> match I discussed above; I could just specify multiple match strings for
> str1 and str2.

OK, i've implemented the multiple matchs feature

The syntax is:
<match do="continue|abort|loop|restart" when="match|nomatch">regexp</match>

for ex:
<request>
      <match do="continue" when="nomatch">Welcome|Bienvenue</match>
      <match do="abort" when="match">Login Incorrect</match>
      <match do="loop" when="match" sleep_loop="2"
max_loop="5">Retry</match>
      <http url= .../>
</request>

"restart" will restart the session from the beginning.

The patch is against v1.1.0

-- 
Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: match.patch
Type: text/x-patch
Size: 13467 bytes
Desc: not available
Url : http://lists.process-one.net/pipermail/tsung-users/attachments/20060520/c060b96d/match.bin


More information about the Tsung-users mailing list