SIPp / sipp

The SIPp testing tool
https://sipp.readthedocs.io
Other
916 stars 380 forks source link

Regression: XML checks fail if less than character < is inside a string value #721

Closed mstovenour closed 5 months ago

mstovenour commented 5 months ago

I have existing scenario files that are modeled directly out of the documentation: https://sipp.readthedocs.io/en/latest/scenarios/variables.html?highlight=search_in#variables

<recv request="INVITE">
  <action>
    <ereg regexp="<sip:([^;@]*)" search_in="hdr" header="To:" assign_to="dummy,uri" />
  </action>
</recv>
<Reference variables="dummy" />

The less than character < inside the quotes of the regexp tag (regexp="<sip:([^;@]*)") causes the following failure when running with any release after v3.6.0: 2024-04-20 12:55:46.344095 1713635746.344095: Invalid XML in scenario

Existing scenario files work fine up until v3.5.3. They will not pass the XML check logic starting with v3.6.0.

I'm pretty sure this commit introduced the regression: https://github.com/SIPp/sipp/commit/411ccf40ab8fe77293e4a0f3ac8ad7739569d293 @wdoekes

It might be the deletion of this function call as the xp_find_start_tag_end() function is checking for embedded strings in quotes "". image

mstovenour commented 5 months ago

This looks like a duplicate of #670

wdoekes commented 5 months ago

Which in turn looks like a duplicate of #414

But if the documentation wrongly advises ="<..." then that should be fixed.

mstovenour commented 5 months ago

I see the conversation in #414 and I'll concede that SIPp previously supported invalid XML syntax, but it did so for two decades; yes I'm old. I think this would have taken me a lot less time if SIPp were to implement the following changes:

mstovenour commented 5 months ago

I just submitted a pull request for my suggestion to yet more notes for future me.