[Asterisk-code-review] channels/pjsip/subscriptions/rls: Refactor RLSTest to inheri... (testsuite[master])
Matt Jordan
asteriskteam at digium.com
Sun Nov 22 20:18:51 CST 2015
Hello Anonymous Coward #1000019,
I'd like you to reexamine a change. Please visit
https://gerrit.asterisk.org/1686
to look at the new patch set (#3).
Change subject: channels/pjsip/subscriptions/rls: Refactor RLSTest to inherit from VOIPProxy
......................................................................
channels/pjsip/subscriptions/rls: Refactor RLSTest to inherit from VOIPProxy
This patch refactors the RLSTest class to inherit from VOIPProxy. For the most
part, this consists of merely making the class inherit from VOIPProxy as
opposed to VOIPListener. However, a few other modifications were made in
addition to this change:
(1) Printing out a dictionary of an instance of a class prints out a lot more
information than is warranted (such as the class's pydoc strings, etc.)
In reality, all we need to see is the contents of the packet. As such, we
now just print out a string representation of the packet. This defers
the string representation of the instance to the derived classes of
Packet.
(2) Because we spend a lot of time in verification, Asterisk can retransmit a
NOTIFY request. That's perfectly acceptable; however, it breaks the logic
introduced in de4b8fb that erroneously assumes we will not receive
retransmits. Since it is a good idea to make sure that we don't receive
more expected NOTIFY requests than we are checking for, we now extract
the CSeq from the SIPPacket and keep track of the last known CSeq. That
handles the case of re-transmits.
(3) For some subscriptions, Asterisk will transmit NOTIFY requests on shutdown
due to the subscription being terminated. This also breaks the logic
introduced in de4b8fb around expected NOTIFY requests. However, in this
case, there isn't a good way to prevent Asterisk from doing this or even
knowing at that point that we're shutting down. A stop observer on the
test_object will not necessarily be called quickly enough, as Asterisk
can be a tad aggressive on shutting itself down. As such, we merely check
the _stopping variable on the test_object, and refuse to look at packets
after Asterisk starts shutting down.
ASTERISK-25430
Change-Id: I02258ed1e4850d2c249cbf08944e5f5338689ff0
---
M tests/channels/pjsip/subscriptions/rls/rls_test.py
1 file changed, 24 insertions(+), 31 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/86/1686/3
--
To view, visit https://gerrit.asterisk.org/1686
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I02258ed1e4850d2c249cbf08944e5f5338689ff0
Gerrit-PatchSet: 3
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
More information about the asterisk-code-review
mailing list